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
|
||||
-23
@@ -1,23 +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
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "fml"]
|
||||
path = fml
|
||||
url = https://github.com/MinecraftForge/FML.git
|
||||
@@ -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.
|
||||
-31
@@ -1,31 +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.
|
||||
|
||||
|
||||
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/ .
|
||||
|
||||
-122
@@ -1,122 +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.7.2'
|
||||
mcpVersion = '9.03'
|
||||
fmlDir = projectDir.getAbsolutePath() + "/fml";
|
||||
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
|
||||
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
|
||||
installerVersion = "1.4"
|
||||
}
|
||||
|
||||
group = 'net.minecraftforge'
|
||||
version = getVersionFromJava(getProject(), 'src/main/java/net/minecraftforge/common/ForgeVersion.java')
|
||||
|
||||
jenkins {
|
||||
job = 'minecraftforge'
|
||||
}
|
||||
|
||||
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 7eb36a1481.
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,73 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
||||
@@ -6,8 +6,13 @@
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+import static net.minecraftforge.common.EnumPlantType.*;
|
||||
|
||||
-public class BlockBush extends Block
|
||||
+public class BlockBush extends Block implements IPlantable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000208";
|
||||
|
||||
@@ -27,7 +32,7 @@
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_));
|
||||
+ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_);
|
||||
}
|
||||
|
||||
protected boolean func_149854_a(Block p_149854_1_)
|
||||
@@ -57,7 +62,7 @@
|
||||
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
|
||||
+ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
|
||||
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
@@ -79,4 +84,37 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ if (this == Blocks.field_150464_aj) return Crop;
|
||||
+ if (this == Blocks.field_150459_bM) return Crop;
|
||||
+ if (this == Blocks.field_150469_bN) return Crop;
|
||||
+ if (this == Blocks.field_150394_bc) return Crop;
|
||||
+ if (this == Blocks.field_150393_bb) return Crop;
|
||||
+ if (this == Blocks.field_150330_I) return Desert;
|
||||
+ if (this == Blocks.field_150392_bi) return Water;
|
||||
+ if (this == Blocks.field_150337_Q) return Cave;
|
||||
+ if (this == Blocks.field_150338_P) return Cave;
|
||||
+ if (this == Blocks.field_150388_bm) return Nether;
|
||||
+ if (this == Blocks.field_150345_g) return Plains;
|
||||
+ if (this == Blocks.field_150329_H) return Plains;
|
||||
+ if (this == Blocks.field_150398_cm) return Plains;
|
||||
+ if (this == Blocks.field_150328_O) return Plains;
|
||||
+ if (this == Blocks.field_150327_N) return Plains;
|
||||
+ return Plains;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return world.func_72805_g(x, y, z);
|
||||
+ }
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
|
||||
@@ -14,6 +14,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public abstract class BlockButton extends Block
|
||||
{
|
||||
private final boolean field_150047_a;
|
||||
@@ -49,12 +52,19 @@
|
||||
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
|
||||
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
|
||||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST)) ||
|
||||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST));
|
||||
}
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
|
||||
+ return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) ||
|
||||
+ (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) ||
|
||||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) ||
|
||||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH));
|
||||
}
|
||||
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
@@ -63,19 +73,21 @@
|
||||
int k1 = j1 & 8;
|
||||
j1 &= 7;
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_);
|
||||
+
|
||||
+ if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
|
||||
{
|
||||
j1 = 4;
|
||||
}
|
||||
- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
|
||||
+ else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
|
||||
{
|
||||
j1 = 2;
|
||||
}
|
||||
- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
|
||||
{
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -89,7 +101,11 @@
|
||||
|
||||
private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_)
|
||||
{
|
||||
- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1)));
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1;
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2;
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3;
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ + 1, NORTH)) return 4;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -99,22 +115,22 @@
|
||||
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
|
||||
@@ -11,9 +11,13 @@
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
|
||||
-public class BlockCactus extends Block
|
||||
+public class BlockCactus extends Block implements IPlantable
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon field_150041_a;
|
||||
@@ -125,7 +129,7 @@
|
||||
else
|
||||
{
|
||||
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
|
||||
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
|
||||
+ return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,4 +145,22 @@
|
||||
this.field_150041_a = p_149651_1_.func_94245_a(this.func_149641_N() + "_top");
|
||||
this.field_150040_b = p_149651_1_.func_94245_a(this.func_149641_N() + "_bottom");
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return EnumPlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
|
||||
@@ -23,6 +23,8 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockChest extends BlockContainer
|
||||
{
|
||||
private final Random field_149955_b = new Random();
|
||||
@@ -407,7 +409,7 @@
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r())
|
||||
+ else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -415,19 +417,19 @@
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -160,6 +161,13 @@
|
||||
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int p_149690_5_, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> dropped = super.getDrops(world, x, y, z, p_149690_5_, fortune);
|
||||
int j1 = func_149987_c(p_149690_5_);
|
||||
byte b0 = 1;
|
||||
|
||||
@@ -170,8 +178,9 @@
|
||||
|
||||
for (int k1 = 0; k1 < b0; ++k1)
|
||||
{
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151100_aR, 1, 3));
|
||||
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, 3));
|
||||
}
|
||||
+ return dropped;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -216,4 +225,10 @@
|
||||
++j1;
|
||||
p_149853_1_.func_72921_c(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public Item func_149650_a(int par1, Random par2Random, int par3)
|
||||
+ {
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -12,6 +13,7 @@
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockCrops extends BlockBush implements IGrowable
|
||||
{
|
||||
@@ -89,11 +91,11 @@
|
||||
{
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.field_150458_ak)
|
||||
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this))
|
||||
{
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (p_149864_1_.func_72805_g(l, p_149864_3_ - 1, i1) > 0)
|
||||
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1))
|
||||
{
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -145,22 +147,6 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
|
||||
-
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- if (p_149690_5_ >= 7)
|
||||
- {
|
||||
- int j1 = 3 + p_149690_7_;
|
||||
-
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
- {
|
||||
- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_)
|
||||
- {
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
}
|
||||
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
@@ -204,4 +190,23 @@
|
||||
{
|
||||
this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
+
|
||||
+ if (metadata >= 7)
|
||||
+ {
|
||||
+ for (int i = 0; i < 3 + fortune; ++i)
|
||||
+ {
|
||||
+ if (world.field_73012_v.nextInt(15) <= metadata)
|
||||
+ {
|
||||
+ ret.add(new ItemStack(this.func_149866_i(), 1, 0));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -8,9 +10,11 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush
|
||||
+public class BlockDeadBush extends BlockBush implements IShearable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000224";
|
||||
|
||||
@@ -33,14 +37,15 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150330_I, 1, p_149636_6_));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; }
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ return new ArrayList<ItemStack>(Arrays.asList(new ItemStack(Blocks.field_150330_I, 1, world.func_72805_g(x, y, z))));
|
||||
+ }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
|
||||
@@ -249,7 +249,7 @@
|
||||
{
|
||||
if (this.field_149764_J == Material.field_151573_f)
|
||||
{
|
||||
- return true;
|
||||
+ return false; //Allow items to interact with the door
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -367,7 +367,7 @@
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_3_ >= 255 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
|
||||
+ return p_149742_3_ >= p_149742_1_.func_72800_K() - 1 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
|
||||
}
|
||||
|
||||
public int func_149656_h()
|
||||
@@ -1,52 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -18,8 +19,9 @@
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockDoublePlant extends BlockBush implements IGrowable
|
||||
+public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable
|
||||
{
|
||||
public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"};
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -81,6 +83,7 @@
|
||||
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
+ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
int l = p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
}
|
||||
@@ -262,4 +265,22 @@
|
||||
int l = this.func_149885_e(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
|
||||
this.func_149642_a(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, new ItemStack(this, 1, l));
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ int metadata = world.func_72805_g(x, y, z);
|
||||
+ int type = func_149890_d(metadata);
|
||||
+ return func_149887_c(metadata) && (type == 3 || type == 4);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ int type = func_149890_d(world.func_72805_g(x, y, z));
|
||||
+ if (type == 3 || type == 2)
|
||||
+ ret.add(new ItemStack(Blocks.field_150329_H, 2, type == 3 ? 2 : 1));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
|
||||
@@ -84,7 +84,7 @@
|
||||
{
|
||||
Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_);
|
||||
|
||||
- if (block.field_149764_J == Material.field_151579_a)
|
||||
+ if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -94,6 +94,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ //TODO: King, take a look here when doing liquids!
|
||||
Material material = block.field_149764_J;
|
||||
return material == Material.field_151586_h ? true : material == Material.field_151587_i;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
@@ -12,6 +12,8 @@
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFarmland extends Block
|
||||
{
|
||||
@@ -94,7 +96,7 @@
|
||||
{
|
||||
Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1);
|
||||
|
||||
- if (block == Blocks.field_150464_aj || block == Blocks.field_150394_bc || block == Blocks.field_150393_bb || block == Blocks.field_150469_bN || block == Blocks.field_150459_bM)
|
||||
+ if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,309 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.IdentityHashMap;
|
||||
+import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
+import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -12,11 +15,15 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProviderEnd;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class BlockFire extends Block
|
||||
{
|
||||
- private int[] field_149849_a = new int[256];
|
||||
- private int[] field_149848_b = new int[256];
|
||||
+ @Deprecated
|
||||
+ private int[] field_149849_a = new int[4096];
|
||||
+ @Deprecated
|
||||
+ private int[] field_149848_b = new int[4096];
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] field_149850_M;
|
||||
private static final String __OBFID = "CL_00000245";
|
||||
@@ -54,10 +61,10 @@
|
||||
Blocks.field_150480_ab.func_149842_a(func_149682_b(Blocks.field_150404_cg), 60, 20);
|
||||
}
|
||||
|
||||
+ @Deprecated // Use setFireInfo
|
||||
public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_)
|
||||
{
|
||||
- this.field_149849_a[p_149842_1_] = p_149842_2_;
|
||||
- this.field_149848_b[p_149842_1_] = p_149842_3_;
|
||||
+ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_);
|
||||
}
|
||||
|
||||
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
@@ -94,13 +101,8 @@
|
||||
{
|
||||
if (p_149674_1_.func_82736_K().func_82766_b("doFireTick"))
|
||||
{
|
||||
- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150424_aL;
|
||||
+ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP);
|
||||
|
||||
- if (p_149674_1_.field_73011_w instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150357_h)
|
||||
- {
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_))
|
||||
{
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
@@ -128,7 +130,7 @@
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
}
|
||||
- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0)
|
||||
+ else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0)
|
||||
{
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
@@ -142,12 +144,12 @@
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l);
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l, DOWN );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l, SOUTH);
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l, NORTH);
|
||||
|
||||
for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1)
|
||||
{
|
||||
@@ -201,10 +203,16 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated
|
||||
private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_)
|
||||
{
|
||||
- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))];
|
||||
+ this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP);
|
||||
+ }
|
||||
|
||||
+ private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face)
|
||||
+ {
|
||||
+ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face);
|
||||
+
|
||||
if (p_149841_6_.nextInt(p_149841_5_) < j1)
|
||||
{
|
||||
boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.field_150335_W;
|
||||
@@ -234,7 +242,12 @@
|
||||
|
||||
private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_)
|
||||
{
|
||||
- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1)))));
|
||||
+ return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH);
|
||||
}
|
||||
|
||||
private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_)
|
||||
@@ -247,12 +260,13 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- int l = this.func_149846_a(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, b0);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l);
|
||||
+ int l = b0;
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH);
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
@@ -262,15 +276,16 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated
|
||||
public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_)
|
||||
{
|
||||
- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0;
|
||||
+ return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
|
||||
}
|
||||
|
||||
+ @Deprecated
|
||||
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_)
|
||||
{
|
||||
- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))];
|
||||
- return i1 > p_149846_5_ ? i1 : p_149846_5_;
|
||||
+ return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
|
||||
}
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
@@ -314,9 +329,9 @@
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_))
|
||||
+ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP))
|
||||
{
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -327,7 +342,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -338,7 +353,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -349,7 +364,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -360,7 +375,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -405,4 +420,101 @@
|
||||
{
|
||||
return MapColor.field_151656_f;
|
||||
}
|
||||
+
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
+ private static class FireInfo
|
||||
+ {
|
||||
+ private int encouragement = 0;
|
||||
+ private int flammibility = 0;
|
||||
+ }
|
||||
+ private IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
|
||||
+
|
||||
+ public void setFireInfo(Block block, int encouragement, int flammibility)
|
||||
+ {
|
||||
+ if (block == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
||||
+ int id = Block.func_149682_b(block);
|
||||
+ this.field_149849_a[id] = encouragement;
|
||||
+ this.field_149848_b[id] = flammibility;
|
||||
+
|
||||
+ FireInfo info = getInfo(block, true);
|
||||
+ info.encouragement = encouragement;
|
||||
+ info.flammibility = flammibility;
|
||||
+ }
|
||||
+
|
||||
+ private FireInfo getInfo(Block block, boolean garentee)
|
||||
+ {
|
||||
+ FireInfo ret = blockInfo.get(block);
|
||||
+ if (ret == null && garentee)
|
||||
+ {
|
||||
+ ret = new FireInfo();
|
||||
+ blockInfo.put(block, ret);
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ public void rebuildFireInfo()
|
||||
+ {
|
||||
+ for (int x = 0; x < 4096; x++)
|
||||
+ {
|
||||
+ //If we care.. we could detect changes in here and make sure we keep them, however
|
||||
+ //it's my thinking that anyone who hacks into the private variables should DIAF and we don't care about them.
|
||||
+ field_149849_a[x] = 0;
|
||||
+ field_149848_b[x] = 0;
|
||||
+ }
|
||||
+
|
||||
+ for (Entry<Block, FireInfo> e : blockInfo.entrySet())
|
||||
+ {
|
||||
+ int id = Block.func_149682_b(e.getKey());
|
||||
+ if (id >= 0 && id < 4096)
|
||||
+ {
|
||||
+ field_149849_a[id] = e.getValue().encouragement;
|
||||
+ field_149848_b[id] = e.getValue().flammibility;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public int getFlammability(Block block)
|
||||
+ {
|
||||
+ int id = Block.func_149682_b(block);
|
||||
+ return id >= 0 && id < 4096 ? field_149848_b[id] : 0;
|
||||
+ }
|
||||
+
|
||||
+ public int getEncouragement(Block block)
|
||||
+ {
|
||||
+ int id = Block.func_149682_b(block);
|
||||
+ return id >= 0 && id < 4096 ? field_149849_a[id] : 0;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x X Position
|
||||
+ * @param y Y Position
|
||||
+ * @param z Z Position
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return True if the face can catch fire.
|
||||
+ */
|
||||
+ public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face)
|
||||
+ {
|
||||
+ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x X Position
|
||||
+ * @param y Y Position
|
||||
+ * @param z Z Position
|
||||
+ * @param oldChance The previous maximum chance.
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return The chance of the block catching fire, or oldChance if it is higher
|
||||
+ */
|
||||
+ public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face)
|
||||
+ {
|
||||
+ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
|
||||
+ return (newChance > oldChance ? newChance : oldChance);
|
||||
+ }
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -139,12 +140,6 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
- TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
|
||||
-
|
||||
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
|
||||
- {
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
|
||||
- }
|
||||
}
|
||||
|
||||
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
@@ -242,4 +237,14 @@
|
||||
|
||||
return new TileEntityFlowerPot(Item.func_150898_a((Block)object), b0);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
+ TileEntityFlowerPot te = this.func_149929_e(world, x, y, z);
|
||||
+ if (te != null && te.func_145965_a() != null)
|
||||
+ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
|
||||
@@ -43,7 +43,7 @@
|
||||
{
|
||||
if (!p_149674_1_.field_72995_K)
|
||||
{
|
||||
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
|
||||
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
|
||||
{
|
||||
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
|
||||
}
|
||||
@@ -56,7 +56,7 @@
|
||||
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
|
||||
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
|
||||
|
||||
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
p_149674_1_.func_147449_b(i1, j1, k1, Blocks.field_150349_c);
|
||||
}
|
||||
@@ -184,15 +184,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- String s = p_149853_1_.func_72807_a(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1);
|
||||
- field_149992_a.debug("Flower in " + p_149853_1_.func_72807_a(i1, k1).field_76791_y + ": " + s);
|
||||
- BlockFlower blockflower = BlockFlower.func_149857_e(s);
|
||||
-
|
||||
- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1))
|
||||
- {
|
||||
- int i2 = BlockFlower.func_149856_f(s);
|
||||
- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3);
|
||||
- }
|
||||
+ p_149853_1_.func_72807_a(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -13,6 +14,7 @@
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
public class BlockIce extends BlockBreakable
|
||||
{
|
||||
@@ -43,14 +45,16 @@
|
||||
p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
p_149636_2_.func_71020_j(0.025F);
|
||||
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_))
|
||||
+ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_))
|
||||
{
|
||||
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
ItemStack itemstack = this.func_149644_j(p_149636_6_);
|
||||
|
||||
- if (itemstack != null)
|
||||
- {
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack);
|
||||
- }
|
||||
+ if (itemstack != null) items.add(itemstack);
|
||||
+
|
||||
+ ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_);
|
||||
+ for (ItemStack is : items)
|
||||
+ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -61,7 +65,9 @@
|
||||
}
|
||||
|
||||
int i1 = EnchantmentHelper.func_77517_e(p_149636_2_);
|
||||
+ harvesters.set(p_149636_2_);
|
||||
this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1);
|
||||
+ harvesters.set(null);
|
||||
Material material = p_149636_1_.func_147439_a(p_149636_3_, p_149636_4_ - 1, p_149636_5_).func_149688_o();
|
||||
|
||||
if (material.func_76230_c() || material.func_76224_d())
|
||||
@@ -1,93 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
|
||||
@@ -5,10 +5,14 @@
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
+import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockLadder extends Block
|
||||
{
|
||||
private static final String __OBFID = "CL_00000262";
|
||||
@@ -79,29 +83,32 @@
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
|
||||
}
|
||||
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
{
|
||||
int j1 = p_149660_9_;
|
||||
|
||||
- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
|
||||
+ if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
|
||||
{
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
|
||||
+ if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
|
||||
{
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
|
||||
{
|
||||
j1 = 5;
|
||||
}
|
||||
@@ -114,22 +121,22 @@
|
||||
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_);
|
||||
boolean flag = false;
|
||||
|
||||
- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r())
|
||||
+ if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r())
|
||||
+ if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r())
|
||||
+ if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r())
|
||||
+ if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -147,4 +154,10 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -15,8 +16,9 @@
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public abstract class BlockLeaves extends BlockLeavesBase
|
||||
+public abstract class BlockLeaves extends BlockLeavesBase implements IShearable
|
||||
{
|
||||
int[] field_150128_a;
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -82,10 +84,10 @@
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
{
|
||||
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
|
||||
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
|
||||
{
|
||||
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
|
||||
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,9 +129,9 @@
|
||||
{
|
||||
Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2);
|
||||
|
||||
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
|
||||
+ if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
|
||||
{
|
||||
- if (block.func_149688_o() == Material.field_151584_j)
|
||||
+ if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
|
||||
{
|
||||
this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
|
||||
}
|
||||
@@ -236,40 +238,7 @@
|
||||
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- int j1 = this.func_150123_b(p_149690_5_);
|
||||
-
|
||||
- if (p_149690_7_ > 0)
|
||||
- {
|
||||
- j1 -= 2 << p_149690_7_;
|
||||
-
|
||||
- if (j1 < 10)
|
||||
- {
|
||||
- j1 = 10;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (p_149690_1_.field_73012_v.nextInt(j1) == 0)
|
||||
- {
|
||||
- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_);
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_)));
|
||||
- }
|
||||
-
|
||||
- j1 = 200;
|
||||
-
|
||||
- if (p_149690_7_ > 0)
|
||||
- {
|
||||
- j1 -= 10 << p_149690_7_;
|
||||
-
|
||||
- if (j1 < 40)
|
||||
- {
|
||||
- j1 = 40;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.func_150124_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, j1);
|
||||
- }
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_);
|
||||
}
|
||||
|
||||
protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {}
|
||||
@@ -281,13 +250,7 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
@@ -318,4 +281,67 @@
|
||||
}
|
||||
|
||||
public abstract String[] func_150125_e();
|
||||
+
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z) & 3));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void beginLeavesDecay(World world, int x, int y, int z)
|
||||
+ {
|
||||
+
|
||||
+ int i2 = world.func_72805_g(x, y, z);
|
||||
+
|
||||
+ if ((i2 & 8) == 0)
|
||||
+ {
|
||||
+ world.func_72921_c(x, y, z, i2 | 8, 4);
|
||||
+ }
|
||||
+ world.func_72921_c(x, y, z, world.func_72805_g(x, y, z) | 8, 4);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLeaves(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ int chance = this.func_150123_b(metadata);
|
||||
+
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
+ chance -= 2 << fortune;
|
||||
+ if (chance < 10) chance = 10;
|
||||
+ }
|
||||
+
|
||||
+ if (world.field_73012_v.nextInt(chance) == 0)
|
||||
+ ret.add(new ItemStack(this.func_149650_a(metadata, world.field_73012_v, fortune), 1, this.func_149692_a(metadata)));
|
||||
+
|
||||
+ chance = 200;
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
+ chance -= 10 << fortune;
|
||||
+ if (chance < 40) chance = 40;
|
||||
+ }
|
||||
+
|
||||
+ this.captureDrops(true);
|
||||
+ this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang
|
||||
+ ret.addAll(this.captureDrops(false));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
|
||||
@@ -10,6 +10,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockLever extends Block
|
||||
{
|
||||
private static final String __OBFID = "CL_00000264";
|
||||
@@ -42,12 +45,23 @@
|
||||
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()))));
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
|
||||
+ return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) ||
|
||||
+ (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) ||
|
||||
+ (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
|
||||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
|
||||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
|
||||
}
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r()))));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ - 1, p_149742_4_, UP ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN );
|
||||
}
|
||||
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
@@ -56,32 +70,32 @@
|
||||
int j1 = p_149660_9_ & 7;
|
||||
byte b0 = -1;
|
||||
|
||||
- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r())
|
||||
+ if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN))
|
||||
{
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_))
|
||||
+ if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP))
|
||||
{
|
||||
b0 = 5;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
|
||||
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
|
||||
{
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
|
||||
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
|
||||
{
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
|
||||
{
|
||||
b0 = 1;
|
||||
}
|
||||
@@ -147,42 +161,42 @@
|
||||
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
@@ -67,7 +67,7 @@
|
||||
{
|
||||
for (int l1 = -1; l1 <= 1; ++l1)
|
||||
{
|
||||
- int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).field_76759_H;
|
||||
+ int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier();
|
||||
l += (i2 & 16711680) >> 16;
|
||||
i1 += (i2 & 65280) >> 8;
|
||||
j1 += i2 & 255;
|
||||
@@ -1,45 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -7,6 +7,7 @@
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class BlockLog extends BlockRotatedPillar
|
||||
@@ -53,14 +54,10 @@
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
{
|
||||
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
|
||||
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
|
||||
{
|
||||
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
-
|
||||
- if ((i2 & 8) == 0)
|
||||
- {
|
||||
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
|
||||
- }
|
||||
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,4 +76,16 @@
|
||||
{
|
||||
return this.field_150166_b[p_150161_1_ % this.field_150166_b.length];
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isWood(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -7,6 +7,7 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMobSpawner extends BlockContainer
|
||||
@@ -36,10 +37,15 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
- int j1 = 15 + p_149690_1_.field_73012_v.nextInt(15) + p_149690_1_.field_73012_v.nextInt(15);
|
||||
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
|
||||
}
|
||||
|
||||
+ private Random rand = new Random();
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockAccess world, int metadata, int fortune)
|
||||
+ {
|
||||
+ return 15 + rand.nextInt(15) + rand.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public boolean func_149662_c()
|
||||
{
|
||||
return false;
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
@@ -4,6 +4,7 @@
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockMushroom extends BlockBush implements IGrowable
|
||||
{
|
||||
@@ -85,7 +86,7 @@
|
||||
if (p_149718_3_ >= 0 && p_149718_3_ < 256)
|
||||
{
|
||||
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
|
||||
- return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block);
|
||||
+ return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
@@ -37,7 +37,7 @@
|
||||
{
|
||||
if (!p_149674_1_.field_72995_K)
|
||||
{
|
||||
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
|
||||
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
|
||||
{
|
||||
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
|
||||
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
|
||||
|
||||
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
p_149674_1_.func_147449_b(i1, j1, k1, this);
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -11,6 +12,7 @@
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockNetherWart extends BlockBush
|
||||
{
|
||||
@@ -33,7 +35,7 @@
|
||||
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
|
||||
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
}
|
||||
|
||||
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
|
||||
@@ -60,9 +62,12 @@
|
||||
return 6;
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("unused")
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+
|
||||
+ if (false && !p_149690_1_.field_72995_K)
|
||||
{
|
||||
int j1 = 1;
|
||||
|
||||
@@ -109,4 +114,23 @@
|
||||
this.field_149883_a[i] = p_149651_1_.func_94245_a(this.func_149641_N() + "_stage_" + i);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ int count = 1;
|
||||
+
|
||||
+ if (metadata >= 3)
|
||||
+ {
|
||||
+ count = 2 + world.field_73012_v.nextInt(3) + (fortune > 0 ? world.field_73012_v.nextInt(fortune + 1) : 0);
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < count; i++)
|
||||
+ {
|
||||
+ ret.add(new ItemStack(Items.field_151075_bm));
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
||||
@@ -45,7 +45,9 @@
|
||||
|
||||
if (tileentitynote != null)
|
||||
{
|
||||
+ int old = tileentitynote.field_145879_a;
|
||||
tileentitynote.func_145877_a();
|
||||
+ if (old == tileentitynote.field_145879_a) return false;
|
||||
tileentitynote.func_145878_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);
|
||||
}
|
||||
|
||||
@@ -73,6 +75,11 @@
|
||||
|
||||
public boolean func_149696_a(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_)
|
||||
{
|
||||
+ int meta = p_149696_1_.func_72805_g(p_149696_2_, p_149696_3_, p_149696_4_);
|
||||
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, meta, p_149696_6_, p_149696_5_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
||||
+ p_149696_5_ = e.instrument.ordinal();
|
||||
+ p_149696_6_ = e.getVanillaNoteId();
|
||||
float f = (float)Math.pow(2.0D, (double)(p_149696_6_ - 12) / 12.0D);
|
||||
String s = "harp";
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
||||
@@ -7,6 +7,7 @@
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.MathHelper;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockOre extends Block
|
||||
@@ -51,34 +52,40 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
|
||||
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
|
||||
+ private Random rand = new Random();
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
|
||||
+ {
|
||||
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
|
||||
{
|
||||
int j1 = 0;
|
||||
|
||||
if (this == Blocks.field_150365_q)
|
||||
{
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 0, 2);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 0, 2);
|
||||
}
|
||||
else if (this == Blocks.field_150482_ag)
|
||||
{
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150412_bA)
|
||||
{
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150369_x)
|
||||
{
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
else if (this == Blocks.field_150449_bY)
|
||||
{
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
|
||||
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
|
||||
+ return j1;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public int func_149692_a(int p_149692_1_)
|
||||
@@ -1,52 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
||||
@@ -15,6 +15,8 @@
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class BlockPane extends Block
|
||||
{
|
||||
@@ -62,10 +64,10 @@
|
||||
|
||||
public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_)
|
||||
{
|
||||
- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1));
|
||||
- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1));
|
||||
- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_));
|
||||
- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_));
|
||||
+ boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH);
|
||||
+ boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH);
|
||||
+ boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST );
|
||||
+ boolean flag3 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ + 1, p_149743_3_, p_149743_4_, EAST );
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
|
||||
{
|
||||
@@ -117,10 +119,10 @@
|
||||
float f1 = 0.5625F;
|
||||
float f2 = 0.4375F;
|
||||
float f3 = 0.5625F;
|
||||
- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1));
|
||||
- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1));
|
||||
- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_));
|
||||
- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_));
|
||||
+ boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH);
|
||||
+ boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH);
|
||||
+ boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST );
|
||||
+ boolean flag3 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_, EAST );
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
|
||||
{
|
||||
@@ -186,4 +188,10 @@
|
||||
this.field_149761_L = p_149651_1_.func_94245_a(this.field_150101_M);
|
||||
this.field_150102_N = p_149651_1_.func_94245_a(this.field_150100_a);
|
||||
}
|
||||
+
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir)
|
||||
+ {
|
||||
+ return func_150098_a(world.func_147439_a(x, y, z)) ||
|
||||
+ world.isSideSolid(x, y, z, dir.getOpposite(), false);
|
||||
+ }
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -11,6 +11,7 @@
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
+import net.minecraft.server.management.PlayerManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityPiston;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -360,7 +361,8 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !(p_150080_0_ instanceof ITileEntityProvider);
|
||||
+ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.func_72805_g(p_150080_2_, p_150080_3_, p_150080_4_)));
|
||||
+
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,14 +377,14 @@
|
||||
{
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= p_150077_0_.func_72800_K())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = p_150077_0_.func_147439_a(i1, j1, k1);
|
||||
|
||||
- if (block.func_149688_o() != Material.field_151579_a)
|
||||
+ if (!block.isAir(p_150077_0_, i1, j1, k1))
|
||||
{
|
||||
if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true))
|
||||
{
|
||||
@@ -420,14 +422,14 @@
|
||||
{
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= p_150079_1_.func_72800_K())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = p_150079_1_.func_147439_a(i1, j1, k1);
|
||||
|
||||
- if (block.func_149688_o() != Material.field_151579_a)
|
||||
+ if (!block.isAir(p_150079_1_, i1, j1, k1))
|
||||
{
|
||||
if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true))
|
||||
{
|
||||
@@ -448,7 +450,9 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), 0);
|
||||
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
|
||||
+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f;
|
||||
+ block.func_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), chance, 0);
|
||||
p_150079_1_.func_147468_f(i1, j1, k1);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
+import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityPiston;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -90,15 +92,7 @@
|
||||
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- TileEntityPiston tileentitypiston = this.func_149963_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
|
||||
-
|
||||
- if (tileentitypiston != null)
|
||||
- {
|
||||
- tileentitypiston.func_145861_a().func_149697_b(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, tileentitypiston.func_145832_p(), 0);
|
||||
- }
|
||||
- }
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
}
|
||||
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -231,4 +225,13 @@
|
||||
{
|
||||
this.field_149761_L = p_149651_1_.func_94245_a("piston_top_normal");
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ TileEntityPiston te = this.func_149963_e(world, x, y, z);
|
||||
+ if (te != null)
|
||||
+ return te.func_145861_a().getDrops(world, x, y, z, te.func_145832_p(), 0);
|
||||
+ return new ArrayList<ItemStack>();
|
||||
+ }
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -46,14 +47,15 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- if (p_149690_5_ >= 7 && p_149690_1_.field_73012_v.nextInt(50) == 0)
|
||||
- {
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151170_bI));
|
||||
- }
|
||||
- }
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
+ if (metadata >= 7 && world.field_73012_v.nextInt(50) == 0)
|
||||
+ ret.add(new ItemStack(Items.field_151170_bI));
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
+ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
}
|
||||
|
||||
public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)
|
||||
@@ -1,208 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
@@ -5,6 +5,7 @@
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
+import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
public static final boolean func_150051_a(Block p_150051_0_)
|
||||
{
|
||||
- return p_150051_0_ == Blocks.field_150448_aq || p_150051_0_ == Blocks.field_150318_D || p_150051_0_ == Blocks.field_150319_E || p_150051_0_ == Blocks.field_150408_cc;
|
||||
+ return p_150051_0_ instanceof BlockRailBase;
|
||||
}
|
||||
|
||||
protected BlockRailBase(boolean p_i45389_1_)
|
||||
@@ -78,7 +79,7 @@
|
||||
|
||||
public int func_149645_b()
|
||||
{
|
||||
- return 9;
|
||||
+ return renderType;
|
||||
}
|
||||
|
||||
public int func_149745_a(Random p_149745_1_)
|
||||
@@ -193,6 +194,111 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z)
|
||||
+ {
|
||||
+ return !func_150050_e();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's metadata (without the power bit if the rail uses one).
|
||||
+ * Can be used to make the cart think the rail something other than it is,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * Valid rail metadata is defined as follows:
|
||||
+ * 0x0: flat track going North-South
|
||||
+ * 0x1: flat track going West-East
|
||||
+ * 0x2: track ascending to the East
|
||||
+ * 0x3: track ascending to the West
|
||||
+ * 0x4: track ascending to the North
|
||||
+ * 0x5: track ascending to the South
|
||||
+ * 0x6: WestNorth corner (connecting East and South)
|
||||
+ * 0x7: EastNorth corner (connecting West and South)
|
||||
+ * 0x8: EastSouth corner (connecting West and North)
|
||||
+ * 0x9: WestSouth corner (connecting East and North)
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @param y The rail X coordinate.
|
||||
+ * @param x The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return The metadata.
|
||||
+ */
|
||||
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)
|
||||
+ {
|
||||
+ int meta = world.func_72805_g(x, y, z);
|
||||
+ if(func_150050_e())
|
||||
+ {
|
||||
+ meta = meta & 7;
|
||||
+ }
|
||||
+ return meta;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
|
||||
+ {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param y The rail X coordinate.
|
||||
+ * @param x The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Moved render type to a field and a setter.
|
||||
+ * This allows for a mod to change the render type
|
||||
+ * for vanilla rails, and any mod rails that extend
|
||||
+ * this class.
|
||||
+ */
|
||||
+ private int renderType = 9;
|
||||
+
|
||||
+ public void setRenderType(int value)
|
||||
+ {
|
||||
+ renderType = value;
|
||||
+ }
|
||||
+ /* ======================================== FORGE END =====================================*/
|
||||
+
|
||||
public class Rail
|
||||
{
|
||||
private World field_150660_b;
|
||||
@@ -202,6 +308,7 @@
|
||||
private final boolean field_150656_f;
|
||||
private List field_150657_g = new ArrayList();
|
||||
private static final String __OBFID = "CL_00000196";
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_)
|
||||
{
|
||||
@@ -209,19 +316,10 @@
|
||||
this.field_150661_c = p_i45388_3_;
|
||||
this.field_150658_d = p_i45388_4_;
|
||||
this.field_150659_e = p_i45388_5_;
|
||||
- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
- int l = p_i45388_2_.func_72805_g(p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
-
|
||||
- if (((BlockRailBase)block).field_150053_a)
|
||||
- {
|
||||
- this.field_150656_f = true;
|
||||
- l &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.field_150656_f = false;
|
||||
- }
|
||||
-
|
||||
+ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
+ int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
+ this.field_150656_f = !block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
+ canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
this.func_150648_a(l);
|
||||
}
|
||||
|
||||
@@ -412,7 +510,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
|
||||
{
|
||||
@@ -425,7 +523,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
|
||||
{
|
||||
@@ -570,7 +668,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
|
||||
{
|
||||
@@ -583,7 +681,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
|
||||
{
|
||||
@@ -1,22 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
@@ -228,4 +228,19 @@
|
||||
{
|
||||
return new TileEntityComparator();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ)
|
||||
+ {
|
||||
+ if (y == tileY && world instanceof World)
|
||||
+ {
|
||||
+ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
@@ -10,6 +10,7 @@
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRedstoneOre extends Block
|
||||
@@ -88,12 +89,17 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
|
||||
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
|
||||
+ private Random rand = new Random();
|
||||
+ @Override // World, meta, fortune
|
||||
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
|
||||
+ {
|
||||
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
|
||||
{
|
||||
- int j1 = 1 + p_149690_1_.field_73012_v.nextInt(5);
|
||||
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
|
||||
+ return 1 + rand.nextInt(5);
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -405,7 +405,7 @@
|
||||
}
|
||||
else if (!Blocks.field_150413_aR.func_149907_e(block))
|
||||
{
|
||||
- return block.func_149744_f() && p_150174_4_ != -1;
|
||||
+ return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,47 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
|
||||
@@ -11,7 +11,11 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockReed extends Block
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+
|
||||
+public class BlockReed extends Block implements IPlantable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000300";
|
||||
|
||||
@@ -57,7 +61,7 @@
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
- return block == this ? true : (block != Blocks.field_150349_c && block != Blocks.field_150346_d && block != Blocks.field_150354_m ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h))));
|
||||
+ return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -120,4 +124,22 @@
|
||||
{
|
||||
return p_149720_1_.func_72807_a(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return EnumPlantType.Beach;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return world.func_72805_g(x, y, z);
|
||||
+ }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
|
||||
@@ -71,6 +71,7 @@
|
||||
|
||||
public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_)
|
||||
{
|
||||
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return;
|
||||
int l = p_149878_1_.func_72805_g(p_149878_2_, p_149878_3_, p_149878_4_) & 7;
|
||||
Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
|
||||
int i1 = 0;
|
||||
@@ -1,62 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -108,8 +109,6 @@
|
||||
return p_149692_1_;
|
||||
}
|
||||
|
||||
- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {}
|
||||
-
|
||||
public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
|
||||
{
|
||||
if (p_149681_6_.field_71075_bZ.field_75098_d)
|
||||
@@ -118,29 +117,38 @@
|
||||
p_149681_1_.func_72921_c(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4);
|
||||
}
|
||||
|
||||
+ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0);
|
||||
+
|
||||
super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
|
||||
}
|
||||
|
||||
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
- if (!p_149749_1_.field_72995_K)
|
||||
+ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
{
|
||||
if ((p_149749_6_ & 8) == 0)
|
||||
{
|
||||
ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_));
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
+ if (tileentityskull == null) return ret;
|
||||
+
|
||||
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_145907_c() != null && tileentityskull.func_145907_c().length() > 0)
|
||||
{
|
||||
itemstack.func_77982_d(new NBTTagCompound());
|
||||
itemstack.func_77978_p().func_74778_a("SkullOwner", tileentityskull.func_145907_c());
|
||||
}
|
||||
|
||||
- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack);
|
||||
+ ret.add(itemstack);
|
||||
}
|
||||
-
|
||||
- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
@@ -1,82 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
|
||||
@@ -73,7 +73,7 @@
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
}
|
||||
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -85,7 +85,6 @@
|
||||
{
|
||||
if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_))
|
||||
{
|
||||
- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.func_72805_g(p_150155_2_, p_150155_3_, p_150155_4_), 0);
|
||||
p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_);
|
||||
return false;
|
||||
}
|
||||
@@ -97,10 +96,8 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- int i1 = p_149636_6_ & 7;
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.field_151126_ay, i1 + 1, 0));
|
||||
+ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_);
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
}
|
||||
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
@@ -110,14 +107,13 @@
|
||||
|
||||
public int func_149745_a(Random p_149745_1_)
|
||||
{
|
||||
- return 0;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
|
||||
{
|
||||
if (p_149674_1_.func_72972_b(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11)
|
||||
{
|
||||
- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.func_72805_g(p_149674_2_, p_149674_3_, p_149674_4_), 0);
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
}
|
||||
@@ -127,4 +123,34 @@
|
||||
{
|
||||
return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand)
|
||||
+ * version in 1.1.
|
||||
+ *
|
||||
+ * @param meta Blocks Metadata
|
||||
+ * @param fortune Current item fortune level
|
||||
+ * @param random Random number generator
|
||||
+ * @return The number of items to drop
|
||||
+ */
|
||||
+ public int quantityDropped(int meta, int fortune, Random random)
|
||||
+ {
|
||||
+ return (meta & 7) + 1;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Determines if a new block can be replace the space occupied by this one,
|
||||
+ * Used in the player's placement code to make the block act like water, and lava.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x X Position
|
||||
+ * @param y Y position
|
||||
+ * @param z Z position
|
||||
+ * @return True if the block is replaceable by another block
|
||||
+ */
|
||||
+ public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ int meta = world.func_72805_g(x, y, z);
|
||||
+ return meta >= 7 ? false : field_149764_J.func_76222_j();
|
||||
+ }
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -14,6 +15,7 @@
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class BlockStem extends BlockBush implements IGrowable
|
||||
{
|
||||
@@ -101,7 +103,7 @@
|
||||
|
||||
Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1);
|
||||
|
||||
- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
+ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
{
|
||||
p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a);
|
||||
}
|
||||
@@ -144,11 +146,11 @@
|
||||
Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1);
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (block8 == Blocks.field_150458_ak)
|
||||
+ if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this))
|
||||
{
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (p_149875_1_.func_72805_g(l, p_149875_3_ - 1, i1) > 0)
|
||||
+ if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1))
|
||||
{
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -211,11 +213,12 @@
|
||||
return l < 7 ? -1 : (p_149873_1_.func_147439_a(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.func_147439_a(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1))));
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("unused")
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
+ if (false && !p_149690_1_.field_72995_K)
|
||||
{
|
||||
Item item = null;
|
||||
|
||||
@@ -282,4 +285,23 @@
|
||||
{
|
||||
this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
|
||||
}
|
||||
+
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+
|
||||
+ Item item = null;
|
||||
+ item = field_149877_a == Blocks.field_150423_aK ? Items.field_151080_bb : item;
|
||||
+ item = field_149877_a == Blocks.field_150440_ba ? Items.field_151081_bc : item;
|
||||
+
|
||||
+ for (int i = 0; item != null && i < 3; i++)
|
||||
+ {
|
||||
+ if (world.field_73012_v.nextInt(15) <= meta)
|
||||
+ ret.add(new ItemStack(item));
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -17,8 +18,10 @@
|
||||
import net.minecraft.world.ColorizerGrass;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockTallGrass extends BlockBush implements IGrowable
|
||||
+public class BlockTallGrass extends BlockBush implements IGrowable, IShearable
|
||||
{
|
||||
private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"};
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -53,7 +56,7 @@
|
||||
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
|
||||
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -71,7 +74,7 @@
|
||||
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
- return p_149650_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
|
||||
+ return null;
|
||||
}
|
||||
|
||||
public int func_149679_a(int p_149679_1_, Random p_149679_2_)
|
||||
@@ -81,13 +84,7 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150329_H, 1, p_149636_6_));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
@@ -143,4 +140,28 @@
|
||||
Blocks.field_150398_cm.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ if (world.field_73012_v.nextInt(8) != 0) return ret;
|
||||
+ ItemStack seed = ForgeHooks.getGrassSeed(world);
|
||||
+ if (seed != null) ret.add(seed);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z)));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
|
||||
@@ -10,6 +10,7 @@
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class BlockTorch extends Block
|
||||
{
|
||||
@@ -51,13 +52,17 @@
|
||||
else
|
||||
{
|
||||
Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_);
|
||||
- return block == Blocks.field_150422_aJ || block == Blocks.field_150386_bk || block == Blocks.field_150359_w || block == Blocks.field_150463_bK;
|
||||
+ return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_))));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH, true) ||
|
||||
+ func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
}
|
||||
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
@@ -69,22 +74,22 @@
|
||||
j1 = 5;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
|
||||
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
|
||||
{
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
|
||||
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
|
||||
{
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
|
||||
{
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -106,19 +111,19 @@
|
||||
{
|
||||
if (p_149726_1_.func_72805_g(p_149726_2_, p_149726_3_, p_149726_4_) == 0)
|
||||
{
|
||||
- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true))
|
||||
+ if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2);
|
||||
}
|
||||
- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true))
|
||||
+ else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2);
|
||||
}
|
||||
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true))
|
||||
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2);
|
||||
}
|
||||
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true))
|
||||
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2);
|
||||
}
|
||||
@@ -143,22 +148,22 @@
|
||||
int l = p_150108_1_.func_72805_g(p_150108_2_, p_150108_3_, p_150108_4_);
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
@@ -11,9 +11,12 @@
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockTrapDoor extends Block
|
||||
{
|
||||
+ /** Set this to allow trapdoors to remain free-floating */
|
||||
+ public static boolean disableValidation = false;
|
||||
private static final String __OBFID = "CL_00000327";
|
||||
|
||||
protected BlockTrapDoor(Material p_i45434_1_)
|
||||
@@ -163,7 +166,7 @@
|
||||
--i1;
|
||||
}
|
||||
|
||||
- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)))
|
||||
+ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2))))
|
||||
{
|
||||
p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_);
|
||||
this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0);
|
||||
@@ -218,6 +221,7 @@
|
||||
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
+ if (disableValidation) return true;
|
||||
if (p_149707_5_ == 0)
|
||||
{
|
||||
return false;
|
||||
@@ -248,7 +252,7 @@
|
||||
--p_149707_2_;
|
||||
}
|
||||
|
||||
- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_));
|
||||
+ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +263,7 @@
|
||||
|
||||
private static boolean func_150119_a(Block p_150119_0_)
|
||||
{
|
||||
+ if (disableValidation) return true;
|
||||
return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs;
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
@@ -9,6 +9,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockTripWireHook extends Block
|
||||
{
|
||||
private static final String __OBFID = "CL_00000329";
|
||||
@@ -47,34 +50,41 @@
|
||||
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
|
||||
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
|
||||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
|
||||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
|
||||
}
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
|
||||
}
|
||||
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
{
|
||||
byte b0 = 0;
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
|
||||
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
|
||||
{
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
|
||||
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
|
||||
{
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
|
||||
{
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
@@ -97,22 +107,22 @@
|
||||
int i1 = l & 3;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -133,7 +143,7 @@
|
||||
boolean flag3 = (p_150136_6_ & 8) == 8;
|
||||
boolean flag4 = !p_150136_5_;
|
||||
boolean flag5 = false;
|
||||
- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_);
|
||||
+ boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP);
|
||||
int l1 = Direction.field_71583_a[k1];
|
||||
int i2 = Direction.field_71581_b[k1];
|
||||
int j2 = 0;
|
||||
@@ -1,61 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
+import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -16,8 +18,10 @@
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockVine extends Block
|
||||
+public class BlockVine extends Block implements IShearable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000330";
|
||||
|
||||
@@ -375,14 +379,28 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150395_bd, 1, 0));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(this, 1));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,288 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -135,6 +135,14 @@
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
import net.minecraft.world.storage.ISaveHandler;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.GuiIngameForge;
|
||||
+import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.ForgeEventFactory;
|
||||
+import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
+import net.minecraftforge.event.world.WorldEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.LWJGLException;
|
||||
@@ -246,7 +254,7 @@
|
||||
this.func_71389_H();
|
||||
this.field_71449_j = p_i1014_1_;
|
||||
field_147123_G.info("Setting user: " + p_i1014_1_.func_111285_a());
|
||||
- field_147123_G.info("(Session ID is " + p_i1014_1_.func_111286_b() + ")");
|
||||
+ //logger.info("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid...
|
||||
this.field_71459_aj = p_i1014_5_;
|
||||
this.field_71443_c = p_i1014_2_;
|
||||
this.field_71440_d = p_i1014_3_;
|
||||
@@ -419,7 +427,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
- Display.create((new PixelFormat()).withDepthBits(24));
|
||||
+ ForgeHooksClient.createDisplay();
|
||||
}
|
||||
catch (LWJGLException lwjglexception)
|
||||
{
|
||||
@@ -518,7 +526,7 @@
|
||||
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
|
||||
FMLClientHandler.instance().finishMinecraftLoading();
|
||||
this.func_71361_d("Post startup");
|
||||
- this.field_71456_v = new GuiIngame(this);
|
||||
+ this.field_71456_v = new GuiIngameForge(this);
|
||||
|
||||
if (this.field_71475_ae != null)
|
||||
{
|
||||
@@ -701,11 +709,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();
|
||||
@@ -715,6 +718,17 @@
|
||||
p_147108_1_ = new GuiGameOver();
|
||||
}
|
||||
|
||||
+ GuiScreen old = this.field_71462_r;
|
||||
+ GuiOpenEvent event = new GuiOpenEvent(p_147108_1_);
|
||||
+
|
||||
+ if (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;
|
||||
@@ -1296,7 +1310,7 @@
|
||||
|
||||
if (this.field_71439_g.func_82246_f(i, j, k))
|
||||
{
|
||||
- this.field_71452_i.func_78867_a(i, j, k, this.field_71476_x.field_72310_e);
|
||||
+ this.field_71452_i.addBlockHitEffects(i, j, k, this.field_71476_x);
|
||||
this.field_71439_g.func_71038_i();
|
||||
}
|
||||
}
|
||||
@@ -1377,11 +1391,12 @@
|
||||
int j = this.field_71476_x.field_72312_c;
|
||||
int k = this.field_71476_x.field_72309_d;
|
||||
|
||||
- if (this.field_71441_e.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a)
|
||||
+ if (!this.field_71441_e.func_147439_a(i, j, k).isAir(field_71441_e, i, j, k))
|
||||
{
|
||||
int l = itemstack != null ? itemstack.field_77994_a : 0;
|
||||
|
||||
- if (this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_BLOCK, i, j, k, this.field_71476_x.field_72310_e, this.field_71441_e).isCanceled();
|
||||
+ if (result && this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
|
||||
{
|
||||
flag = false;
|
||||
this.field_71439_g.func_71038_i();
|
||||
@@ -1408,7 +1423,8 @@
|
||||
{
|
||||
ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g();
|
||||
|
||||
- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, this.field_71441_e).isCanceled();
|
||||
+ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
|
||||
{
|
||||
this.field_71460_t.field_78516_c.func_78445_c();
|
||||
}
|
||||
@@ -1607,6 +1623,8 @@
|
||||
|
||||
while (Mouse.next())
|
||||
{
|
||||
+ if (ForgeHooksClient.postMouseEvent()) continue;
|
||||
+
|
||||
i = Mouse.getEventButton();
|
||||
|
||||
if (field_142025_a && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157)))
|
||||
@@ -2080,6 +2098,11 @@
|
||||
|
||||
public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_)
|
||||
{
|
||||
+ if (field_71441_e != null)
|
||||
+ {
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(field_71441_e));
|
||||
+ }
|
||||
+
|
||||
if (p_71353_1_ == null)
|
||||
{
|
||||
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
|
||||
@@ -2092,6 +2115,18 @@
|
||||
if (this.field_71437_Z != null)
|
||||
{
|
||||
this.field_71437_Z.func_71263_m();
|
||||
+ if (field_71461_s != null)
|
||||
+ {
|
||||
+ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal"));
|
||||
+ }
|
||||
+ while (!field_71437_Z.func_71241_aa())
|
||||
+ {
|
||||
+ try
|
||||
+ {
|
||||
+ Thread.sleep(10);
|
||||
+ }
|
||||
+ catch (InterruptedException ie) {}
|
||||
+ }
|
||||
}
|
||||
|
||||
this.field_71437_Z = null;
|
||||
@@ -2240,113 +2275,10 @@
|
||||
if (this.field_71476_x != null)
|
||||
{
|
||||
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
|
||||
- int i = 0;
|
||||
- boolean flag1 = false;
|
||||
- Item item;
|
||||
int j;
|
||||
|
||||
- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
- {
|
||||
- j = this.field_71476_x.field_72311_b;
|
||||
- int k = this.field_71476_x.field_72312_c;
|
||||
- int l = this.field_71476_x.field_72309_d;
|
||||
- Block block = this.field_71441_e.func_147439_a(j, k, l);
|
||||
-
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- item = block.func_149694_d(this.field_71441_e, j, k, l);
|
||||
-
|
||||
- if (item == null)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- flag1 = item.func_77614_k();
|
||||
- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block;
|
||||
- i = block1.func_149643_k(this.field_71441_e, j, k, l);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (this.field_71476_x.field_72313_a != MovingObjectPosition.MovingObjectType.ENTITY || this.field_71476_x.field_72308_g == null || !flag)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (this.field_71476_x.field_72308_g instanceof EntityPainting)
|
||||
- {
|
||||
- item = Items.field_151159_an;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot)
|
||||
- {
|
||||
- item = Items.field_151058_ca;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame)
|
||||
- {
|
||||
- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
|
||||
- ItemStack itemstack = entityitemframe.func_82335_i();
|
||||
-
|
||||
- if (itemstack == null)
|
||||
- {
|
||||
- item = Items.field_151160_bD;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- item = itemstack.func_77973_b();
|
||||
- i = itemstack.func_77960_j();
|
||||
- flag1 = true;
|
||||
- }
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityMinecart)
|
||||
- {
|
||||
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
|
||||
-
|
||||
- if (entityminecart.func_94087_l() == 2)
|
||||
- {
|
||||
- item = Items.field_151109_aJ;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 1)
|
||||
- {
|
||||
- item = Items.field_151108_aI;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 3)
|
||||
- {
|
||||
- item = Items.field_151142_bV;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 5)
|
||||
- {
|
||||
- item = Items.field_151140_bW;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 6)
|
||||
- {
|
||||
- item = Items.field_151095_cc;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- item = Items.field_151143_au;
|
||||
- }
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityBoat)
|
||||
- {
|
||||
- item = Items.field_151124_az;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- item = Items.field_151063_bx;
|
||||
- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g);
|
||||
- flag1 = true;
|
||||
-
|
||||
- if (i <= 0 || !EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.field_71439_g.field_71071_by.func_146030_a(item, i, flag1, flag);
|
||||
-
|
||||
+ if (!ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
|
||||
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
|
||||
if (flag)
|
||||
{
|
||||
j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c;
|
||||
@@ -2513,8 +2445,15 @@
|
||||
p_70001_1_.func_76472_a("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);
|
||||
@@ -2522,6 +2461,7 @@
|
||||
|
||||
if (j != 0)
|
||||
{
|
||||
+ max_texture_size = i;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
@@ -35,6 +35,10 @@
|
||||
import paulscode.sound.codecs.CodecJOrbis;
|
||||
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
|
||||
|
||||
+import net.minecraftforge.client.*;
|
||||
+import net.minecraftforge.client.event.sound.*;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class SoundManager
|
||||
{
|
||||
@@ -69,6 +73,7 @@
|
||||
{
|
||||
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
|
||||
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
|
||||
+ MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this));
|
||||
}
|
||||
catch (SoundSystemException soundsystemexception)
|
||||
{
|
||||
@@ -80,6 +85,7 @@
|
||||
{
|
||||
this.func_148613_b();
|
||||
this.func_148608_i();
|
||||
+ MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this));
|
||||
}
|
||||
|
||||
private synchronized void func_148608_i()
|
||||
@@ -302,6 +308,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ p_148611_1_ = ForgeHooksClient.playSound(this, p_148611_1_);
|
||||
+ if (p_148611_1_ == null) return;
|
||||
+
|
||||
SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b());
|
||||
|
||||
if (soundeventaccessorcomposite == null)
|
||||
@@ -343,10 +352,12 @@
|
||||
if (soundpoolentry.func_148648_d())
|
||||
{
|
||||
this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, p_148611_1_, s));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, p_148611_1_, s));
|
||||
}
|
||||
|
||||
field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.func_148652_a(), soundeventaccessorcomposite.func_148729_c(), s});
|
||||
@@ -1,12 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
|
||||
@@ -151,7 +151,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- public float func_70047_e()
|
||||
+ @Override
|
||||
+ public float getDefaultEyeHeight()
|
||||
{
|
||||
return 1.82F;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
@@ -50,6 +50,9 @@
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Session;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EntityPlayerSP extends AbstractClientPlayer
|
||||
@@ -325,7 +328,7 @@
|
||||
f *= 1.0F - f1 * 0.15F;
|
||||
}
|
||||
|
||||
- return f;
|
||||
+ return ForgeHooksClient.getOffsetFOV(this, f);
|
||||
}
|
||||
|
||||
public void func_71053_j()
|
||||
@@ -479,20 +482,45 @@
|
||||
return this.field_70170_p.func_147439_a(p_71153_1_, p_71153_2_, p_71153_3_).func_149721_r();
|
||||
}
|
||||
|
||||
+ private boolean isHeadspaceFree(int x, int y, int z, int height)
|
||||
+ {
|
||||
+ for (int i1 = 0; i1 < height; i1++)
|
||||
+ {
|
||||
+ if (func_71153_f(x, y + i1, z + 1)) return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
|
||||
{
|
||||
+ if (this.field_70145_X)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
int i = MathHelper.func_76128_c(p_145771_1_);
|
||||
int j = MathHelper.func_76128_c(p_145771_3_);
|
||||
int k = MathHelper.func_76128_c(p_145771_5_);
|
||||
double d3 = p_145771_1_ - (double)i;
|
||||
double d4 = p_145771_5_ - (double)k;
|
||||
|
||||
- if (this.func_71153_f(i, j, k) || this.func_71153_f(i, j + 1, k))
|
||||
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
|
||||
+
|
||||
+ boolean inTranslucentBlock = true;
|
||||
+
|
||||
+ for (int i1 = 0; i1 < entHeight; i1++)
|
||||
{
|
||||
- boolean flag = !this.func_71153_f(i - 1, j, k) && !this.func_71153_f(i - 1, j + 1, k);
|
||||
- boolean flag1 = !this.func_71153_f(i + 1, j, k) && !this.func_71153_f(i + 1, j + 1, k);
|
||||
- boolean flag2 = !this.func_71153_f(i, j, k - 1) && !this.func_71153_f(i, j + 1, k - 1);
|
||||
- boolean flag3 = !this.func_71153_f(i, j, k + 1) && !this.func_71153_f(i, j + 1, k + 1);
|
||||
+ if (!this.func_71153_f(i, j + i1, k))
|
||||
+ {
|
||||
+ inTranslucentBlock = false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (inTranslucentBlock)
|
||||
+ {
|
||||
+ boolean flag = !isHeadspaceFree(i - 1, j, k, entHeight);
|
||||
+ boolean flag1 = !isHeadspaceFree(i + 1, j, k, entHeight);
|
||||
+ boolean flag2 = !isHeadspaceFree(i, j, k - 1, entHeight);
|
||||
+ boolean flag3 = !isHeadspaceFree(i, j, k + 1, entHeight);
|
||||
byte b0 = -1;
|
||||
double d5 = 9999.0D;
|
||||
|
||||
@@ -576,6 +604,12 @@
|
||||
|
||||
public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_)
|
||||
{
|
||||
+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, p_85030_1_, p_85030_2_, p_85030_3_);
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ p_85030_1_ = event.name;
|
||||
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u - (double)this.field_70129_M, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.client.gui;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
+import com.google.common.collect.ObjectArrays;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.io.File;
|
||||
@@ -24,6 +25,7 @@
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
+import net.minecraftforge.client.ClientCommandHandler;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
@@ -131,6 +133,7 @@
|
||||
public void func_146403_a(String p_146403_1_)
|
||||
{
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_146403_1_);
|
||||
+ if (ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_146403_1_) == 1) return;
|
||||
this.field_146297_k.field_71439_g.func_71165_d(p_146403_1_);
|
||||
}
|
||||
|
||||
@@ -305,13 +308,14 @@
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1);
|
||||
}
|
||||
|
||||
- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++));
|
||||
+ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++)));
|
||||
}
|
||||
|
||||
private void func_146405_a(String p_146405_1_, String p_146405_2_)
|
||||
{
|
||||
if (p_146405_1_.length() >= 1)
|
||||
{
|
||||
+ ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
|
||||
this.field_146297_k.field_71439_g.field_71174_a.func_147297_a(new C14PacketTabComplete(p_146405_1_));
|
||||
this.field_146414_r = true;
|
||||
}
|
||||
@@ -433,6 +437,13 @@
|
||||
String[] astring1 = p_146406_1_;
|
||||
int i = p_146406_1_.length;
|
||||
|
||||
+ String[] complete = ClientCommandHandler.instance.latestAutoComplete;
|
||||
+ if (complete != null)
|
||||
+ {
|
||||
+ astring1 = ObjectArrays.concat(complete, astring1, String.class);
|
||||
+ i = astring1.length;
|
||||
+ }
|
||||
+
|
||||
for (int j = 0; j < i; ++j)
|
||||
{
|
||||
String s = astring1[j];
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -320,7 +320,7 @@
|
||||
}
|
||||
else if (p_146284_1_.field_146127_k == 8)
|
||||
{
|
||||
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
|
||||
+ WorldType.field_77139_a[field_146331_K].onCustomizeButton(field_146297_k, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,7 +338,7 @@
|
||||
this.field_146326_C.field_146125_m = this.field_146344_y;
|
||||
this.field_146320_D.field_146125_m = this.field_146344_y;
|
||||
this.field_146321_E.field_146125_m = this.field_146344_y;
|
||||
- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c;
|
||||
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
|
||||
|
||||
if (this.field_146344_y)
|
||||
{
|
||||
Loaded 100 of 474 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user