mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 09:05:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d00953b220 |
No files matched your search
@@ -1,14 +0,0 @@
|
||||
* text eol=lf
|
||||
*.bat text eol=crlf
|
||||
*.patch text eol=lf
|
||||
*.java text eol=lf
|
||||
*.gradle text eol=crlf
|
||||
*.png binary
|
||||
*.exe binary
|
||||
*.dll binary
|
||||
*.jar binary
|
||||
*.lzma binary
|
||||
*.zip binary
|
||||
*.pyd binary
|
||||
*.cfg text eol=lf
|
||||
*.py text eol=lf
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
#eclipse
|
||||
/bin
|
||||
/.settings
|
||||
/.classpath
|
||||
|
||||
#idea
|
||||
/.idea
|
||||
*.iml
|
||||
|
||||
#gradle
|
||||
/build
|
||||
/.gradle
|
||||
|
||||
#occupational hazards
|
||||
/eclipse/
|
||||
/repo/
|
||||
/buildSrc
|
||||
|
||||
#Patch rejects
|
||||
*.rej
|
||||
/patches-/
|
||||
# FML changelog
|
||||
changelog.txt
|
||||
/patches_old/
|
||||
/patches_old_bak/
|
||||
*.py
|
||||
*.7z
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "fml"]
|
||||
path = fml
|
||||
url = https://github.com/MinecraftForge/FML.git
|
||||
@@ -1,10 +0,0 @@
|
||||
Contributing to Forge
|
||||
=====================
|
||||
|
||||
1) Keep patches to Minecraft classes minimal. If you need a lot of things done, you may either add to relevant forge classes or make a new class.
|
||||
|
||||
2) An example mod must be provided for all PRs adding events/hooks to Forge. Whether it's a full mod using your proposed hooks, or just a pastebin containing a simple example, an example mod is required. Please also explain in detail what your new hook does.
|
||||
|
||||
3) Follow Forge coding guidelines (braces on newlines, spaces instead of tabs, etc)
|
||||
|
||||
For more information, refer to [the wiki](https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge)
|
||||
@@ -1,26 +0,0 @@
|
||||
* Eloraam *
|
||||
|
||||
* FlowerChild *
|
||||
|
||||
* Hawkye *
|
||||
|
||||
* MALfunction84 *
|
||||
|
||||
Submitted the sleep handler code for his mod (Somnia) and others to use.
|
||||
|
||||
* Scokeev9 *
|
||||
|
||||
Gave permission for ScotTools API to be integrated into MCF, and also supported the Forge by converting his mods to use it.
|
||||
|
||||
ScotTools Background: ScotTools was an API that enabled modders to add blocks to harvesting levels (and many other ease-of-use features to create new tools), and the first tool API that used block material for block breaking efficiency which allowed blocks from mods that didn't use ScotTools API to break with the correct speed.
|
||||
|
||||
* SpaceToad *
|
||||
|
||||
* LexManos *
|
||||
|
||||
* cpw *
|
||||
|
||||
* Minecraft Coder Pack (MCP) *
|
||||
Forge Mod Loader and Minecraft Forge have permission to distribute and automatically download components of MCP and distribute MCP data files.
|
||||
This permission is not transitive and others wishing to redistribute the Minecraft Forge source independently should seek permission of MCP or
|
||||
remove the MCP data files and request their users to download MCP separately.
|
||||
@@ -1,10 +0,0 @@
|
||||
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.
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
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.
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
*** HOW TO INSTALL ***
|
||||
For Mod Users:
|
||||
|
||||
Download the latest installer from http://files.minecraftforge.net and follow instructions given by the installer.
|
||||
|
||||
|
||||
For Mod Devs:
|
||||
|
||||
Download the latest Forge source distribution from http://files.minecraftforge.net and unzip it to a folder.
|
||||
Open a command prompt, navigate to the directory where you unzipped the Forge sources, and run:
|
||||
If you have Gradle: gradle setupDevWorkspace
|
||||
If you DO NOT have Gradle installed:
|
||||
Windows: ./gradlew.bat setupDevWorkspace
|
||||
MacOS/Linux: ./gradlew setupDevWorkspace
|
||||
|
||||
If you wish to use the Eclipse IDE, run gradle eclipse instead of gradle setupDevWorkspace, or install the Gradle plugin for Eclipse and import the Forge source folder as a Gradle project.
|
||||
|
||||
To get the decompiled classes:
|
||||
If you have Gradle: gradle setupDecompWorkspace
|
||||
If you DO NOT have Gradle installed:
|
||||
Windows: ./gradlew.bat setupDecompWorkspace
|
||||
MacOS/Linux: ./gradlew setupDecompWorkspace
|
||||
|
||||
For Contributors: (Note: This assumes you have Gradle installed. If you don't, use ./gradlew(.bat) instead of gradle.
|
||||
|
||||
Clone this repository to a folder.
|
||||
Open a command prompt and navigate to the folder where you cloned this repo.
|
||||
Run gradle setupForge to setup your development environment.
|
||||
|
||||
To use Eclipse, point your Eclipse workspace at the eclipse folder inside the repo.
|
||||
|
||||
|
||||
Requirements (for both mod devs and contributors):
|
||||
You must have a JDK installed and accessible.
|
||||
If you do not wish to use the gradle wrapper, you can install Gradle from http://www.gradle.org/ .
|
||||
|
||||
-128
@@ -1,128 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
deployJars
|
||||
}
|
||||
|
||||
import static net.minecraftforge.gradle.dev.ForgeDevPlugin.*
|
||||
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'forgedev'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
flatDir {
|
||||
name "fileRepo"
|
||||
dirs "repo"
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = '1.8'
|
||||
mcpVersion = '9.10'
|
||||
mappings = 'snapshot_nodoc_20141130'
|
||||
fmlDir = projectDir.getAbsolutePath() + "/fml";
|
||||
mainClass = 'net.minecraftforge.fml.relauncher.ServerLaunchWrapper'
|
||||
tweakClass = 'net.minecraftforge.fml.common.launcher.FMLTweaker'
|
||||
installerVersion = "1.4"
|
||||
}
|
||||
|
||||
group = 'net.minecraftforge'
|
||||
version = getVersionFromJava(getProject(), 'src/main/java/net/minecraftforge/common/ForgeVersion.java')
|
||||
|
||||
jenkins {
|
||||
job = 'minecraftforge'
|
||||
}
|
||||
|
||||
// crowdin stuff
|
||||
if (project.hasProperty("crowdinKey"))
|
||||
tasks.getLocalizations.apiKey = project.crowdinKey
|
||||
|
||||
|
||||
launch4j {
|
||||
jreMinVersion = '1.6.0'
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
add getProject().repositories.mavenLocal()
|
||||
}
|
||||
repositories.mavenDeployer {
|
||||
configuration = configurations.deployJars
|
||||
|
||||
if (project.hasProperty("filesmaven")) {
|
||||
logger.info('Publishing to files server')
|
||||
repository(url: project.filesmaven.url) {
|
||||
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
|
||||
}
|
||||
} else {
|
||||
logger.info('Publishing to repo folder')
|
||||
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
||||
}
|
||||
|
||||
pom {
|
||||
groupId = project.group
|
||||
version = project.version
|
||||
artifactId = project.archivesBaseName
|
||||
}
|
||||
pom.project {
|
||||
name project.archivesBaseName
|
||||
packaging 'jar'
|
||||
description 'Minecraft Forge API'
|
||||
url 'https://github.com/MinecraftForge/MinecraftForge'
|
||||
|
||||
scm {
|
||||
url 'https://github.com/MinecraftForge/MinecraftForge'
|
||||
connection 'scm:git:git://github.com/MinecraftForge/MinecraftForge.git'
|
||||
developerConnection 'scm:git:[email protected]:MinecraftForge/MinecraftForge.git'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system 'github'
|
||||
url 'https://github.com/MinecraftForge/MinecraftForge/issues'
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'Forge Public License'
|
||||
url 'https://raw.github.com/MinecraftForge/MinecraftForge/master/MinecraftForge-License.txt'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id 'cpw'
|
||||
name 'cpw'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'LexManos'
|
||||
name 'Lex Manos'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'AbrarSyed'
|
||||
name 'Abrar Syed'
|
||||
roles { role 'contributor' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
-1
Submodule fml deleted from d4ded9d6e2.
Executable
+11
@@ -0,0 +1,11 @@
|
||||
cd ..
|
||||
|
||||
rmdir /S /Q src
|
||||
mkdir src
|
||||
xcopy /Y /E src_work\* src\
|
||||
|
||||
xcopy /Y /E forge\forge_client\src\net\* src\minecraft\net
|
||||
xcopy /Y /E forge\forge_common\net\* src\minecraft\net
|
||||
xcopy /Y /E forge\forge_common\net\* src\minecraft_server\net
|
||||
|
||||
cmd /C recompile.bat
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
|
||||
rm -rf src bin src_forge
|
||||
|
||||
cp -a src_work src_forge
|
||||
|
||||
cp -a forge/forge_client/src/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft_server/net/
|
||||
|
||||
cp -a src_forge src
|
||||
|
||||
./recompile.sh
|
||||
|
||||
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
forge_client/src/net/minecraft/src/forge/
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
forge_common/net/minecraft/src/forge
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="forge_common"/>
|
||||
<classpathentry kind="src" path="minecraft"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/jinput.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl_util.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/minecraft.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>forge_client</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>forge_common</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/forge_common</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>minecraft</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-WORKSPACE_LOC/src_work/minecraft</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockTextureParticles {
|
||||
public String texture;
|
||||
public List effects;
|
||||
|
||||
public BlockTextureParticles(){
|
||||
effects = new ArrayList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.RenderBlocks;
|
||||
import net.minecraft.src.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class ForgeHooksClient {
|
||||
public static boolean canRenderInPass(Block block, int pass) {
|
||||
if(block instanceof IMultipassRender) {
|
||||
IMultipassRender impr = (IMultipassRender) block;
|
||||
return impr.canRenderInPass(pass);
|
||||
}
|
||||
if(pass==block.getRenderBlockPass()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static HashMap tessellators=new HashMap();
|
||||
static HashMap textures=new HashMap();
|
||||
static boolean inWorld=false;
|
||||
static HashSet renderTextureTest=new HashSet();
|
||||
static ArrayList<List> renderTextureList=new ArrayList();
|
||||
|
||||
protected static void bindTessellator(int tex, int sub) {
|
||||
List key=Arrays.asList(tex,sub);
|
||||
Tessellator t;
|
||||
if(!tessellators.containsKey(key)) {
|
||||
t=new Tessellator();
|
||||
tessellators.put(key,t);
|
||||
} else {
|
||||
t=(Tessellator)tessellators.get(key);
|
||||
}
|
||||
if(inWorld && !renderTextureTest.contains(key)) {
|
||||
renderTextureTest.add(key);
|
||||
renderTextureList.add(key);
|
||||
t.startDrawingQuads();
|
||||
t.setTranslationD(Tessellator.firstInstance.xOffset,
|
||||
Tessellator.firstInstance.yOffset,
|
||||
Tessellator.firstInstance.zOffset);
|
||||
}
|
||||
Tessellator.instance=t;
|
||||
}
|
||||
|
||||
protected static void bindTexture(String name, int sub) {
|
||||
int n;
|
||||
if(!textures.containsKey(name)) {
|
||||
n=ModLoader.getMinecraftInstance().renderEngine
|
||||
.getTexture(name);
|
||||
textures.put(name,n);
|
||||
} else {
|
||||
n=(Integer)textures.get(name);
|
||||
}
|
||||
if(!inWorld) {
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */,n);
|
||||
return;
|
||||
}
|
||||
bindTessellator(n,sub);
|
||||
}
|
||||
|
||||
protected static void unbindTexture() {
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
if(!inWorld) {
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static void beforeRenderPass(int pass) {
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
renderTextureTest.clear();
|
||||
renderTextureList.clear();
|
||||
inWorld=true;
|
||||
}
|
||||
|
||||
public static void afterRenderPass(int pass) {
|
||||
inWorld=false;
|
||||
for(List l : renderTextureList) {
|
||||
// TODO: call appropriate client hooks
|
||||
Integer[] tn=(Integer[])l.toArray();
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D,tn[0]);
|
||||
Tessellator t=(Tessellator)tessellators.get(l);
|
||||
t.draw();
|
||||
}
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
}
|
||||
|
||||
public static void beforeBlockRender(Block block,
|
||||
RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
ITextureProvider itp=(ITextureProvider)block;
|
||||
bindTexture(itp.getTextureFile(),0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void afterBlockRender(Block block,
|
||||
RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
}
|
||||
}
|
||||
|
||||
public static void overrideTexture (Object o) {
|
||||
if (o instanceof ITextureProvider) {
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture(((ITextureProvider) (o))
|
||||
.getTextureFile()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.RenderBlocks;
|
||||
import net.minecraft.src.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class MinecraftForgeClient {
|
||||
public static void bindTexture(String name, int sub) {
|
||||
ForgeHooksClient.bindTexture(name,sub);
|
||||
}
|
||||
|
||||
public static void bindTexture(String name) {
|
||||
ForgeHooksClient.bindTexture(name,0);
|
||||
}
|
||||
|
||||
public static void unbindTexture() {
|
||||
ForgeHooksClient.unbindTexture();
|
||||
}
|
||||
|
||||
public static void preloadTexture(String texture) {
|
||||
ModLoader.getMinecraftInstance().renderEngine
|
||||
.getTexture(texture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
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.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
|
||||
/**
|
||||
* This class offers advanced configurations capabilities, allowing to provide
|
||||
* various categories for configuration variables.
|
||||
*/
|
||||
public class Configuration {
|
||||
|
||||
private boolean configBlocks[] = null;
|
||||
|
||||
public static final int GENERAL_PROPERTY = 0;
|
||||
public static final int BLOCK_PROPERTY = 1;
|
||||
public static final int ITEM_PROPERTY = 2;
|
||||
|
||||
File file;
|
||||
|
||||
public TreeMap<String, Property> blockProperties = new TreeMap<String, Property>();
|
||||
public TreeMap<String, Property> itemProperties = new TreeMap<String, Property>();
|
||||
public TreeMap<String, Property> generalProperties = new TreeMap<String, Property>();
|
||||
|
||||
/**
|
||||
* Create a configuration file for the file given in parameter.
|
||||
*/
|
||||
public Configuration(File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets or create a block id property. If the block id property key is
|
||||
* already in the configuration, then it will be used. Otherwise,
|
||||
* defaultId will be used, except if already taken, in which case this
|
||||
* will try to determine a free default id.
|
||||
*/
|
||||
public Property getOrCreateBlockIdProperty(String key, int defaultId) {
|
||||
if (configBlocks == null) {
|
||||
configBlocks = new boolean[Block.blocksList.length];
|
||||
|
||||
for (int i = 0; i < configBlocks.length; ++i) {
|
||||
configBlocks[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (blockProperties.containsKey(key)) {
|
||||
Property property = getOrCreateIntProperty(key,
|
||||
Configuration.BLOCK_PROPERTY, defaultId);
|
||||
configBlocks[Integer.parseInt(property.value)] = true;
|
||||
return property;
|
||||
} else {
|
||||
Property property = new Property();
|
||||
|
||||
blockProperties.put(key, property);
|
||||
property.name = key;
|
||||
|
||||
if (Block.blocksList[defaultId] == null
|
||||
&& !configBlocks[defaultId]) {
|
||||
property.value = Integer.toString(defaultId);
|
||||
configBlocks[defaultId] = true;
|
||||
return property;
|
||||
} else {
|
||||
for (int j = Block.blocksList.length - 1; j >= 0; --j) {
|
||||
if (Block.blocksList[j] == null && !configBlocks[j]) {
|
||||
property.value = Integer.toString(j);
|
||||
configBlocks[j] = true;
|
||||
return property;
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException("No more block ids available for "
|
||||
+ key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Property getOrCreateIntProperty(String key, int kind,
|
||||
int defaultValue) {
|
||||
Property prop = getOrCreateProperty(key, kind,
|
||||
Integer.toString(defaultValue));
|
||||
|
||||
try {
|
||||
Integer.parseInt(prop.value);
|
||||
|
||||
return prop;
|
||||
} catch (NumberFormatException e) {
|
||||
prop.value = Integer.toString(defaultValue);
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
|
||||
public Property getOrCreateBooleanProperty(String key, int kind,
|
||||
boolean defaultValue) {
|
||||
Property prop = getOrCreateProperty(key, kind,
|
||||
Boolean.toString(defaultValue));
|
||||
|
||||
if ("true".equals(prop.value.toLowerCase())
|
||||
|| "false".equals(prop.value.toLowerCase())) {
|
||||
return prop;
|
||||
} else {
|
||||
prop.value = Boolean.toString(defaultValue);
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
|
||||
public Property getOrCreateProperty(String key, int kind,
|
||||
String defaultValue) {
|
||||
TreeMap<String, Property> source = null;
|
||||
|
||||
switch (kind) {
|
||||
case GENERAL_PROPERTY:
|
||||
source = generalProperties;
|
||||
break;
|
||||
case BLOCK_PROPERTY:
|
||||
source = blockProperties;
|
||||
break;
|
||||
case ITEM_PROPERTY:
|
||||
source = itemProperties;
|
||||
break;
|
||||
}
|
||||
|
||||
if (source.containsKey(key)) {
|
||||
return source.get(key);
|
||||
} else if (defaultValue != null) {
|
||||
Property property = new Property();
|
||||
|
||||
source.put(key, property);
|
||||
property.name = key;
|
||||
|
||||
property.value = defaultValue;
|
||||
return property;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void load() {
|
||||
try {
|
||||
if (file.getParentFile() != null) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
if (!file.exists() && !file.createNewFile()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.canRead()) {
|
||||
FileInputStream fileinputstream = new FileInputStream(file);
|
||||
|
||||
BufferedReader buffer = new BufferedReader(
|
||||
new InputStreamReader(fileinputstream, "8859_1"));
|
||||
|
||||
String line;
|
||||
TreeMap<String, Property> currentMap = null;
|
||||
|
||||
while (true) {
|
||||
line = buffer.readLine();
|
||||
|
||||
if (line == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
int nameStart = -1, nameEnd = -1;
|
||||
boolean skip = false;
|
||||
|
||||
for (int i = 0; i < line.length() && !skip; ++i) {
|
||||
if (Character.isLetterOrDigit(line.charAt(i))
|
||||
|| line.charAt(i) == '.') {
|
||||
if (nameStart == -1) {
|
||||
nameStart = i;
|
||||
}
|
||||
|
||||
nameEnd = i;
|
||||
} else if (Character.isWhitespace(line.charAt(i))) {
|
||||
// ignore space charaters
|
||||
} else {
|
||||
switch (line.charAt(i)) {
|
||||
case '#':
|
||||
skip = true;
|
||||
continue;
|
||||
case '{':
|
||||
String scopeName = line.substring(nameStart,
|
||||
nameEnd + 1);
|
||||
|
||||
if (scopeName.equals("general")) {
|
||||
currentMap = generalProperties;
|
||||
} else if (scopeName.equals("block")) {
|
||||
currentMap = blockProperties;
|
||||
} else if (scopeName.equals("item")) {
|
||||
currentMap = itemProperties;
|
||||
} else {
|
||||
throw new RuntimeException(
|
||||
"unknown section " + scopeName);
|
||||
}
|
||||
|
||||
break;
|
||||
case '}':
|
||||
currentMap = null;
|
||||
break;
|
||||
case '=':
|
||||
String propertyName = line.substring(nameStart,
|
||||
nameEnd + 1);
|
||||
|
||||
if (currentMap == null) {
|
||||
throw new RuntimeException("property "
|
||||
+ propertyName + " has no scope");
|
||||
}
|
||||
|
||||
Property prop = new Property();
|
||||
prop.name = propertyName;
|
||||
prop.value = line.substring(i + 1);
|
||||
i = line.length();
|
||||
|
||||
currentMap.put(propertyName, prop);
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("unknown character "
|
||||
+ line.charAt(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void save() {
|
||||
try {
|
||||
if (file.getParentFile() != null) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
|
||||
if (!file.exists() && !file.createNewFile()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.canWrite()) {
|
||||
FileOutputStream fileoutputstream = new FileOutputStream(file);
|
||||
|
||||
BufferedWriter buffer = new BufferedWriter(
|
||||
new OutputStreamWriter(fileoutputstream, "8859_1"));
|
||||
|
||||
buffer.write("# Configuration file\r\n");
|
||||
buffer.write("# Generated on "
|
||||
+ DateFormat.getInstance().format(new Date()) + "\r\n");
|
||||
buffer.write("\r\n");
|
||||
buffer.write("###########\r\n");
|
||||
buffer.write("# General #\r\n");
|
||||
buffer.write("###########\r\n\r\n");
|
||||
|
||||
buffer.write("general {\r\n");
|
||||
writeProperties(buffer, generalProperties.values());
|
||||
buffer.write("}\r\n\r\n");
|
||||
|
||||
buffer.write("#########\r\n");
|
||||
buffer.write("# Block #\r\n");
|
||||
buffer.write("#########\r\n\r\n");
|
||||
|
||||
buffer.write("block {\r\n");
|
||||
writeProperties(buffer, blockProperties.values());
|
||||
buffer.write("}\r\n\r\n");
|
||||
|
||||
buffer.write("########\r\n");
|
||||
buffer.write("# Item #\r\n");
|
||||
buffer.write("########\r\n\r\n");
|
||||
|
||||
buffer.write("item {\r\n");
|
||||
writeProperties(buffer, itemProperties.values());
|
||||
buffer.write("}\r\n\r\n");
|
||||
|
||||
buffer.close();
|
||||
fileoutputstream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeProperties(BufferedWriter buffer,
|
||||
Collection<Property> props) throws IOException {
|
||||
for (Property property : props) {
|
||||
if (property.comment != null) {
|
||||
buffer.write(" # " + property.comment + "\r\n");
|
||||
}
|
||||
|
||||
buffer.write(" " + property.name + "=" + property.value);
|
||||
buffer.write("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
/**
|
||||
* This interface provides access to a number of secondary block properties through providing
|
||||
* overrides to methods within world.class.
|
||||
*/
|
||||
|
||||
public interface IBlockSecondaryProperties
|
||||
{
|
||||
/**
|
||||
* Return true if this block should be treated as a normal cube by game logic
|
||||
* (this is independant of rendering), false otherwise. This allows for things like secondary
|
||||
* blocks (torches, rails, redstone dust, etc.) being attached to the surface of
|
||||
* the block regardless of whether it is opaque, or posesses other rendering properties that
|
||||
* would not normally make this possible.
|
||||
*/
|
||||
public boolean isBlockNormalCube( World world, int i, int j, int k );
|
||||
|
||||
/**
|
||||
* Return true if this block can be replaced by another by the player, false otherwise. This provides
|
||||
* a means of allowing blocks to not be considered when the player attempts to place another within
|
||||
* their bounds, in the same way that water, lava, fire, and some other blocks behave within the game.
|
||||
* Provides an override to the coresponding section in canBlockBePlacedAt() in world.class
|
||||
*/
|
||||
public boolean isBlockReplaceable( World world, int i, int j, int k );
|
||||
|
||||
/**
|
||||
* Return true if this block should set fire and deal fire damage to entities coming into contact with
|
||||
* it, false otherwise. Provides an override to the related test within isBoundingBoxBurning() within
|
||||
* world.class
|
||||
*/
|
||||
public boolean isBlockBurning( World world, int i, int j, int k );
|
||||
|
||||
/**
|
||||
* Return true if this block should be treated as an air block by the rest of the code, false
|
||||
* otherwise. This method is primarily useful for creating pure logic-blocks that will be invisible
|
||||
* to the player and otherwise interact as air would.
|
||||
* Provides an override to isAirBlock() within world.class
|
||||
*/
|
||||
public boolean isAirBlock( World world, int i, int j, int k );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
public interface IBucketHandler {
|
||||
|
||||
/**
|
||||
* This is called before Minecraft tries to fill a bucket with water or
|
||||
* lava. If it returns a non-null result, then the filling process will
|
||||
* be stopped and the empty bucket will be changed to the result of this
|
||||
* subprogram.
|
||||
*
|
||||
* @see MinecraftForge#registerCustomBucketHander(IBucketHandler)
|
||||
*/
|
||||
public ItemStack fillCustomBucket(World w, int i, int j, int k);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.IBlockAccess;
|
||||
|
||||
/**
|
||||
* This interface is to be implemented by Block classes. It will override
|
||||
* standard algorithms controlling connection between two blocks by redstone
|
||||
*
|
||||
* @see Block
|
||||
*/
|
||||
public interface IConnectRedstone {
|
||||
|
||||
/**
|
||||
* When this returns false, the block at location i, j, k cannot make
|
||||
* a redstone connection in the direction given in parameter, otherwise
|
||||
* it can. Use to control which sides are inputs and outputs for redstone
|
||||
* wires.
|
||||
*/
|
||||
public boolean canConnectRedstone(IBlockAccess iba, int i, int j, int k,
|
||||
int dir);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.ItemTool;
|
||||
|
||||
public interface IHarvestHandler {
|
||||
|
||||
/**
|
||||
* Return true if the tool in parameter is known to be able to harvest
|
||||
* the given block, false if this handler does not know of any particular
|
||||
* harvesting. Other rules may activate the harvesting outside of this
|
||||
* handler. This is typically used to add e.g. blocks only extracted by
|
||||
* diamond pickaxe
|
||||
*
|
||||
* @see MinecraftForge#registerHarvestHandler(IHarvestHandler)
|
||||
*/
|
||||
public boolean canHarvestBlock(ItemTool item, Block block);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
/** This interface is to be implemented by a Block class. Allows a block
|
||||
* type to perform rendering in both render passes, in case some parts of the
|
||||
* block are solid and others are transparent.
|
||||
*/
|
||||
public interface IMultipassRender {
|
||||
/** Returns true when the block has things to render in this render
|
||||
* pass.
|
||||
*/
|
||||
public boolean canRenderInPass(int n);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
/**
|
||||
* This interface is to be implemented by block classes. It will allow a block
|
||||
* to control how it can be replaced
|
||||
*
|
||||
* @see Block
|
||||
*/
|
||||
public interface IOverrideReplace {
|
||||
|
||||
/**
|
||||
* Return true if this block has to take control over replacement, for
|
||||
* the intended replacement given by the parameter bid. If false, then
|
||||
* the block replacement will be prevented.
|
||||
*/
|
||||
public boolean canReplaceBlock(World world, int i, int j, int k, int bid);
|
||||
|
||||
/**
|
||||
* Return the status of the actual replacement.
|
||||
*/
|
||||
public boolean getReplacedSuccess();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.ItemArmor;
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
/**
|
||||
* This interface will adjust the amount of damage received by the entity.
|
||||
*/
|
||||
public int adjustArmorDamage (int damage);
|
||||
|
||||
/**
|
||||
* When this return true, the regular armor computation will be cancelled
|
||||
*/
|
||||
public boolean allowRegularComputation ();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Entity;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
/**
|
||||
* This interface is to be implemented by block classes. It will allow a block
|
||||
* to control how it resists to explosion
|
||||
*
|
||||
* @see Block
|
||||
*/
|
||||
public interface ISpecialResistance {
|
||||
|
||||
/**
|
||||
* Return the explosion resistance of the block located at position i, j,
|
||||
* k, from an exploder explosing on src_x, src_y, src_z.
|
||||
*/
|
||||
public float getSpecialExplosionResistance(World world, int i, int j, int k,
|
||||
double src_x, double src_y, double src_z, Entity exploder);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
/**
|
||||
* This interface has to be implemented either by an instance of Block or Item.
|
||||
* It allow to use texture files different from terrain.png or items.png.
|
||||
*/
|
||||
public interface ITextureProvider {
|
||||
|
||||
/**
|
||||
* This interface has to return the path to a file that is the same size as
|
||||
* terrain.png, but not named terrain.png. It will be used instead of the
|
||||
* regular terrain file to render blocks and items.
|
||||
*/
|
||||
public String getTextureFile();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
/**
|
||||
* This interface is to be implemented by item classes. It will allow an item
|
||||
* to perform a use before the block is activated.
|
||||
*
|
||||
* @see Item
|
||||
*/
|
||||
public interface IUseItemFirst {
|
||||
|
||||
/**
|
||||
* This is called when the item is used, before the block is activated.
|
||||
* Stop the computation when return true.
|
||||
*/
|
||||
public boolean onItemUseFirst(ItemStack ist,
|
||||
EntityPlayer player, World world,
|
||||
int i, int j, int k, int l);
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.ItemTool;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
public class MinecraftForge {
|
||||
|
||||
private static LinkedList<IBucketHandler> bucketHandlers = new LinkedList<IBucketHandler>();
|
||||
private static LinkedList<IHarvestHandler> harvestHandlers = new LinkedList<IHarvestHandler>();
|
||||
|
||||
/**
|
||||
* Registers a new custom bucket handler.
|
||||
*/
|
||||
public static void registerCustomBucketHander(IBucketHandler handler) {
|
||||
bucketHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new harvest handler.
|
||||
*/
|
||||
public static void registerHarvestHandler(IHarvestHandler handler) {
|
||||
harvestHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is not supposed to be called outside of Minecraft internals.
|
||||
*/
|
||||
public static ItemStack fillCustomBucket(World w, int i, int j, int k) {
|
||||
for (IBucketHandler handler : bucketHandlers) {
|
||||
ItemStack stack = handler.fillCustomBucket(w, i, j, k);
|
||||
|
||||
if (stack != null) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is not supposed to be called outside of Minecraft internals.
|
||||
*/
|
||||
public static boolean canHarvestBlock(ItemTool item, Block block) {
|
||||
for (IHarvestHandler handler : harvestHandlers) {
|
||||
if (handler.canHarvestBlock(item, block)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a block to the list of blocks to which the pickaxe is know to be
|
||||
* effective.
|
||||
*/
|
||||
public static void addPickaxeBlockEffectiveAgainst (Block block) {
|
||||
((ItemTool) Item.pickaxeWood).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeStone).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeSteel).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeGold).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeDiamond).addBlockEffectiveAgainst(block);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
public class Property {
|
||||
public String name;
|
||||
public String value;
|
||||
public String comment;
|
||||
}
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="forge_common"/>
|
||||
<classpathentry kind="src" path="minecraft_server"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/jinput.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl_util.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/minecraft_server.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>forge_server</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>forge_common</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/forge_common</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>minecraft_server</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-WORKSPACE_LOC/src_work/minecraft_server</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
*** HOW TO INSTALL ***
|
||||
|
||||
The forge directory should have been uncompacted right under your MCP root
|
||||
directory.
|
||||
|
||||
You should a a fresh minecraft and minecraft_server.jar freshly decompiled
|
||||
with ModLoader and ModLoaderMP.
|
||||
|
||||
Just run the script install.bat. It will copy the Minecraft Forge source on your
|
||||
src directory, and modify the Minecraft source files.
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
set HOME=%CD%
|
||||
set MCP=%HOME%\..
|
||||
xcopy /Y /E src\* ..\src
|
||||
|
||||
cd %MCP%\src
|
||||
%MCP%\runtime\bin\python\python_mcp %HOME%\lfcr.py %HOME%\minecraft.patch %HOME%\minecraft-win.patch
|
||||
%MCP%\runtime\bin\applydiff.exe -uf -p2 < %HOME%\minecraft-win.patch
|
||||
pause
|
||||
@@ -0,0 +1,8 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
import sys, re, os
|
||||
data = open(sys.argv[1], "rb").read()
|
||||
newdata = re.sub("\r?\n", "\r\n", data)
|
||||
f = open(sys.argv[2], "wb")
|
||||
f.write(newdata)
|
||||
f.close()
|
||||
Regular → Executable
+65
-70
@@ -1,70 +1,65 @@
|
||||
Minecraft Forge Public Licence
|
||||
==============================
|
||||
|
||||
Version 1.0
|
||||
|
||||
0. Definitions
|
||||
--------------
|
||||
|
||||
Minecraft: Denotes a copy of the Minecraft game licensed by Mojang AB
|
||||
|
||||
User: Anybody that interract with the software in one of the following ways:
|
||||
- play
|
||||
- decompile
|
||||
- recompile or compile
|
||||
- modify
|
||||
|
||||
Minecraft Forge: The Minecraft Forge code, in source form, class file form, as
|
||||
obtained in a standalone fashion or as part of a wider distribution.
|
||||
|
||||
Dependency: Code required to have Minecraft Forge working properly. That can
|
||||
include dependencies required to compile the code as well as modifications in
|
||||
the Minecraft sources that are required to have Minecraft Forge working.
|
||||
|
||||
1. Scope
|
||||
--------
|
||||
|
||||
The present license is granted to any user of Minecraft Forge, for all files included
|
||||
unless stated otherwise in the file itself. As a prerequisite, a user of Minecraft
|
||||
Forge must own a legally aquired copy of Minecraft.
|
||||
|
||||
2. Play rights
|
||||
--------------
|
||||
|
||||
The user of Minecraft Forge is allowed to install the software on a client or
|
||||
a server and to play it without restriction.
|
||||
|
||||
3. Modification rights
|
||||
----------------------
|
||||
|
||||
The user has the right to decompile the source code, look at either the
|
||||
decompiled version or the original source code, and to modify it.
|
||||
|
||||
4. Derivation rights
|
||||
--------------------
|
||||
|
||||
The user has the rights to derive code from Minecraft Forge, that is to say to
|
||||
write code that either extends Minecraft Forge class and interfaces,
|
||||
instantiate the objects declared or calls the functions. This code is known as
|
||||
"derived" code, and can be licensed with conditions different from Minecraft
|
||||
Forge.
|
||||
|
||||
|
||||
5. Distribution rights
|
||||
----------------------
|
||||
|
||||
The user of Minecraft Forge is allowed to redistribute Minecraft Forge in
|
||||
partially, in totallity, or included in a distribution. When distributing
|
||||
binaries or class files, the user must provide means to obtain the sources of
|
||||
the distributed version of Minecraft Forge at no costs. This includes the
|
||||
files as well as any dependency that the code may rely on, including patches to
|
||||
minecraft original sources.
|
||||
|
||||
Modification of Minecraft Forge as well as dependencies, including patches to
|
||||
minecraft original sources, has to remain under the terms of the present
|
||||
license.
|
||||
|
||||
The right to distribute Minecraft Forge does not extend to the right to distribute
|
||||
MCP data files included within Minecraft Forge. These are the property of the MCP
|
||||
project and should be removed from any customized distribution of Minecraft Forge
|
||||
or permission sought separately from the MCP team.
|
||||
Minecraft Forge Public Licence
|
||||
==============================
|
||||
|
||||
Version 1.0
|
||||
|
||||
0. Definitions
|
||||
--------------
|
||||
|
||||
Minecraft: Denotes a copy of the Minecraft game licensed by Mojang AB
|
||||
|
||||
User: Anybody that interract with the software in one of the following ways:
|
||||
- play
|
||||
- decompile
|
||||
- recompile or compile
|
||||
- modify
|
||||
|
||||
Minecraft Forge: The Minecraft Forge code, in source form, class file form, as
|
||||
obtained in a standalone fashion or as part of a wider distribution.
|
||||
|
||||
Dependency: Code required to have Minecraft Forge working properly. That can
|
||||
include dependencies required to compile the code as well as modifications in
|
||||
the Minecraft sources that are required to have Minecraft Forge working.
|
||||
|
||||
1. Scope
|
||||
--------
|
||||
|
||||
The present license is granted to any user of Minecraft Forge. As a
|
||||
prerequisite, a user of Minecraft Forge must own a legally aquired copy of
|
||||
Minecraft
|
||||
|
||||
2. Play rights
|
||||
--------------
|
||||
|
||||
The user of Minecraft Forge is allowed to install the software on a client or
|
||||
a server and to play it without restriction.
|
||||
|
||||
3. Modification rights
|
||||
----------------------
|
||||
|
||||
The user has the right to decompile the source code, look at either the
|
||||
decompiled version or the original source code, and to modify it.
|
||||
|
||||
4. Derivation rights
|
||||
--------------------
|
||||
|
||||
The user has the rights to derive code from Minecraft Forge, that is to say to
|
||||
write code that either extends Minecraft Forge class and interfaces,
|
||||
instantiate the objects declared or calls the functions. This code is known as
|
||||
"derived" code, and can be licensed with conditions different from Minecraft
|
||||
Forge.
|
||||
|
||||
|
||||
5. Distribution rights
|
||||
----------------------
|
||||
|
||||
The user of Minecraft Forge is allowed to redistribute Minecraft Forge in
|
||||
partially, in totallity, or included in a distribution. When distributing
|
||||
binaries or class files, the user must provide means to obtain the sources of
|
||||
the distributed version of Minecraft Forge at no costs. This includes the
|
||||
files as well as any dependency that the code may rely on, including patches to
|
||||
minecraft original sources.
|
||||
|
||||
Modification of Minecraft Forge as well as dependencies, including patches to
|
||||
minecraft original sources, has to remain under the terms of the present
|
||||
license.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,70 @@
|
||||
diff -ru src/minecraft/net/minecraft/src/MLProp.java src_fix/minecraft/net/minecraft/src/MLProp.java
|
||||
--- src/minecraft/net/minecraft/src/MLProp.java 2011-08-04 20:10:17.000000000 -0400
|
||||
+++ src_fix/minecraft/net/minecraft/src/MLProp.java 2011-08-04 20:12:55.000000000 -0400
|
||||
@@ -1,20 +1,11 @@
|
||||
-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
|
||||
-// Jad home page: http://www.kpdus.com/jad.html
|
||||
-// Decompiler options: packimports(3) braces deadcode
|
||||
-
|
||||
-package net.minecraft.src;
|
||||
-
|
||||
-import java.lang.annotation.Annotation;
|
||||
-
|
||||
-public interface MLProp
|
||||
- extends Annotation
|
||||
-{
|
||||
-
|
||||
- public abstract String name();
|
||||
-
|
||||
- public abstract String info();
|
||||
-
|
||||
- public abstract double min();
|
||||
-
|
||||
- public abstract double max();
|
||||
-}
|
||||
+package net.minecraft.src;
|
||||
+import java.lang.annotation.*;
|
||||
+
|
||||
+@Retention(RetentionPolicy.RUNTIME)
|
||||
+@Target(ElementType.FIELD)
|
||||
+public @interface MLProp {
|
||||
+ String name() default "";
|
||||
+ String info() default "";
|
||||
+ double min() default Double.NEGATIVE_INFINITY;
|
||||
+ double max() default Double.POSITIVE_INFINITY;
|
||||
+}
|
||||
diff -ru src/minecraft_server/net/minecraft/src/MLProp.java src_fix/minecraft_server/net/minecraft/src/MLProp.java
|
||||
--- src/minecraft_server/net/minecraft/src/MLProp.java 2011-08-04 20:10:17.000000000 -0400
|
||||
+++ src_fix/minecraft_server/net/minecraft/src/MLProp.java 2011-08-04 20:13:00.000000000 -0400
|
||||
@@ -1,20 +1,11 @@
|
||||
-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
|
||||
-// Jad home page: http://www.kpdus.com/jad.html
|
||||
-// Decompiler options: packimports(3) braces deadcode
|
||||
-
|
||||
-package net.minecraft.src;
|
||||
-
|
||||
-import java.lang.annotation.Annotation;
|
||||
-
|
||||
-public interface MLProp
|
||||
- extends Annotation
|
||||
-{
|
||||
-
|
||||
- public abstract String name();
|
||||
-
|
||||
- public abstract String info();
|
||||
-
|
||||
- public abstract double min();
|
||||
-
|
||||
- public abstract double max();
|
||||
-}
|
||||
+package net.minecraft.src;
|
||||
+import java.lang.annotation.*;
|
||||
+
|
||||
+@Retention(RetentionPolicy.RUNTIME)
|
||||
+@Target(ElementType.FIELD)
|
||||
+public @interface MLProp {
|
||||
+ String name() default "";
|
||||
+ String info() default "";
|
||||
+ double min() default Double.NEGATIVE_INFINITY;
|
||||
+ double max() default Double.POSITIVE_INFINITY;
|
||||
+}
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java 2011-07-17 00:28:07.755771900 +0200
|
||||
+++ ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java 2011-07-17 00:28:09.485870900 +0200
|
||||
@@ -333,41 +333,22 @@
|
||||
}
|
||||
finally
|
||||
{
|
||||
- System.exit(0);
|
||||
+ try
|
||||
+ {
|
||||
+ stopServer();
|
||||
+ serverStopped = true;
|
||||
+ }
|
||||
+ catch(Throwable throwable2)
|
||||
+ {
|
||||
+ throwable2.printStackTrace();
|
||||
+ }
|
||||
+ finally
|
||||
+ {
|
||||
+ System.exit(0);
|
||||
+ }
|
||||
}
|
||||
- break MISSING_BLOCK_LABEL_350;
|
||||
- }
|
||||
- try
|
||||
- {
|
||||
- stopServer();
|
||||
- serverStopped = true;
|
||||
- }
|
||||
- catch(Throwable throwable)
|
||||
- {
|
||||
- throwable.printStackTrace();
|
||||
- }
|
||||
- finally
|
||||
- {
|
||||
- System.exit(0);
|
||||
- }
|
||||
- break MISSING_BLOCK_LABEL_350;
|
||||
- Exception exception2;
|
||||
- exception2;
|
||||
- try
|
||||
- {
|
||||
- stopServer();
|
||||
- serverStopped = true;
|
||||
- }
|
||||
- catch(Throwable throwable3)
|
||||
- {
|
||||
- throwable3.printStackTrace();
|
||||
- }
|
||||
- finally
|
||||
- {
|
||||
- System.exit(0);
|
||||
- }
|
||||
- throw exception2;
|
||||
}
|
||||
+}
|
||||
|
||||
private void doTick()
|
||||
{
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
version=$1
|
||||
build_dir=`pwd`
|
||||
dir=`pwd`/../forge-$version
|
||||
|
||||
function remove_svn () {
|
||||
(
|
||||
cd $1
|
||||
|
||||
if [ -d .svn ]; then
|
||||
rm -rf .svn
|
||||
fi
|
||||
|
||||
for j in `ls`
|
||||
do
|
||||
if [ -d $j ]; then
|
||||
remove_svn $j
|
||||
fi
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
function package_all () {
|
||||
qual=$1
|
||||
|
||||
zip -r $dir/minecraftforge$qual-$version.zip \
|
||||
*.class \
|
||||
forge
|
||||
}
|
||||
|
||||
cd ../reobf
|
||||
|
||||
remove_svn .
|
||||
|
||||
rm -rf $dir
|
||||
mkdir $dir
|
||||
|
||||
cd minecraft
|
||||
package_all "-client"
|
||||
|
||||
cd ../minecraft_server
|
||||
package_all "-server"
|
||||
|
||||
cd ../..
|
||||
|
||||
rm -rf reobf
|
||||
|
||||
cd $build_dir
|
||||
|
||||
mkdir forge
|
||||
cd forge
|
||||
mkdir src
|
||||
mkdir src/minecraft
|
||||
mkdir src/minecraft_server
|
||||
cp -r ../forge_client/src/* src/minecraft
|
||||
cp -r ../forge_server/src/* src/minecraft_server
|
||||
cp -r ../forge_common/* src/minecraft
|
||||
cp -r ../forge_common/* src/minecraft_server
|
||||
cp ../minecraft.patch .
|
||||
cp ../lfcr.py .
|
||||
cp ../install/install.cmd .
|
||||
cp ../install/README.txt .
|
||||
cp -r ../doc .
|
||||
|
||||
cd src
|
||||
remove_svn .
|
||||
cd ..
|
||||
|
||||
cd ..
|
||||
|
||||
zip -r $dir/minecraftforge-src-$version.zip forge
|
||||
rm -rf forge
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
cmd /C build.bat
|
||||
|
||||
cd ..
|
||||
|
||||
cmd /C reobfuscate.bat
|
||||
|
||||
set PATH=E:\cygwin\bin;%PATH%
|
||||
|
||||
cd forge
|
||||
|
||||
sh package.sh 1.0.3
|
||||
|
||||
pause
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
cd ..
|
||||
|
||||
rmdir /S /Q src
|
||||
|
||||
IF EXIST src_base (
|
||||
move src_base src
|
||||
rmdir /S /Q src_work
|
||||
) ELSE (
|
||||
cmd /C decompile.bat
|
||||
cd src
|
||||
..\runtime\bin\python\python_mcp ..\forge\lfcr.py ..\forge\modLoaderMP.patch ..\forge\modLoaderMP-win.patch
|
||||
..\runtime\bin\applydiff.exe -uf -p2 < ..\forge\modLoaderMP-win.patch
|
||||
cd ..
|
||||
cmd /C recompile.bat
|
||||
cmd /C updatemd5.bat
|
||||
)
|
||||
|
||||
mkdir src_base
|
||||
mkdir src_work
|
||||
xcopy /Y /E src\* src_base
|
||||
xcopy /Y /E src\* src_work
|
||||
cd src_work
|
||||
..\runtime\bin\python\python_mcp ..\forge\lfcr.py ..\forge\minecraft.patch ..\forge\minecraft-win.patch
|
||||
..\runtime\bin\applydiff.exe -uf -p2 < ..\forge\minecraft-win.patch
|
||||
pause
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "MinecraftForge Linux Setup Program"
|
||||
echo
|
||||
|
||||
pushd .. > /dev/null
|
||||
|
||||
if [ -d src ] ; then
|
||||
echo "!!! WARNING !!!"
|
||||
echo
|
||||
echo "This setup will erase your src directory. Make sure to back up"
|
||||
echo "any changes before continuing."
|
||||
echo
|
||||
|
||||
read -p "Continue (y/n)? " var
|
||||
|
||||
if [ "$var" != "y" ]; then exit ; fi
|
||||
fi
|
||||
|
||||
rm -rf src src_work src_forge
|
||||
|
||||
if [ ! -d src_base ] ; then
|
||||
./decompile.sh
|
||||
pushd src > /dev/null
|
||||
|
||||
find -name *.java -exec sed -i 's/\r//g' \{\} \;
|
||||
patch -p2 -i ../forge/modLoaderMP.patch
|
||||
patch -p1 -i ../forge/mlprop.patch
|
||||
|
||||
popd > /dev/null
|
||||
|
||||
mv src src_base
|
||||
fi
|
||||
|
||||
cp -a src_base src_work
|
||||
pushd src_work > /dev/null
|
||||
patch -p2 -i ../forge/minecraft.patch
|
||||
popd > /dev/null
|
||||
|
||||
cp -a src_work src_forge
|
||||
|
||||
cp -a forge/forge_client/src/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft_server/net/
|
||||
|
||||
cp -a src_forge src
|
||||
|
||||
./updatemd5.sh
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
rm minecraft.patch
|
||||
touch minecraft.patch
|
||||
|
||||
diff -u ../src_base ../src_work -r --strip-trailing-cr | tr -d '\r' \
|
||||
>> minecraft.patch
|
||||
@@ -1,164 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/fml/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"
|
||||
which java >/dev/null 2>&1 || 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
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
Vendored
-90
@@ -1,90 +0,0 @@
|
||||
@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
|
||||
|
||||
@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=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
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 init
|
||||
|
||||
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
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\fml\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 %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="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!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,9 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockAir.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockAir.java
|
||||
@@ -36,4 +36,6 @@
|
||||
}
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) {}
|
||||
+
|
||||
+ public boolean func_176200_f(World worldIn, BlockPos pos){ return true; }
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
||||
@@ -12,7 +12,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockBush extends Block
|
||||
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000208";
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_149854_a(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c());
|
||||
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c().canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
||||
}
|
||||
|
||||
protected boolean func_149854_a(Block p_149854_1_)
|
||||
@@ -85,4 +85,33 @@
|
||||
{
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
|
||||
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
|
||||
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
|
||||
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
|
||||
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() != this) return func_176223_P();
|
||||
+ return state;
|
||||
+ }
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
|
||||
@@ -18,6 +18,7 @@
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import static net.minecraft.util.EnumFacing.*;
|
||||
|
||||
public abstract class BlockButton extends Block
|
||||
{
|
||||
@@ -57,7 +58,7 @@
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
{
|
||||
- return p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
|
||||
+ return p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -69,7 +70,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = aenumfacing[j];
|
||||
|
||||
- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r())
|
||||
+ if (p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -80,7 +81,7 @@
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
{
|
||||
- return p_180642_1_.func_180495_p(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())).func_177230_c().func_149721_r() ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
|
||||
+ return p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_, true) ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
|
||||
}
|
||||
|
||||
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
|
||||
@@ -89,7 +90,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176585_a);
|
||||
|
||||
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
|
||||
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
|
||||
{
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
@@ -338,6 +339,8 @@
|
||||
return new BlockState(this, new IProperty[] {field_176585_a, field_176584_b});
|
||||
}
|
||||
|
||||
+ @Override public net.minecraft.item.Item func_180660_a(IBlockState state, Random rnd, int fortune){ return null; }
|
||||
+
|
||||
static final class SwitchEnumFacing
|
||||
{
|
||||
static final int[] field_180420_a = new int[EnumFacing.values().length];
|
||||
@@ -1,37 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
|
||||
@@ -19,7 +19,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockCactus extends Block
|
||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
|
||||
private static final String __OBFID = "CL_00000210";
|
||||
@@ -115,7 +115,7 @@
|
||||
}
|
||||
|
||||
Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
|
||||
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
|
||||
+ return block.canSustainPlant(p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this);
|
||||
}
|
||||
|
||||
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
|
||||
@@ -143,4 +143,16 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176587_a});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return func_176223_P();
|
||||
+ }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
|
||||
@@ -531,7 +531,7 @@
|
||||
|
||||
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
|
||||
{
|
||||
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_177230_c().func_149721_r();
|
||||
+ return p_176456_1_.isSideSolid(p_176456_2_.func_177984_a(), EnumFacing.DOWN, false);
|
||||
}
|
||||
|
||||
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)
|
||||
@@ -1,29 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
@@ -137,7 +137,14 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- int j = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> dropped = super.getDrops(world, pos, state, fortune);
|
||||
+ int j = ((Integer)state.func_177229_b(field_176501_a)).intValue();
|
||||
byte b0 = 1;
|
||||
|
||||
if (j >= 2)
|
||||
@@ -147,8 +154,9 @@
|
||||
|
||||
for (int k = 0; k < b0; ++k)
|
||||
{
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
|
||||
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
|
||||
}
|
||||
+ return dropped;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -1,68 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
||||
@@ -82,11 +82,11 @@
|
||||
float f1 = 0.0F;
|
||||
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos1.func_177982_a(i, 0, j));
|
||||
|
||||
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
|
||||
+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos1.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
|
||||
{
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
|
||||
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos1.func_177982_a(i, 0, j)))
|
||||
{
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -143,24 +143,6 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
|
||||
-
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- {
|
||||
- int j = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue();
|
||||
-
|
||||
- if (j >= 7)
|
||||
- {
|
||||
- int k = 3 + p_180653_5_;
|
||||
-
|
||||
- for (int l = 0; l < k; ++l)
|
||||
- {
|
||||
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
|
||||
- {
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -203,4 +185,26 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176488_a});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
+ int age = ((Integer)state.func_177229_b(field_176488_a)).intValue();
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+
|
||||
+ if (age >= 7)
|
||||
+ {
|
||||
+ int k = 3 + fortune;
|
||||
+
|
||||
+ for (int i = 0; i < 3 + fortune; ++i)
|
||||
+ {
|
||||
+ if (rand.nextInt(15) <= age)
|
||||
+ {
|
||||
+ ret.add(new ItemStack(this.func_149866_i(), 1, 0));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -13,7 +13,7 @@
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush
|
||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000224";
|
||||
|
||||
@@ -41,14 +41,15 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return new java.util.ArrayList<ItemStack>(java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I)));
|
||||
+ }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
|
||||
@@ -149,7 +149,7 @@
|
||||
{
|
||||
if (this.field_149764_J == Material.field_151573_f)
|
||||
{
|
||||
- return true;
|
||||
+ return false; //Allow items to interact with the door
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_2_.func_177956_o() >= 255 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
|
||||
+ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
|
||||
}
|
||||
|
||||
public int func_149656_h()
|
||||
@@ -1,80 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
@@ -24,7 +24,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockDoublePlant extends BlockBush implements IGrowable
|
||||
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
|
||||
public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
|
||||
@@ -89,6 +89,8 @@
|
||||
Object object = flag ? this : p_176475_1_.func_180495_p(blockpos1).func_177230_c();
|
||||
Object object1 = flag ? p_176475_1_.func_180495_p(blockpos2).func_177230_c() : this;
|
||||
|
||||
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
|
||||
+
|
||||
if (object == this)
|
||||
{
|
||||
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
|
||||
@@ -97,17 +99,13 @@
|
||||
if (object1 == this)
|
||||
{
|
||||
p_176475_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 3);
|
||||
-
|
||||
- if (!flag)
|
||||
- {
|
||||
- this.func_176226_b(p_176475_1_, blockpos2, p_176475_3_, 0);
|
||||
- }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
|
||||
@@ -157,7 +155,6 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
|
||||
{
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
@@ -296,6 +293,32 @@
|
||||
return Block.EnumOffsetType.XZ;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
|
||||
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
|
||||
+ }
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
|
||||
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
|
||||
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
+ {
|
||||
+ //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() == this && state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && world.func_180495_p(pos.func_177984_a()).func_177230_c() == this)
|
||||
+ world.func_175698_g(pos.func_177984_a());
|
||||
+ return world.func_175698_g(pos);
|
||||
+ }
|
||||
+
|
||||
static enum EnumBlockHalf implements IStringSerializable
|
||||
{
|
||||
UPPER,
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_)
|
||||
{
|
||||
+ if (p_180685_0_.func_175623_d(p_180685_1_)) return true;
|
||||
Block block = p_180685_0_.func_180495_p(p_180685_1_).func_177230_c();
|
||||
Material material = block.field_149764_J;
|
||||
return block == Blocks.field_150480_ab || material == Material.field_151579_a || material == Material.field_151586_h || material == Material.field_151587_i;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
@@ -89,7 +89,7 @@
|
||||
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
|
||||
{
|
||||
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
|
||||
- return block instanceof BlockCrops || block instanceof BlockStem;
|
||||
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
|
||||
}
|
||||
|
||||
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)
|
||||
@@ -1,211 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
|
||||
@@ -42,18 +42,24 @@
|
||||
int j = p_176221_3_.func_177956_o();
|
||||
int k = p_176221_3_.func_177952_p();
|
||||
|
||||
- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()))
|
||||
+ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
boolean flag = (i + j + k & 1) == 1;
|
||||
boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1;
|
||||
int l = 0;
|
||||
|
||||
- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))
|
||||
+ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN))
|
||||
{
|
||||
l = flag ? 1 : 2;
|
||||
}
|
||||
|
||||
- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag));
|
||||
+ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)))
|
||||
+ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST )))
|
||||
+ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)))
|
||||
+ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST )))
|
||||
+ .func_177226_a(field_176542_R, Integer.valueOf(l))
|
||||
+ .func_177226_a(field_176540_b, Boolean.valueOf(flag1))
|
||||
+ .func_177226_a(field_176544_M, Boolean.valueOf(flag));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,6 +115,7 @@
|
||||
|
||||
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
|
||||
{
|
||||
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
||||
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
|
||||
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
|
||||
}
|
||||
@@ -148,13 +155,8 @@
|
||||
}
|
||||
|
||||
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
|
||||
- boolean flag = block == Blocks.field_150424_aL;
|
||||
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
|
||||
|
||||
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
|
||||
- {
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_))
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
@@ -183,7 +185,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
|
||||
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
return;
|
||||
@@ -198,12 +200,12 @@
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i, EnumFacing.WEST);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i, EnumFacing.EAST);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i, EnumFacing.UP);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i, EnumFacing.DOWN);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i, EnumFacing.SOUTH);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i, EnumFacing.NORTH);
|
||||
|
||||
for (int j = -1; j <= 1; ++j)
|
||||
{
|
||||
@@ -262,22 +264,30 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated // Use Block.getFlammability
|
||||
public int func_176532_c(Block p_176532_1_)
|
||||
{
|
||||
Integer integer = (Integer)this.field_149848_b.get(p_176532_1_);
|
||||
return integer == null ? 0 : integer.intValue();
|
||||
}
|
||||
|
||||
+ @Deprecated // Use Block.getFlammability
|
||||
public int func_176534_d(Block p_176534_1_)
|
||||
{
|
||||
Integer integer = (Integer)this.field_149849_a.get(p_176534_1_);
|
||||
return integer == null ? 0 : integer.intValue();
|
||||
}
|
||||
|
||||
+ @Deprecated // Use tryCatchFire with face below
|
||||
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
|
||||
{
|
||||
- int k = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
|
||||
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
|
||||
+ }
|
||||
|
||||
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
|
||||
+ {
|
||||
+ int k = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
|
||||
+
|
||||
if (p_176536_4_.nextInt(p_176536_3_) < k)
|
||||
{
|
||||
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
|
||||
@@ -314,7 +324,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = aenumfacing[j];
|
||||
|
||||
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
|
||||
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -338,7 +348,7 @@
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
EnumFacing enumfacing = aenumfacing[k];
|
||||
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
|
||||
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
|
||||
}
|
||||
|
||||
return i;
|
||||
@@ -350,9 +360,10 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated // Use canCatchFire with face sensitive version below
|
||||
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
|
||||
{
|
||||
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
|
||||
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -396,9 +407,9 @@
|
||||
double d1;
|
||||
double d2;
|
||||
|
||||
- if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177977_b()))
|
||||
+ if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177976_e()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177976_e(), EnumFacing.EAST))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -409,7 +420,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177974_f()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177974_f(), EnumFacing.WEST))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -420,7 +431,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177978_c()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177978_c(), EnumFacing.SOUTH))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -431,7 +442,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177968_d()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177968_d(), EnumFacing.NORTH))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -442,7 +453,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177984_a()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177984_a(), EnumFacing.DOWN))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -490,4 +501,19 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R, field_176540_b, field_176544_M});
|
||||
}
|
||||
+
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param pos Block position
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return True if the face can catch fire.
|
||||
+ */
|
||||
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
|
||||
+ {
|
||||
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
|
||||
+ }
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -162,13 +162,6 @@
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
{
|
||||
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
|
||||
-
|
||||
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
|
||||
- {
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
|
||||
- }
|
||||
-
|
||||
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
}
|
||||
|
||||
@@ -388,6 +381,31 @@
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
+
|
||||
+ /*============================FORGE START=====================================*/
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
|
||||
+ if (te != null && te.func_145965_a() != null)
|
||||
+ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
+ {
|
||||
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
|
||||
+ return super.removedByPlayer(world, pos, player, willHarvest);
|
||||
+ }
|
||||
+ @Override
|
||||
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
|
||||
+ {
|
||||
+ super.func_180657_a(world, player, pos, state, te);
|
||||
+ world.func_175698_g(pos);
|
||||
+ }
|
||||
+ /*===========================FORGE END==========================================*/
|
||||
+
|
||||
public static enum EnumFlowerType implements IStringSerializable
|
||||
{
|
||||
EMPTY("empty"),
|
||||
@@ -1,41 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
|
||||
@@ -59,7 +59,7 @@
|
||||
{
|
||||
if (!p_180650_1_.field_72995_K)
|
||||
{
|
||||
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
|
||||
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
|
||||
}
|
||||
@@ -73,7 +73,7 @@
|
||||
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
|
||||
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
|
||||
|
||||
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos1, Blocks.field_150349_c.func_176223_P());
|
||||
}
|
||||
@@ -120,18 +120,11 @@
|
||||
continue;
|
||||
}
|
||||
}
|
||||
- else if (p_176474_1_.func_180495_p(blockpos2).func_177230_c().field_149764_J == Material.field_151579_a)
|
||||
+ else if (p_176474_1_.func_175623_d(blockpos2))
|
||||
{
|
||||
if (p_176474_2_.nextInt(8) == 0)
|
||||
{
|
||||
- BlockFlower.EnumFlowerType enumflowertype = p_176474_1_.func_180494_b(blockpos2).func_180623_a(p_176474_2_, blockpos2);
|
||||
- BlockFlower blockflower = enumflowertype.func_176964_a().func_180346_a();
|
||||
- IBlockState iblockstate1 = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), enumflowertype);
|
||||
-
|
||||
- if (blockflower.func_180671_f(p_176474_1_, blockpos2, iblockstate1))
|
||||
- {
|
||||
- p_176474_1_.func_180501_a(blockpos2, iblockstate1, 3);
|
||||
- }
|
||||
+ p_176474_1_.func_180494_b(blockpos2).plantFlower(p_176474_1_, p_176474_2_, blockpos2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,35 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
||||
@@ -40,14 +40,17 @@
|
||||
p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
p_180657_2_.func_71020_j(0.025F);
|
||||
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_))
|
||||
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_))
|
||||
{
|
||||
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
|
||||
ItemStack itemstack = this.func_180643_i(p_180657_4_);
|
||||
|
||||
- if (itemstack != null)
|
||||
- {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
|
||||
- }
|
||||
+ if (itemstack != null) items.add(itemstack);
|
||||
+
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_);
|
||||
+
|
||||
+ for (ItemStack is : items)
|
||||
+ func_180635_a(p_180657_1_, p_180657_3_, is);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -58,7 +61,9 @@
|
||||
}
|
||||
|
||||
int i = EnchantmentHelper.func_77517_e(p_180657_2_);
|
||||
+ harvesters.set(p_180657_2_);
|
||||
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
|
||||
+ harvesters.set(null);
|
||||
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o();
|
||||
|
||||
if (material.func_76230_c() || material.func_76224_d())
|
||||
@@ -1,32 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
|
||||
@@ -80,7 +80,10 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_177230_c().func_149721_r() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_177230_c().func_149721_r()));
|
||||
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST, true) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST, true) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH, true) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH, true);
|
||||
}
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
@@ -124,7 +127,7 @@
|
||||
|
||||
protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_)
|
||||
{
|
||||
- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_177230_c().func_149721_r();
|
||||
+ return p_176381_1_.isSideSolid(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_, true);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -155,6 +158,8 @@
|
||||
return new BlockState(this, new IProperty[] {field_176382_a});
|
||||
}
|
||||
|
||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
|
||||
+
|
||||
static final class SwitchEnumFacing
|
||||
{
|
||||
static final int[] field_180190_a = new int[EnumFacing.values().length];
|
||||
@@ -1,130 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
@@ -18,7 +18,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public abstract class BlockLeaves extends BlockLeavesBase
|
||||
+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
|
||||
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
|
||||
@@ -76,9 +76,9 @@
|
||||
BlockPos blockpos1 = p_180663_2_.func_177982_a(i1, j1, k1);
|
||||
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
|
||||
|
||||
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(field_176236_b)).booleanValue())
|
||||
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,11 +119,12 @@
|
||||
{
|
||||
for (i2 = -b0; i2 <= b0; ++i2)
|
||||
{
|
||||
- Block block = p_180650_1_.func_180495_p(new BlockPos(j + k1, k + l1, l + i2)).func_177230_c();
|
||||
+ BlockPos tmp = new BlockPos(j + k1, k + l1, l + i2);
|
||||
+ Block block = p_180650_1_.func_180495_p(tmp).func_177230_c();
|
||||
|
||||
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
|
||||
+ if (!block.canSustainLeaves(p_180650_1_, tmp))
|
||||
{
|
||||
- if (block.func_149688_o() == Material.field_151584_j)
|
||||
+ if (block.isLeaves(p_180650_1_, tmp))
|
||||
{
|
||||
this.field_150128_a[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -2;
|
||||
}
|
||||
@@ -230,40 +231,7 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- {
|
||||
- int j = this.func_176232_d(p_180653_3_);
|
||||
-
|
||||
- if (p_180653_5_ > 0)
|
||||
- {
|
||||
- j -= 2 << p_180653_5_;
|
||||
-
|
||||
- if (j < 10)
|
||||
- {
|
||||
- j = 10;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (p_180653_1_.field_73012_v.nextInt(j) == 0)
|
||||
- {
|
||||
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
|
||||
- }
|
||||
-
|
||||
- j = 200;
|
||||
-
|
||||
- if (p_180653_5_ > 0)
|
||||
- {
|
||||
- j -= 10 << p_180653_5_;
|
||||
-
|
||||
- if (j < 40)
|
||||
- {
|
||||
- j = 40;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, j);
|
||||
- }
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
}
|
||||
|
||||
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) {}
|
||||
@@ -298,4 +266,48 @@
|
||||
}
|
||||
|
||||
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
+ @Override
|
||||
+ public void beginLeavesDecay(World world, BlockPos pos)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (!(Boolean)state.func_177229_b(field_176236_b))
|
||||
+ {
|
||||
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ int chance = this.func_176232_d(state);
|
||||
+
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
+ chance -= 2 << fortune;
|
||||
+ if (chance < 10) chance = 10;
|
||||
+ }
|
||||
+
|
||||
+ if (rand.nextInt(chance) == 0)
|
||||
+ ret.add(new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state)));
|
||||
+
|
||||
+ chance = 200;
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
+ chance -= 10 << fortune;
|
||||
+ if (chance < 40) chance = 40;
|
||||
+ }
|
||||
+
|
||||
+ this.captureDrops(true);
|
||||
+ if (world instanceof World)
|
||||
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
|
||||
+ ret.addAll(this.captureDrops(false));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
|
||||
@@ -47,24 +47,24 @@
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
{
|
||||
- return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : this.func_176358_d(p_176198_1_, p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()));
|
||||
+ return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_);
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return this.func_176358_d(p_176196_1_, p_176196_2_.func_177976_e()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177974_f()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177978_c()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177968_d()) ? true : (World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) ? true : this.func_176358_d(p_176196_1_, p_176196_2_.func_177984_a())))));
|
||||
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST ) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST ) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP ) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177984_a(), EnumFacing.DOWN );
|
||||
}
|
||||
|
||||
- protected boolean func_176358_d(World p_176358_1_, BlockPos p_176358_2_)
|
||||
- {
|
||||
- return p_176358_1_.func_180495_p(p_176358_2_).func_177230_c().func_149721_r();
|
||||
- }
|
||||
-
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
{
|
||||
IBlockState iblockstate = this.func_176223_P().func_177226_a(field_176359_b, Boolean.valueOf(false));
|
||||
|
||||
- if (this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())))
|
||||
+ if (p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_))
|
||||
{
|
||||
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(p_180642_3_, p_180642_8_.func_174811_aO()));
|
||||
}
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
enumfacing1 = (EnumFacing)iterator.next();
|
||||
}
|
||||
- while (enumfacing1 == p_180642_3_ || !this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(enumfacing1.func_176734_d())));
|
||||
+ while (enumfacing1 == p_180642_3_ || !p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1));
|
||||
|
||||
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(enumfacing1, p_180642_8_.func_174811_aO()));
|
||||
}
|
||||
@@ -116,7 +116,8 @@
|
||||
|
||||
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
|
||||
{
|
||||
- if (this.func_176356_e(p_176204_1_, p_176204_2_) && !this.func_176358_d(p_176204_1_, p_176204_2_.func_177972_a(((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c().func_176734_d())))
|
||||
+ EnumFacing dir = ((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c();
|
||||
+ if (this.func_176356_e(p_176204_1_, p_176204_2_) && !p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(dir.func_176734_d()), dir))
|
||||
{
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
@@ -235,6 +236,12 @@
|
||||
return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b});
|
||||
}
|
||||
|
||||
+
|
||||
+ private boolean canAttach(World world, BlockPos pos, EnumFacing side)
|
||||
+ {
|
||||
+ return world.isSideSolid(pos, side);
|
||||
+ }
|
||||
+
|
||||
public static enum EnumOrientation implements IStringSerializable
|
||||
{
|
||||
DOWN_X(0, "down_x", EnumFacing.DOWN),
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -38,9 +38,9 @@
|
||||
BlockPos blockpos1 = (BlockPos)iterator.next();
|
||||
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
|
||||
|
||||
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
|
||||
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,9 @@
|
||||
return super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176299_a, BlockLog.EnumAxis.func_176870_a(p_180642_3_.func_176740_k()));
|
||||
}
|
||||
|
||||
+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
public static enum EnumAxis implements IStringSerializable
|
||||
{
|
||||
X("x"),
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -39,10 +39,14 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
- int j = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public boolean func_149662_c()
|
||||
{
|
||||
return false;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
@@ -76,7 +76,7 @@
|
||||
if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256)
|
||||
{
|
||||
IBlockState iblockstate1 = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
|
||||
- return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_149854_a(iblockstate1.func_177230_c()));
|
||||
+ return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate1.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
@@ -39,7 +39,7 @@
|
||||
{
|
||||
if (!p_180650_1_.field_72995_K)
|
||||
{
|
||||
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
|
||||
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
|
||||
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
|
||||
|
||||
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos1, this.func_176223_P());
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
|
||||
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
|
||||
}
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
@@ -52,9 +52,11 @@
|
||||
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("unused")
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ if (false && !p_180653_1_.field_72995_K)
|
||||
{
|
||||
int j = 1;
|
||||
|
||||
@@ -105,4 +107,24 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176486_a});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ int count = 1;
|
||||
+
|
||||
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
|
||||
+ {
|
||||
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < count; i++)
|
||||
+ {
|
||||
+ ret.add(new ItemStack(Items.field_151075_bm));
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
@@ -105,14 +105,15 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176240_P)).func_176839_a() - 4)));
|
||||
+ }
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
||||
@@ -58,7 +58,9 @@
|
||||
if (tileentity instanceof TileEntityNote)
|
||||
{
|
||||
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
|
||||
+ int old = tileentitynote.field_145879_a;
|
||||
tileentitynote.func_145877_a();
|
||||
+ if (old == tileentitynote.field_145879_a) return false;
|
||||
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
|
||||
}
|
||||
|
||||
@@ -96,6 +98,10 @@
|
||||
|
||||
public boolean func_180648_a(World p_180648_1_, BlockPos p_180648_2_, IBlockState p_180648_3_, int p_180648_4_, int p_180648_5_)
|
||||
{
|
||||
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_180648_1_, p_180648_2_, p_180648_3_, p_180648_5_, p_180648_4_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
||||
+ p_180648_4_ = e.instrument.ordinal();
|
||||
+ p_180648_5_ = e.getVanillaNoteId();
|
||||
float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D);
|
||||
p_180648_1_.func_72908_a((double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 0.5D, (double)p_180648_2_.func_177952_p() + 0.5D, "note." + this.func_176433_b(p_180648_4_), 3.0F, f);
|
||||
p_180648_1_.func_175688_a(EnumParticleTypes.NOTE, (double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 1.2D, (double)p_180648_2_.func_177952_p() + 0.5D, (double)p_180648_5_ / 24.0D, 0.0D, 0.0D, new int[0]);
|
||||
@@ -1,14 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
@@ -155,4 +155,11 @@
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176239_P)).func_176839_a())));
|
||||
+ }
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
||||
@@ -10,6 +10,7 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MathHelper;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockOre extends Block
|
||||
@@ -54,34 +55,40 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
-
|
||||
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
|
||||
+ }
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
|
||||
{
|
||||
int j = 0;
|
||||
|
||||
if (this == Blocks.field_150365_q)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
|
||||
+ j = MathHelper.func_76136_a(rand, 0, 2);
|
||||
}
|
||||
else if (this == Blocks.field_150482_ag)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
|
||||
+ j = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150412_bA)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
|
||||
+ j = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150369_x)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
|
||||
+ j = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
else if (this == Blocks.field_150449_bY)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
|
||||
+ j = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
|
||||
+ return j;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_)
|
||||
@@ -1,41 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
||||
@@ -39,7 +39,10 @@
|
||||
|
||||
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
|
||||
{
|
||||
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c()))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c()))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c()))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c())));
|
||||
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
|
||||
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
|
||||
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
|
||||
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -65,10 +68,10 @@
|
||||
|
||||
public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List p_180638_5_, Entity p_180638_6_)
|
||||
{
|
||||
- boolean flag = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177978_c()).func_177230_c());
|
||||
- boolean flag1 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177968_d()).func_177230_c());
|
||||
- boolean flag2 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177976_e()).func_177230_c());
|
||||
- boolean flag3 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177974_f()).func_177230_c());
|
||||
+ boolean flag = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.NORTH);
|
||||
+ boolean flag1 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.SOUTH);
|
||||
+ boolean flag2 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.WEST);
|
||||
+ boolean flag3 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.EAST);
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
|
||||
{
|
||||
@@ -187,4 +190,11 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
|
||||
}
|
||||
+
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
|
||||
+ {
|
||||
+ BlockPos off = pos.func_177972_a(dir);
|
||||
+ Block block = world.func_180495_p(off).func_177230_c();
|
||||
+ return func_150098_a(block) || block.isSideSolid(world, off, dir.func_176734_d());
|
||||
+ }
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -200,7 +200,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
|
||||
+ if (!flag1 && !block.isAir(p_180648_1_, blockpos1) && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
|
||||
{
|
||||
this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false);
|
||||
}
|
||||
@@ -344,7 +344,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !(p_180696_0_ instanceof ITileEntityProvider);
|
||||
+ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -384,7 +384,9 @@
|
||||
{
|
||||
blockpos1 = (BlockPos)list1.get(j);
|
||||
Block block = p_176319_1_.func_180495_p(blockpos1).func_177230_c();
|
||||
- block.func_176226_b(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), 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_180653_a(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), chance, 0);
|
||||
p_176319_1_.func_175698_g(blockpos1);
|
||||
--i;
|
||||
ablock[i] = block;
|
||||
@@ -1,37 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
@@ -110,16 +110,7 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- {
|
||||
- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_);
|
||||
-
|
||||
- if (tileentitypiston != null)
|
||||
- {
|
||||
- IBlockState iblockstate1 = tileentitypiston.func_174927_b();
|
||||
- iblockstate1.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate1, 0);
|
||||
- }
|
||||
- }
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
}
|
||||
|
||||
public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_)
|
||||
@@ -283,4 +274,16 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos);
|
||||
+ if (tileentitypiston != null)
|
||||
+ {
|
||||
+ IBlockState pushed = tileentitypiston.func_174927_b();
|
||||
+ return pushed.func_177230_c().getDrops(world, pos, pushed, fortune);
|
||||
+ }
|
||||
+ return new java.util.ArrayList();
|
||||
+ }
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
|
||||
@@ -24,13 +24,14 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
-
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- {
|
||||
- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0)
|
||||
- {
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI));
|
||||
- }
|
||||
- }
|
||||
}
|
||||
+ @Override
|
||||
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
+ java.util.Random rand = world instanceof World ? ((World)world).field_73012_v : new java.util.Random();
|
||||
+ if (((Integer)state.func_177229_b(field_176488_a)) >= 7 && rand.nextInt(50) == 0)
|
||||
+ ret.add(new ItemStack(Items.field_151170_bI));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
|
||||
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
|
||||
}
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
@@ -1,122 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
@@ -33,7 +33,7 @@
|
||||
public static boolean func_176563_d(IBlockState p_176563_0_)
|
||||
{
|
||||
Block block = p_176563_0_.func_177230_c();
|
||||
- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
|
||||
+ return block instanceof BlockRailBase;
|
||||
}
|
||||
|
||||
protected BlockRailBase(boolean p_i45389_1_)
|
||||
@@ -174,7 +174,56 @@
|
||||
}
|
||||
|
||||
public abstract IProperty func_176560_l();
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return !this.field_150053_a;
|
||||
+ }
|
||||
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * 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 pod Block's position in world
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ {
|
||||
+ 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 pod Block's position in world
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END =====================================*/
|
||||
+
|
||||
public static enum EnumRailDirection implements IStringSerializable
|
||||
{
|
||||
NORTH_SOUTH(0, "north_south"),
|
||||
@@ -251,6 +300,7 @@
|
||||
private final boolean field_150656_f;
|
||||
private final List field_150657_g = Lists.newArrayList();
|
||||
private static final String __OBFID = "CL_00000196";
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
|
||||
{
|
||||
@@ -259,7 +309,8 @@
|
||||
this.field_180366_e = p_i45739_4_;
|
||||
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
|
||||
BlockRailBase.EnumRailDirection enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
|
||||
- this.field_150656_f = this.field_180365_d.field_150053_a;
|
||||
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
|
||||
+ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
|
||||
this.func_180360_a(enumraildirection);
|
||||
}
|
||||
|
||||
@@ -448,7 +499,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
{
|
||||
@@ -461,7 +512,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
{
|
||||
@@ -604,7 +655,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
{
|
||||
@@ -617,7 +668,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
{
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
@@ -295,6 +295,21 @@
|
||||
return this.func_176223_P().func_177226_a(field_176387_N, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
|
||||
+ {
|
||||
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World)
|
||||
+ {
|
||||
+ func_176204_a((World)world, pos, world.func_180495_p(pos), world.func_180495_p(neighbor).func_177230_c());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
public static enum Mode implements IStringSerializable
|
||||
{
|
||||
COMPARE("compare"),
|
||||
@@ -1,22 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
@@ -92,12 +92,16 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ }
|
||||
|
||||
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
|
||||
+ @Override
|
||||
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this))
|
||||
{
|
||||
- int j = 1 + p_180653_1_.field_73012_v.nextInt(5);
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
|
||||
+ return 1 + RANDOM.nextInt(5);
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -1,59 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -60,10 +60,10 @@
|
||||
BlockPos blockpos1 = p_176341_2_.func_177972_a(p_176341_3_);
|
||||
Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c();
|
||||
|
||||
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos1), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177977_b()))))
|
||||
+ if (!canRestoneConnect(p_176341_1_, blockpos1, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos1.func_177977_b(), null)))
|
||||
{
|
||||
Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c();
|
||||
- return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
|
||||
+ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos1.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -393,35 +393,25 @@
|
||||
Block block = iblockstate.func_177230_c();
|
||||
boolean flag = block.func_149721_r();
|
||||
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r();
|
||||
- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos1.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos1.func_177977_b())));
|
||||
+ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos1.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos1, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos1.func_177977_b(), null)));
|
||||
}
|
||||
|
||||
- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
|
||||
+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
|
||||
- }
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
|
||||
- protected static boolean func_176346_d(IBlockState p_176346_0_)
|
||||
- {
|
||||
- return func_176343_a(p_176346_0_, (EnumFacing)null);
|
||||
- }
|
||||
-
|
||||
- protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_)
|
||||
- {
|
||||
- Block block = p_176343_0_.func_177230_c();
|
||||
-
|
||||
- if (block == Blocks.field_150488_af)
|
||||
+ if (state.func_177230_c() == Blocks.field_150488_af)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- else if (Blocks.field_150413_aR.func_149907_e(block))
|
||||
+ else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c()))
|
||||
{
|
||||
- EnumFacing enumfacing1 = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N);
|
||||
- return enumfacing1 == p_176343_1_ || enumfacing1.func_176734_d() == p_176343_1_;
|
||||
+ EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N);
|
||||
+ return direction == side || direction.func_176734_d() == side;
|
||||
}
|
||||
else
|
||||
{
|
||||
- return block.func_149744_f() && p_176343_1_ != null;
|
||||
+ return state.func_177230_c().canConnectRedstone(world, pos, side);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
|
||||
@@ -19,7 +19,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockReed extends Block
|
||||
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15);
|
||||
private static final String __OBFID = "CL_00000300";
|
||||
@@ -67,6 +67,7 @@
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c();
|
||||
+ if (block.canSustainPlant(p_176196_1_, p_176196_2_, EnumFacing.UP, this)) return true;
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
@@ -172,4 +173,15 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176355_a});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Beach;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
+ return this.func_176223_P();
|
||||
+ }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
|
||||
@@ -66,6 +66,7 @@
|
||||
|
||||
public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_)
|
||||
{
|
||||
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return;
|
||||
Object object = p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
@@ -1,55 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
|
||||
@@ -122,8 +122,6 @@
|
||||
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_);
|
||||
}
|
||||
|
||||
- public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) {}
|
||||
-
|
||||
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_)
|
||||
{
|
||||
if (p_176208_4_.field_71075_bZ.field_75098_d)
|
||||
@@ -131,13 +129,18 @@
|
||||
p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true));
|
||||
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4);
|
||||
}
|
||||
+ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0);
|
||||
|
||||
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
|
||||
}
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
{
|
||||
- if (!p_180663_1_.field_72995_K)
|
||||
+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
+ }
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
{
|
||||
if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
|
||||
{
|
||||
@@ -146,7 +149,7 @@
|
||||
if (tileentity instanceof TileEntitySkull)
|
||||
{
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
|
||||
- ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_176222_j(p_180663_1_, p_180663_2_));
|
||||
+ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a());
|
||||
|
||||
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
|
||||
{
|
||||
@@ -156,12 +159,11 @@
|
||||
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
|
||||
}
|
||||
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, itemstack);
|
||||
+ ret.add(itemstack);
|
||||
}
|
||||
}
|
||||
-
|
||||
- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -1,53 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
|
||||
@@ -80,7 +80,7 @@
|
||||
{
|
||||
IBlockState iblockstate = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
Block block = iblockstate.func_177230_c();
|
||||
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 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_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
}
|
||||
|
||||
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
|
||||
@@ -92,7 +92,6 @@
|
||||
{
|
||||
if (!this.func_176196_c(p_176314_1_, p_176314_2_))
|
||||
{
|
||||
- this.func_176226_b(p_176314_1_, p_176314_2_, p_176314_3_, 0);
|
||||
p_176314_1_.func_175698_g(p_176314_2_);
|
||||
return false;
|
||||
}
|
||||
@@ -104,9 +103,8 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0));
|
||||
+ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
p_180657_1_.func_175698_g(p_180657_3_);
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -116,14 +114,13 @@
|
||||
|
||||
public int func_149745_a(Random p_149745_1_)
|
||||
{
|
||||
- return 0;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
{
|
||||
if (p_180650_1_.func_175642_b(EnumSkyBlock.BLOCK, p_180650_2_) > 11)
|
||||
{
|
||||
- this.func_176226_b(p_180650_1_, p_180650_2_, p_180650_1_.func_180495_p(p_180650_2_), 0);
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
}
|
||||
}
|
||||
@@ -153,4 +150,6 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176315_a});
|
||||
}
|
||||
+
|
||||
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; }
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
|
||||
@@ -108,7 +108,7 @@
|
||||
p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_));
|
||||
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
|
||||
|
||||
- if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P());
|
||||
}
|
||||
@@ -162,24 +162,29 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ }
|
||||
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
{
|
||||
Item item = this.func_176481_j();
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
- int j = ((Integer)p_180653_3_.func_177229_b(field_176484_a)).intValue();
|
||||
+ int j = ((Integer)state.func_177229_b(field_176484_a)).intValue();
|
||||
|
||||
for (int k = 0; k < 3; ++k)
|
||||
{
|
||||
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
|
||||
+ if (RANDOM.nextInt(15) <= j)
|
||||
{
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item));
|
||||
+ ret.add(new ItemStack(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
protected Item func_176481_j()
|
||||
@@ -1,66 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
|
||||
@@ -23,7 +23,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockTallGrass extends BlockBush implements IGrowable
|
||||
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class);
|
||||
private static final String __OBFID = "CL_00000321";
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
|
||||
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
|
||||
}
|
||||
|
||||
public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_)
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
{
|
||||
- return p_180660_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
|
||||
+ return null;
|
||||
}
|
||||
|
||||
public int func_149679_a(int p_149679_1_, Random p_149679_2_)
|
||||
@@ -84,13 +84,7 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a()));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
@@ -210,4 +204,22 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override
|
||||
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)world.func_180495_p(pos).func_177229_b(field_176497_a)).func_177044_a()));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ if (RANDOM.nextInt(8) != 0) return ret;
|
||||
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM);
|
||||
+ if (seed != null) ret.add(seed);
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
|
||||
@@ -70,7 +70,7 @@
|
||||
else
|
||||
{
|
||||
Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c();
|
||||
- return block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn;
|
||||
+ return block.canPlaceTorchOnTop(p_176594_1_, p_176594_2_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
{
|
||||
BlockPos blockpos1 = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d());
|
||||
boolean flag = p_176595_3_.func_176740_k().func_176722_c();
|
||||
- return flag && p_176595_1_.func_175677_d(blockpos1, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
|
||||
+ return flag && p_176595_1_.isSideSolid(blockpos1, p_176595_3_, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
|
||||
}
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
@@ -120,7 +120,7 @@
|
||||
|
||||
enumfacing1 = (EnumFacing)iterator.next();
|
||||
}
|
||||
- while (!p_180642_1_.func_175677_d(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), true));
|
||||
+ while (!p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1, true));
|
||||
|
||||
return this.func_176223_P().func_177226_a(field_176596_a, enumfacing1);
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
EnumFacing enumfacing1 = enumfacing.func_176734_d();
|
||||
boolean flag = false;
|
||||
|
||||
- if (axis.func_176722_c() && !p_176592_1_.func_175677_d(p_176592_2_.func_177972_a(enumfacing1), true))
|
||||
+ if (axis.func_176722_c() && !p_176592_1_.isSideSolid(p_176592_2_.func_177972_a(enumfacing1), enumfacing1, true))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
public class BlockTrapDoor extends Block
|
||||
{
|
||||
+ /** Set this to allow trapdoors to remain free-floating */
|
||||
+ public static boolean disableValidation = false;
|
||||
public static final PropertyDirection field_176284_a = PropertyDirection.func_177712_a("facing", EnumFacing.Plane.HORIZONTAL);
|
||||
public static final PropertyBool field_176283_b = PropertyBool.func_177716_a("open");
|
||||
public static final PropertyEnum field_176285_M = PropertyEnum.func_177709_a("half", BlockTrapDoor.DoorHalf.class);
|
||||
@@ -141,9 +143,10 @@
|
||||
{
|
||||
if (!p_176204_1_.field_72995_K)
|
||||
{
|
||||
+ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a);
|
||||
BlockPos blockpos1 = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d());
|
||||
|
||||
- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()))
|
||||
+ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()) || p_176204_1_.isSideSolid(blockpos1, direction, true)))
|
||||
{
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
@@ -187,7 +190,10 @@
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
{
|
||||
- return !p_176198_3_.func_176740_k().func_176720_b() && func_150119_a(p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c());
|
||||
+ if (disableValidation) return true;
|
||||
+ EnumFacing dir = p_176198_3_.func_176734_d();
|
||||
+ p_176198_2_ = p_176198_2_.func_177972_a(dir);
|
||||
+ return !p_176198_3_.func_176740_k().func_176720_b() && (func_150119_a(p_176198_1_.func_180495_p(p_176198_2_).func_177230_c()) || p_176198_1_.isSideSolid(p_176198_2_, p_176198_3_, true));
|
||||
}
|
||||
|
||||
protected static EnumFacing func_176281_b(int p_176281_0_)
|
||||
@@ -224,6 +230,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;
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
{
|
||||
- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
|
||||
+ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
enumfacing = (EnumFacing)iterator.next();
|
||||
}
|
||||
- while (!p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r());
|
||||
+ while (!p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -107,7 +107,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a);
|
||||
|
||||
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
|
||||
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
|
||||
{
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
@@ -1,42 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
|
||||
@@ -26,7 +26,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockVine extends Block
|
||||
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up");
|
||||
public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north");
|
||||
@@ -416,13 +416,7 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
@@ -508,6 +502,16 @@
|
||||
return i;
|
||||
}
|
||||
|
||||
+ /*************************FORGE START***********************************/
|
||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return java.util.Arrays.asList(new ItemStack(this, 1));
|
||||
+ }
|
||||
+ /*************************FORGE END***********************************/
|
||||
+
|
||||
static final class SwitchEnumFacing
|
||||
{
|
||||
static final int[] field_177057_a = new int[EnumFacing.values().length];
|
||||
@@ -1,29 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
@@ -80,7 +80,7 @@
|
||||
{
|
||||
Block block = this.field_177261_a.func_180495_p(p_177251_1_).func_177230_c();
|
||||
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
+ if (block.isAir(field_177261_a, p_177251_1_))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -111,7 +111,7 @@
|
||||
BlockPos blockpos1 = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i);
|
||||
block = this.field_177261_a.func_180495_p(blockpos1).func_177230_c();
|
||||
|
||||
- if (block.func_149688_o() == Material.field_151579_a || !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos1, this.field_177257_d, false) || blockpos1.equals(this.field_177259_b))
|
||||
+ if (block.isAir(field_177261_a, blockpos1)|| !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos1, this.field_177257_d, false) || blockpos1.equals(this.field_177259_b))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
block = this.field_177261_a.func_180495_p(blockpos2).func_177230_c();
|
||||
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
+ if (block.isAir(field_177261_a, blockpos2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockState.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java
|
||||
@@ -47,6 +47,16 @@
|
||||
|
||||
public BlockState(Block p_i45663_1_, IProperty ... p_i45663_2_)
|
||||
{
|
||||
+ this(p_i45663_1_, p_i45663_2_, null);
|
||||
+ }
|
||||
+
|
||||
+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap unlistedProperties)
|
||||
+ {
|
||||
+ return new StateImplementation(block, properties);
|
||||
+ }
|
||||
+
|
||||
+ protected BlockState(Block p_i45663_1_, IProperty[] p_i45663_2_, ImmutableMap unlistedProperties)
|
||||
+ {
|
||||
this.field_177627_c = p_i45663_1_;
|
||||
Arrays.sort(p_i45663_2_, new Comparator()
|
||||
{
|
||||
@@ -70,7 +80,7 @@
|
||||
{
|
||||
List list = (List)iterator.next();
|
||||
Map map = MapPopulator.func_179400_b(this.field_177624_d, list);
|
||||
- BlockState.StateImplementation stateimplementation = new BlockState.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map), null);
|
||||
+ BlockState.StateImplementation stateimplementation = createState(p_i45663_1_, ImmutableMap.copyOf(map), unlistedProperties);
|
||||
linkedhashmap.put(map, stateimplementation);
|
||||
arraylist.add(stateimplementation);
|
||||
}
|
||||
@@ -231,5 +241,10 @@
|
||||
{
|
||||
this(p_i45661_1_, p_i45661_2_);
|
||||
}
|
||||
+
|
||||
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
|
||||
+ {
|
||||
+ return field_177238_c;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -296,7 +296,6 @@
|
||||
this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
|
||||
field_147123_G.info("Setting user: " + this.field_71449_j.func_111285_a());
|
||||
- field_147123_G.info("(Session ID is " + this.field_71449_j.func_111286_b() + ")");
|
||||
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
|
||||
this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1;
|
||||
this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1;
|
||||
@@ -484,7 +483,7 @@
|
||||
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
|
||||
net.minecraftforge.fml.client.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)
|
||||
{
|
||||
@@ -891,11 +890,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();
|
||||
@@ -905,6 +899,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;
|
||||
@@ -1388,7 +1393,7 @@
|
||||
|
||||
if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b))
|
||||
{
|
||||
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
|
||||
+ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x);
|
||||
this.field_71439_g.func_71038_i();
|
||||
}
|
||||
}
|
||||
@@ -1468,15 +1473,19 @@
|
||||
case 2:
|
||||
BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
|
||||
- if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a)
|
||||
+ if (!this.field_71441_e.func_175623_d(blockpos))
|
||||
{
|
||||
int i = itemstack != null ? itemstack.field_77994_a : 0;
|
||||
|
||||
+
|
||||
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b).isCanceled();
|
||||
+ if (result) { //Forge: Kept separate to simplify patch
|
||||
if (this.field_71442_b.func_178890_a(this.field_71439_g, this.field_71441_e, itemstack, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f))
|
||||
{
|
||||
flag = false;
|
||||
this.field_71439_g.func_71038_i();
|
||||
}
|
||||
+ }
|
||||
|
||||
if (itemstack == null)
|
||||
{
|
||||
@@ -1697,6 +1706,8 @@
|
||||
|
||||
while (Mouse.next())
|
||||
{
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
|
||||
+
|
||||
i = Mouse.getEventButton();
|
||||
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
|
||||
|
||||
@@ -2217,6 +2228,8 @@
|
||||
|
||||
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();
|
||||
@@ -2230,6 +2243,18 @@
|
||||
{
|
||||
this.field_71437_Z.func_71263_m();
|
||||
this.field_71437_Z.func_175592_a();
|
||||
+ 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;
|
||||
@@ -2361,134 +2386,11 @@
|
||||
if (this.field_71476_x != null)
|
||||
{
|
||||
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
|
||||
- int i = 0;
|
||||
- boolean flag1 = false;
|
||||
- TileEntity tileentity = null;
|
||||
- Object object;
|
||||
|
||||
- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
- {
|
||||
- BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c();
|
||||
-
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- object = block.func_180665_b(this.field_71441_e, blockpos);
|
||||
-
|
||||
- if (object == null)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (flag && GuiScreen.func_146271_m())
|
||||
- {
|
||||
- tileentity = this.field_71441_e.func_175625_s(blockpos);
|
||||
- }
|
||||
-
|
||||
- Block block1 = object instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a((Item)object) : block;
|
||||
- i = block1.func_176222_j(this.field_71441_e, blockpos);
|
||||
- flag1 = ((Item)object).func_77614_k();
|
||||
- }
|
||||
- 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)
|
||||
- {
|
||||
- object = Items.field_151159_an;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot)
|
||||
- {
|
||||
- object = 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)
|
||||
- {
|
||||
- object = Items.field_151160_bD;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- object = 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;
|
||||
-
|
||||
- switch (Minecraft.SwitchEnumMinecartType.field_178901_b[entityminecart.func_180456_s().ordinal()])
|
||||
- {
|
||||
- case 1:
|
||||
- object = Items.field_151109_aJ;
|
||||
- break;
|
||||
- case 2:
|
||||
- object = Items.field_151108_aI;
|
||||
- break;
|
||||
- case 3:
|
||||
- object = Items.field_151142_bV;
|
||||
- break;
|
||||
- case 4:
|
||||
- object = Items.field_151140_bW;
|
||||
- break;
|
||||
- case 5:
|
||||
- object = Items.field_151095_cc;
|
||||
- break;
|
||||
- default:
|
||||
- object = Items.field_151143_au;
|
||||
- }
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityBoat)
|
||||
- {
|
||||
- object = Items.field_151124_az;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand)
|
||||
- {
|
||||
- object = Items.field_179565_cj;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- object = Items.field_151063_bx;
|
||||
- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g);
|
||||
- flag1 = true;
|
||||
-
|
||||
- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
|
||||
|
||||
- if (tileentity == null)
|
||||
- {
|
||||
- inventoryplayer.func_146030_a((Item)object, i, flag1, flag);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
- tileentity.func_145841_b(nbttagcompound1);
|
||||
- ItemStack itemstack1 = new ItemStack((Item)object, 1, i);
|
||||
- itemstack1.func_77983_a("BlockEntityTag", nbttagcompound1);
|
||||
- NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
- NBTTagList nbttaglist = new NBTTagList();
|
||||
- nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
|
||||
- nbttagcompound.func_74782_a("Lore", nbttaglist);
|
||||
- itemstack1.func_77983_a("display", nbttagcompound);
|
||||
- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1);
|
||||
- }
|
||||
-
|
||||
+ 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)
|
||||
{
|
||||
int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c;
|
||||
@@ -2744,8 +2646,11 @@
|
||||
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);
|
||||
@@ -2753,6 +2658,7 @@
|
||||
|
||||
if (j != 0)
|
||||
{
|
||||
+ max_texture_size = i;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
Loaded 100 of 524 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user