Compare commits

..
2 Commits
Author SHA1 Message Date
Space Toad eac172d806 merged with trunk 2012-01-15 23:44:46 +00:00
Space Toad dbd6af437c tagged 1.3.0 2012-01-15 19:29:54 +00:00
58 changed files with 1133 additions and 1652 deletions

No files matched your search

+5 -9
View File
@@ -1,15 +1,11 @@
@cd ..
cd ..
@rmdir /S /Q src
@mkdir src
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
@cd forge
@cmd /C inject_version.bat ../src/minecraft/net/minecraft/src/forge/ForgeHooks.java
@cmd /C inject_version.bat ../src/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
@cd ..
@echo | call recompile.bat
cmd /C recompile.bat
-5
View File
@@ -10,11 +10,6 @@ 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/
cd forge
./inject_version.sh ../src_forge/minecraft/net/minecraft/src/forge/ForgeHooks.java
./inject_version.sh ../src_forge/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
cd ..
cp -a src_forge src
./recompile.sh
+329 -329
View File
File diff suppressed because it is too large. Load diff
+332 -332
View File
File diff suppressed because it is too large. Load diff
@@ -1,123 +0,0 @@
package net.minecraft.src.forge;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.src.GameSettings;
import net.minecraft.src.GuiControls;
import net.minecraft.src.GuiSlot;
import net.minecraft.src.KeyBinding;
import net.minecraft.src.Tessellator;
public class GuiControlsScrollPanel extends GuiSlot
{
private GuiControls controls;
private GameSettings options;
private Minecraft mc;
private String[] message;
private int mouseX;
private int mouseY;
private int selected = -1;
public GuiControlsScrollPanel(GuiControls controls, GameSettings options, Minecraft mc)
{
super(mc, controls.width, controls.height, 16, (controls.height - 32) + 4, 25);
this.controls = controls;
this.options = options;
this.mc = mc;
}
@Override
protected int getSize() {
return options.keyBindings.length;
}
@Override
protected void elementClicked(int i, boolean flag)
{
if (!flag)
{
if (selected == -1)
{
selected = i;
}
else
{
options.setKeyBinding(selected, -100);
selected = -1;
KeyBinding.resetKeyBindingArrayAndHash();
}
}
}
@Override
protected boolean isSelected(int i)
{
return false;
}
@Override
protected void drawBackground() {}
@Override
public void drawScreen(int mX, int mY, float f)
{
mouseX = mX;
mouseY = mY;
if (selected != -1 && !Mouse.isButtonDown(0) && Mouse.getDWheel() == 0)
{
if (Mouse.next() && Mouse.getEventButtonState())
{
System.out.println(Mouse.getEventButton());
options.setKeyBinding(selected, -100 + Mouse.getEventButton());
selected = -1;
KeyBinding.resetKeyBindingArrayAndHash();
}
}
super.drawScreen(mX, mY, f);
}
@Override
protected void drawSlot(int index, int xPosition, int yPosition, int l, Tessellator tessellator)
{
int width = 70;
int height = 20;
xPosition -= 20;
boolean flag = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = (flag ? 2 : 1);
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/gui.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
controls.drawTexturedModalRect(xPosition, yPosition, 0, 46 + k * 20, width / 2, height);
controls.drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 46 + k * 20, width / 2, height);
controls.drawString(mc.fontRenderer, options.getKeyBindingDescription(index), xPosition + width + 4, yPosition + 6, 0xFFFFFFFF);
boolean conflict = false;
for (int x = 0; x < options.keyBindings.length; x++)
{
if (x != index && options.keyBindings[x].keyCode == options.keyBindings[index].keyCode)
{
conflict = true;
break;
}
}
String str = (conflict ? "\247c" : "") + options.getOptionDisplayString(index);
str = (index == selected ? "\247f> \247e??? \247f<" : str);
controls.drawCenteredString(mc.fontRenderer, str, xPosition + (width / 2), yPosition + (height - 8) / 2, 0xFFFFFFFF);
}
public boolean keyTyped(char c, int i)
{
if (selected != -1)
{
options.setKeyBinding(selected, i);
selected = -1;
KeyBinding.resetKeyBindingArrayAndHash();
return false;
}
return true;
}
}
@@ -300,13 +300,12 @@ public class ForgeHooks {
}
public static final int majorVersion=0;
public static final int minorVersion=0;
public static final int majorVersion=1;
public static final int minorVersion=3;
public static final int revisionVersion=0;
public static final int buildVersion=0;
static {
System.out.printf("MinecraftForge v%d.%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion, buildVersion);
ModLoader.getLogger().info(String.format("MinecraftForge v%d.%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion, buildVersion));
System.out.printf("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion);
ModLoader.getLogger().info(String.format("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion));
}
static boolean toolInit=false;
@@ -699,15 +699,7 @@ public class MinecraftForge {
*/
public static Class<? extends EntityMinecart> getCartClassForItem(ItemStack item)
{
MinecartKey k = null;
for (ItemStack key : minecartForItem.keySet())
{
if (key.isItemEqual(item))
{
k = minecartForItem.get(k);
break;
}
}
MinecartKey k = minecartForItem.get(item);
if(k != null)
{
return k.minecart;
@@ -724,15 +716,7 @@ public class MinecraftForge {
*/
public static int getCartTypeForItem(ItemStack item)
{
MinecartKey k = null;
for (ItemStack key : minecartForItem.keySet())
{
if (key.isItemEqual(item))
{
k = minecartForItem.get(k);
break;
}
}
MinecartKey k = minecartForItem.get(item);
if(k != null)
{
return k.type;
-20
View File
@@ -1,20 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
FOR /F "tokens=1-4" %%A IN (version.txt) DO (
set major=%%A
set minor=%%B
set revision=%%C
set build=%%D
)
set file=%*
echo Injecting Revision !major!.!minor!.!revision!.!build! %file%
set PATH=.\bin;%PATH%
sed s/majorVersion=0/majorVersion=!major!/ <!file! | ^
sed s/minorVersion=0/minorVersion=!minor!/ | ^
sed s/revisionVersion=0/revisionVersion=!revision!/ | ^
sed s/buildVersion=0/buildVersion=!build!/ | ^
tr -d '\r' >!file!.tmp
mv "!file!.tmp" "!file!"
-14
View File
@@ -1,14 +0,0 @@
#!/bin/bash
target=$1
read major minor rev build <version.txt
echo Injecting Revision $major.$minor.$rev.$build $target
sed s/majorVersion=0/majorVersion=$major/ <$target | \
sed s/minorVersion=0/minorVersion=$minor/ | \
sed s/revisionVersion=0/revisionVersion=$rev/ | \
sed s/buildVersion=0/buildVersion=$build/ | \
tr -d '\r' > $target.tmp
mv $target.tmp $target
+4 -7
View File
@@ -3,16 +3,14 @@ echo off
echo MinecraftForge Windows Setup Program
echo:
@set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32
pushd .. >nul
xcopy /Y /E /I forge\conf\* conf
if exist runtime\bin\fernflower.jar move runtime\bin\fernflower.jar runtime\bin\fernflower.jar-backup
echo | call cleanup.bat
echo | call decompile.bat
cmd /C cleanup.bat
cmd /C decompile.bat
if exist runtime\bin\fernflower.jar-backup move runtime\bin\fernflower.jar-backup runtime\bin\fernflower.jar
@@ -51,7 +49,6 @@ popd >nul
xcopy /Y /E forge\src\* src
rem Removed until MCP's Update Names is fixed
rem cmd /C updatemcp.bat
rem cmd /C updatenames.bat
cmd /C updatemcp.bat
cmd /C updatenames.bat
cmd /C updatemd5.bat
+3 -3
View File
@@ -53,7 +53,7 @@ popd > /dev/null
cp -r forge/src/* src
# Removed until MCP's UpdateNames Is fixed
#./updatemcp.sh
#./updatenames.sh
./updatemcp.sh
./updatenames.sh
./updatemd5.sh
+6 -12
View File
@@ -1,11 +1,10 @@
read major minor revision build <version.txt
version=$major.$minor.$revision.$build
version=$1
build_dir=`pwd`
dir=`pwd`/../forge-$version
function remove_svn () {
(
cd "$1"
cd $1
if [ -d .svn ]; then
rm -rf .svn
@@ -25,7 +24,7 @@ function package_all () {
cp $build_dir/minecraftforge_credits.txt .
zip -r "$dir/minecraftforge$qual-$version.zip" \
zip -r $dir/minecraftforge$qual-$version.zip \
minecraftforge_credits.txt \
*.class \
forge
@@ -35,8 +34,8 @@ cd ../reobf
remove_svn .
rm -rf "$dir"
mkdir "$dir"
rm -rf $dir
mkdir $dir
cd minecraft
package_all "-client"
@@ -72,11 +71,6 @@ cp ../install/README.txt .
cp ../minecraftforge_credits.txt .
cp -r ../doc .
cd ..
sh inject_version.sh forge/src/minecraft/net/minecraft/src/forge/ForgeHooks.java
sh inject_version.sh forge/src/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
cd forge
cd src
remove_svn .
cd ../patches
@@ -87,5 +81,5 @@ cd ..
cd ..
zip -r "$dir/minecraftforge-src-$version.zip" forge
zip -r $dir/minecraftforge-src-$version.zip forge
rm -rf forge
@@ -17,16 +17,17 @@
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
{
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
- if (world.isRemote)
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (meta == 7)
{
- if (world.multiplayerWorld)
- {
- return;
+ ret.add(new ItemStack(Item.wheat));
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (meta == 7)
+ {
+ ret.add(new ItemStack(Item.wheat));
}
- int j1 = 3 + i1;
- for (int k1 = 0; k1 < j1; k1++)
+
+
+ for (int n = 0; n < 3 + fortune; n++)
{
- if (world.rand.nextInt(15) <= l)
@@ -25,20 +25,24 @@
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
@@ -67,7 +66,9 @@
@@ -67,11 +66,9 @@
public void updateTick(World world, int i, int j, int k, Random random)
{
- boolean flag = world.getBlockId(i, j - 1, k) == Block.netherrack.blockID;
- if ((world.worldProvider instanceof WorldProviderEnd) && world.getBlockId(i, j - 1, k) == Block.bedrock.blockID)
- {
- flag = true;
- }
+ Block base = Block.blocksList[world.getBlockId(i, j - 1, k)];
+ boolean flag = (base != null && base.isFireSource(world, i, j - 1, k, world.getBlockMetadata(i, j - 1, k), 0));
+
if ((world.worldProvider instanceof WorldProviderEnd) && world.getBlockId(i, j - 1, k) == Block.bedrock.blockID)
+
if (!canPlaceBlockAt(world, i, j, k))
{
flag = true;
@@ -89,23 +90,23 @@
world.setBlockWithNotify(i, j, k, 0);
@@ -89,23 +86,23 @@
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
if (!flag && !canNeighborBurn(world, i, j, k))
if (!flag && !func_263_h(world, i, j, k))
{
- if (!world.isBlockNormalCube(i, j - 1, k) || l > 3)
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) || l > 3)
@@ -68,7 +72,7 @@
for (int i1 = i - 1; i1 <= i + 1; i1++)
{
for (int j1 = k - 1; j1 <= k + 1; j1++)
@@ -142,9 +143,24 @@
@@ -142,9 +139,24 @@
}
}
@@ -94,9 +98,9 @@
if (random.nextInt(l) < j1)
{
boolean flag = world.getBlockId(i, j, k) == Block.tnt.blockID;
@@ -170,27 +186,27 @@
@@ -170,27 +182,27 @@
private boolean canNeighborBurn(World world, int i, int j, int k)
private boolean func_263_h(World world, int i, int j, int k)
{
- if (canBlockCatchFire(world, i + 1, j, k))
+ if (canBlockCatchFire(world, i + 1, j, k, 4))
@@ -128,7 +132,7 @@
}
private int getChanceOfNeighborsEncouragingFire(World world, int i, int j, int k)
@@ -202,12 +218,12 @@
@@ -202,12 +214,12 @@
}
else
{
@@ -147,7 +151,7 @@
return l;
}
}
@@ -217,32 +233,32 @@
@@ -217,32 +229,32 @@
return false;
}
@@ -160,7 +164,8 @@
- return chanceToEncourageFire[iblockaccess.getBlockId(i, j, k)] > 0;
+ return canBlockCatchFire(iblockaccess, i, j, k, 0);
}
-
+
+ /**
+ * Deprecated for a side-sensitive version
+ */
@@ -176,41 +181,41 @@
- {
- return l;
- }
+ return getChanceToEncourageFire(world, i, j, k, l, 0);
+ return getChanceToEncourageFire(world, i, j, k, l, 0);
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
- return world.isBlockNormalCube(i, j - 1, k) || canNeighborBurn(world, i, j, k);
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || canNeighborBurn(world, i, j, k);
- return world.isBlockNormalCube(i, j - 1, k) || func_263_h(world, i, j, k);
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || func_263_h(world, i, j, k);
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
- if (!world.isBlockNormalCube(i, j - 1, k) && !func_263_h(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !func_263_h(world, i, j, k))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -259,7 +275,7 @@
@@ -259,7 +271,7 @@
{
return;
}
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
- if (!world.isBlockNormalCube(i, j - 1, k) && !func_263_h(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !func_263_h(world, i, j, k))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -277,7 +293,7 @@
@@ -277,7 +289,7 @@
{
world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, "fire.fire", 1.0F + random.nextFloat(), random.nextFloat() * 0.7F + 0.3F);
}
- if (world.isBlockNormalCube(i, j - 1, k) || Block.fire.canBlockCatchFire(world, i, j - 1, k))
+ if (world.isBlockSolidOnSide(i, j - 1, k, 1) || Block.fire.canBlockCatchFire(world, i, j - 1, k, 1))
+ if (world.isBlockSolidOnSide(i, j - 1, k, 1) || Block.fire.canBlockCatchFire(world, i, j - 1, k))
{
for (int l = 0; l < 3; l++)
{
@@ -289,7 +305,7 @@
@@ -289,7 +301,7 @@
}
else
{
@@ -219,7 +224,7 @@
{
for (int i1 = 0; i1 < 2; i1++)
{
@@ -299,7 +315,7 @@
@@ -299,7 +311,7 @@
world.spawnParticle("largesmoke", f1, f7, f13, 0.0D, 0.0D, 0.0D);
}
}
@@ -228,7 +233,7 @@
{
for (int j1 = 0; j1 < 2; j1++)
{
@@ -309,7 +325,7 @@
@@ -309,7 +321,7 @@
world.spawnParticle("largesmoke", f2, f8, f14, 0.0D, 0.0D, 0.0D);
}
}
@@ -237,7 +242,7 @@
{
for (int k1 = 0; k1 < 2; k1++)
{
@@ -319,7 +335,7 @@
@@ -319,7 +331,7 @@
world.spawnParticle("largesmoke", f3, f9, f15, 0.0D, 0.0D, 0.0D);
}
}
@@ -246,7 +251,7 @@
{
for (int l1 = 0; l1 < 2; l1++)
{
@@ -329,7 +345,7 @@
@@ -329,7 +341,7 @@
world.spawnParticle("largesmoke", f4, f10, f16, 0.0D, 0.0D, 0.0D);
}
}
@@ -255,7 +260,7 @@
{
for (int i2 = 0; i2 < 2; i2++)
{
@@ -341,4 +357,39 @@
@@ -341,4 +353,41 @@
}
}
}
@@ -279,6 +284,7 @@
+ public int getChanceToEncourageFire(World world, int i, int j, int k, int l, int face)
+ {
+ int i1 = 0;
+
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ if (block != null)
+ {
@@ -293,5 +299,6 @@
+ {
+ return l;
+ }
+ }
+ }
+
}
@@ -7,7 +7,7 @@
import java.util.Random;
public class BlockNetherStalk extends BlockFlower
@@ -57,25 +58,24 @@
@@ -57,25 +58,25 @@
return 6;
}
@@ -15,11 +15,11 @@
+ @Override
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
{
- if (world.isRemote)
- if (world.multiplayerWorld)
- {
- return;
- }
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
int j1 = 1;
- if (l >= 3)
+ if (meta >= 3)
@@ -37,6 +37,7 @@
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
+ ret.add(new ItemStack(Item.netherStalkSeeds));
}
+
+ return ret;
}
@@ -1,14 +1,6 @@
--- ../src_base/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
@@ -63,7 +63,6 @@
{
if (!canPlaceBlockAt(world, i, j, k))
{
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
return false;
}
@@ -75,15 +74,7 @@
@@ -75,15 +75,7 @@
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
@@ -25,7 +17,7 @@
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
}
@@ -94,14 +85,13 @@
@@ -94,7 +86,7 @@
public int quantityDropped(Random random)
{
@@ -34,10 +26,3 @@
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if (world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11)
{
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
@@ -50,4 +50,4 @@
+
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
if (!world.multiplayerWorld && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
@@ -4,7 +4,7 @@
private boolean canPlaceTorchOn(World world, int i, int j, int k)
{
- if (world.isBlockNormalCubeDefault(i, j, k, true))
- if (world.func_41082_b(i, j, k, true))
+ if (world.isBlockSolidOnSide(i, j, k, 1))
{
return true;
@@ -13,22 +13,22 @@
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
- if (world.func_41082_b(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
return true;
}
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
- if (world.func_41082_b(i + 1, j, k, true))
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
return true;
}
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
- if (world.func_41082_b(i, j, k - 1, true))
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
return true;
}
- if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
- if (world.func_41082_b(i, j, k + 1, true))
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
{
return true;
@@ -37,22 +37,22 @@
{
i1 = 5;
}
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
- if (l == 2 && world.func_41082_b(i, j, k + 1, true))
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
{
i1 = 4;
}
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
- if (l == 3 && world.func_41082_b(i, j, k - 1, true))
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
{
i1 = 3;
}
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
- if (l == 4 && world.func_41082_b(i + 1, j, k, true))
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
{
i1 = 2;
}
- if (l == 5 && world.isBlockNormalCubeDefault(i - 1, j, k, true))
- if (l == 5 && world.func_41082_b(i - 1, j, k, true))
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
{
i1 = 1;
@@ -61,22 +61,22 @@
public void onBlockAdded(World world, int i, int j, int k)
{
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
- if (world.func_41082_b(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
world.setBlockMetadataWithNotify(i, j, k, 1);
}
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
- else if (world.func_41082_b(i + 1, j, k, true))
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
- else if (world.func_41082_b(i, j, k - 1, true))
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
- else if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
- else if (world.func_41082_b(i, j, k + 1, true))
+ else if (world.isBlockSolidOnSide(i, j, k + 1, 2))
{
world.setBlockMetadataWithNotify(i, j, k, 4);
@@ -85,22 +85,22 @@
{
int i1 = world.getBlockMetadata(i, j, k);
boolean flag = false;
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
- if (!world.func_41082_b(i - 1, j, k, true) && i1 == 1)
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
{
flag = true;
}
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
- if (!world.func_41082_b(i + 1, j, k, true) && i1 == 2)
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
{
flag = true;
}
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
- if (!world.func_41082_b(i, j, k - 1, true) && i1 == 3)
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
{
flag = true;
}
- if (!world.isBlockNormalCubeDefault(i, j, k + 1, true) && i1 == 4)
- if (!world.func_41082_b(i, j, k + 1, true) && i1 == 4)
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
{
flag = true;
@@ -14,8 +14,8 @@
{
j1--;
}
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
+ if (!(isValidSupportBlock(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
- if (!func_41052_f(world.getBlockId(j1, j, k1)))
+ if (!(func_41052_f(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
{
world.setBlockWithNotify(i, j, k, 0);
dropBlockAsItem(world, i, j, k, i1, 0);
@@ -34,14 +34,14 @@
{
i--;
}
- return isValidSupportBlock(world.getBlockId(i, j, k));
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
- return func_41052_f(world.getBlockId(i, j, k));
+ return func_41052_f(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
}
public static boolean isTrapdoorOpen(int i)
@@ -215,6 +222,11 @@
private static boolean isValidSupportBlock(int i)
private static boolean func_41052_f(int i)
{
+ if (disableValidation)
+ {
@@ -44,7 +44,7 @@
if (k1 != 0)
{
- Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ if (!worldObj.isRemote)
+ if (!worldObj.multiplayerWorld)
+ {
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ }
@@ -1,28 +1,34 @@
--- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
@@ -65,17 +65,20 @@
@@ -64,20 +64,23 @@
}
itemList.add(new ItemStack(ablock[l1], 1, k2));
}
- for (int i2 = 256; i2 < Item.itemsList.length; i2++)
+ for(int x = 0; x < Block.blocksList.length; x++)
{
- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.monsterPlacer.shiftedIndex)
-
+
+ for(int x = 0; x < 256; x++)
+ {
+ if (Block.blocksList[x] != null)
+ {
+ Block.blocksList[x].addCreativeItems((ArrayList)itemList);
+ }
+ }
+
for (int i2 = 256; i2 < Item.itemsList.length; i2++)
{
- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.field_44019_bC.shiftedIndex)
+ if (Item.itemsList[i2] != null)
{
- itemList.add(new ItemStack(Item.itemsList[i2]));
+ Block.blocksList[x].addCreativeItems((ArrayList)itemList);
+ Item.itemsList[i2].addCreativeItems((ArrayList)itemList);
}
}
- for (int j2 = 1; j2 < 16; j2++)
+ for (int i2 = Block.blocksList.length; i2 < Item.itemsList.length; i2++)
{
- {
- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2));
+ if (Item.itemsList[i2] != null)
+ {
+ Item.itemsList[i2].addCreativeItems((ArrayList)itemList);
+ }
}
- }
-
Integer integer;
for (Iterator iterator = EntityList.field_44041_a.keySet().iterator(); iterator.hasNext(); itemList.add(new ItemStack(Item.field_44019_bC.shiftedIndex, 1, integer.intValue())))
{
@@ -2,7 +2,7 @@
+++ ../src_work/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
@@ -70,6 +70,9 @@
public int serverPosZ;
public boolean ignoreFrustrumCheck;
public boolean ignoreFrustumCheck;
public boolean isAirBorne;
+
+ //Forge: Used to store custom data for each entity.
@@ -28,11 +28,11 @@
{
{
{
@@ -76,16 +81,35 @@
@@ -76,16 +81,36 @@
}
}
};
- private int turnProgress;
- private int minecartPosRotationIncrements;
- private double minecartX;
- private double minecartY;
- private double minecartZ;
@@ -42,7 +42,7 @@
- private double velocityY;
- private double velocityZ;
-
+ protected int turnProgress;
+ protected int minecartPosRotationIncrements;
+ protected double minecartX;
+ protected double minecartY;
+ protected double minecartZ;
@@ -51,8 +51,9 @@
+ protected double velocityX;
+ protected double velocityY;
+ protected double velocityZ;
+
+ /*Forge: Minecart Compatibility Layer Integration. */
+
+ /*Forge: Minecart Compatibility Layer Integration.
+ */
+ public static float defaultMaxSpeedRail = 0.4f;
+ public static float defaultMaxSpeedGround = 0.4f;
+ public static float defaultMaxSpeedAirLateral = 0.4f;
@@ -61,7 +62,7 @@
+ protected boolean canUseRail = true;
+ protected boolean canBePushed = true;
+ private static IMinecartCollisionHandler collisionHandler = null;
+
+
+ /*
+ * Instance versions of the above physics properties
+ */
@@ -69,12 +70,12 @@
+ protected float maxSpeedGround;
+ protected float maxSpeedAirLateral;
+ protected float maxSpeedAirVertical;
+ protected double dragAir;
+ protected double dragAir;
+
public EntityMinecart(World world)
{
super(world);
@@ -95,6 +119,18 @@
@@ -95,6 +120,18 @@
preventEntitySpawning = true;
setSize(0.98F, 0.7F);
yOffset = height / 2.0F;
@@ -93,7 +94,7 @@
}
protected boolean canTriggerWalking()
@@ -112,17 +148,27 @@
@@ -112,17 +149,27 @@
public AxisAlignedBB getCollisionBox(Entity entity)
{
@@ -122,59 +123,20 @@
}
public EntityMinecart(World world, double d, double d1, double d2,
@@ -161,49 +207,8 @@
riddenByEntity.mountEntity(this);
}
setEntityDead();
- dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F);
- if (minecartType == 1)
- {
- EntityMinecart entityminecart = this;
- label0:
- for (int j = 0; j < entityminecart.getSizeInventory(); j++)
- {
- ItemStack itemstack = entityminecart.getStackInSlot(j);
- if (itemstack == null)
- {
- continue;
- }
- float f = rand.nextFloat() * 0.8F + 0.1F;
- float f1 = rand.nextFloat() * 0.8F + 0.1F;
- float f2 = rand.nextFloat() * 0.8F + 0.1F;
- do
- {
- if (itemstack.stackSize <= 0)
- {
- continue label0;
- }
- int k = rand.nextInt(21) + 10;
- if (k > itemstack.stackSize)
- {
- k = itemstack.stackSize;
- }
- itemstack.stackSize -= k;
- EntityItem entityitem = new EntityItem(worldObj, posX + (double)f, posY + (double)f1, posZ + (double)f2, new ItemStack(itemstack.itemID, k, itemstack.getItemDamage()));
- float f3 = 0.05F;
- entityitem.motionX = (float)rand.nextGaussian() * f3;
- entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F;
- entityitem.motionZ = (float)rand.nextGaussian() * f3;
- worldObj.spawnEntityInWorld(entityitem);
- }
- while (true);
- }
@@ -197,12 +244,6 @@
}
while (true);
}
-
- dropItemWithOffset(Block.chest.blockID, 1, 0.0F);
- }
- else if (minecartType == 2)
- {
- dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F);
- }
+
+ dropCartAsItem();
}
}
return true;
}
@@ -268,7 +273,7 @@
@@ -268,7 +309,7 @@
{
func_41024_b(func_41025_i() - 1);
}
@@ -183,7 +145,7 @@
{
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
}
@@ -309,22 +314,18 @@
@@ -309,22 +350,18 @@
double d2 = 0.40000000000000002D;
double d4 = 0.0078125D;
int l = worldObj.getBlockId(i, j, k);
@@ -209,7 +171,7 @@
if (i1 >= 2 && i1 <= 5)
{
posY = j + 1;
@@ -358,7 +359,7 @@
@@ -358,7 +395,7 @@
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (d13 * d9) / d11;
motionZ = (d13 * d10) / d11;
@@ -218,7 +180,7 @@
{
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d16 < 0.029999999999999999D)
@@ -401,30 +402,9 @@
@@ -401,30 +438,9 @@
posX = d18 + d9 * d17;
posZ = d19 + d10 * d17;
setPosition(posX, posY + (double)yOffset, posZ);
@@ -252,7 +214,7 @@
if (ai[0][1] != 0 && MathHelper.floor_double(posX) - i == ai[0][0] && MathHelper.floor_double(posZ) - k == ai[0][2])
{
setPosition(posX, posY + (double)ai[0][1], posZ);
@@ -433,39 +413,9 @@
@@ -433,39 +449,9 @@
{
setPosition(posX, posY + (double)ai[1][1], posZ);
}
@@ -295,7 +257,7 @@
Vec3D vec3d1 = func_514_g(posX, posY, posZ);
if (vec3d1 != null && vec3d != null)
{
@@ -486,26 +436,14 @@
@@ -486,26 +472,14 @@
motionX = d15 * (double)(k1 - i);
motionZ = d15 * (double)(l1 - k);
}
@@ -328,7 +290,7 @@
{
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D)
@@ -540,35 +478,7 @@
@@ -540,35 +514,7 @@
}
else
{
@@ -365,7 +327,7 @@
}
rotationPitch = 0.0F;
double d6 = prevPosX - posX;
@@ -590,7 +500,20 @@
@@ -590,7 +536,20 @@
field_856_i = !field_856_i;
}
setRotation(rotationYaw, rotationPitch);
@@ -387,7 +349,7 @@
if (list != null && list.size() > 0)
{
for (int j1 = 0; j1 < list.size(); j1++)
@@ -610,15 +533,8 @@
@@ -610,15 +569,8 @@
}
riddenByEntity = null;
}
@@ -405,7 +367,7 @@
}
public Vec3D func_515_a(double d, double d1, double d2, double d3)
@@ -633,11 +549,7 @@
@@ -633,11 +585,7 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@@ -418,7 +380,7 @@
d1 = j;
if (i1 >= 2 && i1 <= 5)
{
@@ -679,12 +591,8 @@
@@ -679,12 +627,8 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@@ -432,7 +394,7 @@
if (i1 >= 2 && i1 <= 5)
{
d1 = j + 1;
@@ -739,13 +647,13 @@
@@ -739,13 +683,13 @@
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
nbttagcompound.setInteger("Type", minecartType);
@@ -449,7 +411,7 @@
{
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < cargoItems.length; i++)
@@ -766,13 +674,13 @@
@@ -766,13 +710,13 @@
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
minecartType = nbttagcompound.getInteger("Type");
@@ -466,20 +428,20 @@
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
cargoItems = new ItemStack[getSizeInventory()];
@@ -795,6 +703,12 @@
@@ -795,6 +739,12 @@
public void applyEntityCollision(Entity entity)
{
+ ForgeHooks.onMinecartEntityCollision(this, entity);
+ if (getCollisionHandler() != null)
+ {
+ getCollisionHandler().onEntityCollision(this, entity);
+ return;
+ }
if (worldObj.isRemote)
+ ForgeHooks.onMinecartEntityCollision(this, entity);
+ if (getCollisionHandler() != null)
+ {
+ getCollisionHandler().onEntityCollision(this, entity);
+ return;
+ }
if (worldObj.multiplayerWorld)
{
return;
@@ -803,7 +717,7 @@
@@ -803,7 +753,7 @@
{
return;
}
@@ -488,7 +450,7 @@
{
entity.mountEntity(this);
}
@@ -841,7 +755,7 @@
@@ -841,7 +791,7 @@
}
double d7 = entity.motionX + motionX;
double d8 = entity.motionZ + motionZ;
@@ -497,7 +459,7 @@
{
motionX *= 0.20000000298023224D;
motionZ *= 0.20000000298023224D;
@@ -849,7 +763,7 @@
@@ -849,7 +799,7 @@
entity.motionX *= 0.94999998807907104D;
entity.motionZ *= 0.94999998807907104D;
}
@@ -506,7 +468,7 @@
{
entity.motionX *= 0.20000000298023224D;
entity.motionZ *= 0.20000000298023224D;
@@ -879,7 +793,7 @@
@@ -879,7 +829,7 @@
public int getSizeInventory()
{
@@ -515,7 +477,7 @@
}
public ItemStack getStackInSlot(int i)
@@ -935,7 +849,11 @@
@@ -935,7 +885,11 @@
public boolean interact(EntityPlayer entityplayer)
{
@@ -528,14 +490,14 @@
{
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
{
@@ -946,14 +864,14 @@
@@ -946,14 +900,14 @@
entityplayer.mountEntity(this);
}
}
- else if (minecartType == 1)
+ else if (getSizeInventory() > 0)
{
if (!worldObj.isRemote)
if (!worldObj.multiplayerWorld)
{
entityplayer.displayGUIChest(this);
}
@@ -545,7 +507,7 @@
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex)
@@ -1000,7 +918,7 @@
@@ -1000,7 +954,7 @@
return entityplayer.getDistanceSqToEntity(this) <= 64D;
}
@@ -554,7 +516,7 @@
{
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
}
@@ -1054,4 +972,382 @@
@@ -1054,4 +1008,382 @@
{
return dataWatcher.getWatchableObjectInt(18);
}
@@ -93,34 +93,35 @@
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -768,7 +824,25 @@
{
i = 1 + i >> 1;
}
- i = applyArmorCalculations(damagesource, i);
+
+ boolean doRegularComputation = true;
@@ -764,6 +820,27 @@
protected void damageEntity(DamageSource damagesource, int i)
{
+ boolean doRegularComputation = true;
+ int initialDamage = i;
+
+ for (ItemStack stack : inventory.armorInventory)
+ {
+ if (stack != null && stack.getItem() instanceof ISpecialArmor)
+ {
+ ISpecialArmor armor = (ISpecialArmor)stack.getItem();
+ ISpecialArmor armor = (ISpecialArmor) stack.getItem();
+
+ ArmorProperties props = armor.getProperties(this, initialDamage, i);
+ i = i - props.damageRemove;
+ doRegularComputation = doRegularComputation && props.allowRegularComputation;
+ }
+ }
+
+ if (doRegularComputation)
+ if (!doRegularComputation)
+ {
+ i = applyArmorCalculations(damagesource, i);
+ super.damageEntity(damagesource, i);
+ return;
+ }
i = applyPotionDamageCalculations(damagesource, i);
addExhaustion(damagesource.getHungerDamage());
health -= i;
@@ -815,7 +889,9 @@
+
if (!damagesource.isUnblockable() && isBlocking())
{
i = 1 + i >> 1;
@@ -815,7 +892,9 @@
public void destroyCurrentEquippedItem()
{
@@ -130,15 +131,15 @@
}
public double getYOffset()
@@ -947,6 +1023,11 @@
@@ -947,6 +1026,11 @@
public EnumStatus sleepInBedAt(int i, int j, int k)
{
+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, i, j, k);
+ if (customSleep != null)
+ {
+ return customSleep;
+ }
if (!worldObj.isRemote)
+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, i, j, k);
+ if (customSleep != null)
+ {
+ return customSleep;
+ }
if (!worldObj.multiplayerWorld)
{
if (isPlayerSleeping() || !isEntityAlive())
@@ -1,122 +0,0 @@
--- ../src_base/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
@@ -2,6 +2,7 @@
import java.util.List;
import net.minecraft.client.Minecraft;
+import net.minecraft.src.forge.GuiControlsScrollPanel;
public class GuiControls extends GuiScreen
{
@@ -9,6 +10,7 @@
protected String screenTitle;
private GameSettings options;
private int buttonId;
+ private GuiControlsScrollPanel scrollPane;
public GuiControls(GuiScreen guiscreen, GameSettings gamesettings)
{
@@ -25,60 +27,30 @@
public void initGui()
{
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
StringTranslate stringtranslate = StringTranslate.getInstance();
int i = func_20080_j();
- for (int j = 0; j < options.keyBindings.length; j++)
- {
- controlList.add(new GuiSmallButton(j, i + (j % 2) * 160, height / 6 + 24 * (j >> 1), 70, 20, options.getOptionDisplayString(j)));
- }
-
- controlList.add(new GuiButton(200, width / 2 - 100, height / 6 + 168, stringtranslate.translateKey("gui.done")));
+ controlList.add(new GuiButton(200, width / 2 - 100, height - 28, stringtranslate.translateKey("gui.done")));
+ scrollPane.registerScrollButtons(controlList, 7, 8);
screenTitle = stringtranslate.translateKey("controls.title");
}
protected void actionPerformed(GuiButton guibutton)
{
- for (int i = 0; i < options.keyBindings.length; i++)
- {
- ((GuiButton)controlList.get(i)).displayString = options.getOptionDisplayString(i);
- }
-
if (guibutton.id == 200)
{
mc.displayGuiScreen(parentScreen);
}
- else
- {
- buttonId = guibutton.id;
- guibutton.displayString = (new StringBuilder()).append("> ").append(options.getOptionDisplayString(guibutton.id)).append(" <").toString();
- }
}
protected void mouseClicked(int i, int j, int k)
{
- if (buttonId >= 0)
- {
- options.setKeyBinding(buttonId, -100 + k);
- ((GuiButton)controlList.get(buttonId)).displayString = options.getOptionDisplayString(buttonId);
- buttonId = -1;
- KeyBinding.resetKeyBindingArrayAndHash();
- }
- else
- {
- super.mouseClicked(i, j, k);
- }
+ super.mouseClicked(i, j, k);
}
protected void keyTyped(char c, int i)
{
- if (buttonId >= 0)
- {
- options.setKeyBinding(buttonId, i);
- ((GuiButton)controlList.get(buttonId)).displayString = options.getOptionDisplayString(buttonId);
- buttonId = -1;
- KeyBinding.resetKeyBindingArrayAndHash();
- }
- else
+ if (scrollPane.keyTyped(c, i))
{
super.keyTyped(c, i);
}
@@ -87,35 +59,8 @@
public void drawScreen(int i, int j, float f)
{
drawDefaultBackground();
- drawCenteredString(fontRenderer, screenTitle, width / 2, 20, 0xffffff);
- int k = func_20080_j();
- for (int l = 0; l < options.keyBindings.length; l++)
- {
- boolean flag = false;
- for (int i1 = 0; i1 < options.keyBindings.length; i1++)
- {
- if (i1 != l && options.keyBindings[l].keyCode == options.keyBindings[i1].keyCode)
- {
- flag = true;
- }
- }
-
- int j1 = l;
- if (buttonId == l)
- {
- ((GuiButton)controlList.get(j1)).displayString = "\247f> \247e??? \247f<";
- }
- else if (flag)
- {
- ((GuiButton)controlList.get(j1)).displayString = (new StringBuilder()).append("\247c").append(options.getOptionDisplayString(j1)).toString();
- }
- else
- {
- ((GuiButton)controlList.get(j1)).displayString = options.getOptionDisplayString(j1);
- }
- drawString(fontRenderer, options.getKeyBindingDescription(l), k + (l % 2) * 160 + 70 + 6, height / 6 + 24 * (l >> 1) + 7, -1);
- }
-
+ scrollPane.drawScreen(i, j, f);
+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff);
super.drawScreen(i, j, f);
}
}
@@ -9,7 +9,7 @@
import java.util.Random;
@@ -157,6 +158,9 @@
private String potionEffect;
private String potionModifier;
private String itemName;
+ // FORGE: To disable repair recipes.
@@ -18,15 +18,6 @@
protected Item(int i)
{
maxStackSize = 64;
@@ -449,7 +453,7 @@
float f7 = f4 * f5;
float f8 = f6;
float f9 = f3 * f5;
- double d3 = 5D;
+ double d3 = ModLoader.getMinecraftInstance().playerController.getBlockReachDistance();
Vec3D vec3d1 = vec3d.addVector((double)f7 * d3, (double)f8 * d3, (double)f9 * d3);
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, flag, !flag);
return movingobjectposition;
@@ -469,6 +473,109 @@
{
return getIconFromDamage(i);
@@ -41,7 +32,7 @@
+ */
+ public void addCreativeItems(ArrayList itemList)
+ {
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.field_44019_bC.shiftedIndex)
+ {
+ itemList.add(new ItemStack(this, 1));
+ }
@@ -18,7 +18,7 @@
+
+ if (ForgeHooks.onUseBonemeal(world, i1, i, j, k))
+ {
+ if (!world.isRemote)
+ if (!world.multiplayerWorld)
+ {
+ itemstack.stackSize--;
+ }
@@ -27,7 +27,7 @@
+
if (i1 == Block.sapling.blockID)
{
if (!world.isRemote)
if (!world.multiplayerWorld)
@@ -109,14 +122,7 @@
world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
continue;
@@ -0,0 +1,15 @@
--- ../src_base/minecraft/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000
@@ -71,7 +71,11 @@
}));
}
byte abyte0[] = new byte[k1];
- datainputstream.read(abyte0, 0, k1);
+ int bytesRead = 0;
+ while (bytesRead < k1)
+ {
+ bytesRead += datainputstream.read(abyte0, bytesRead, k1 - bytesRead);
+ }
dataString[j1] = new String(abyte0);
}
}
@@ -1,11 +0,0 @@
--- ../src_base/minecraft/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
@@ -20,7 +20,7 @@
if (length > 0 && length < 32767)
{
data = new byte[length];
- datainputstream.read(data);
+ datainputstream.readFully(data);
}
}
@@ -46,7 +46,7 @@
+ curBlockDamageMP += block.blockStrength(mc.theWorld, mc.thePlayer, i, j, k);
if (stepSoundTickCounter % 4F == 0.0F && block != null)
{
mc.sndManager.playSound(block.stepSound.getStepSound(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
@@ -207,6 +214,16 @@
{
syncCurrentPlayItem();
@@ -44,7 +44,7 @@
+ curBlockDamage += block.blockStrength(mc.theWorld, mc.thePlayer, i, j, k);
if (blockDestroySoundCounter % 4F == 0.0F && block != null)
{
mc.sndManager.playSound(block.stepSound.getStepSound(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
@@ -165,6 +171,14 @@
public boolean onPlayerRightClick(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
@@ -66,7 +66,7 @@
furnaceItemStacks[2] = itemstack.copy();
}
- else if (furnaceItemStacks[2].itemID == itemstack.itemID)
+ else if (furnaceItemStacks[2].isItemEqual(itemstack))
+ else if (furnaceItemStacks[2].equals(itemstack))
{
- furnaceItemStacks[2].stackSize++;
+ furnaceItemStacks[2].stackSize += itemstack.stackSize;
@@ -158,7 +158,7 @@
+ }
}
public void markTileEntityForDespawn(TileEntity tileentity)
public void markEntityForDespawn(TileEntity tileentity)
@@ -2109,7 +2104,7 @@
}
else
@@ -190,7 +190,7 @@
@@ -3493,4 +3492,39 @@
{
return worldInfo.getTerrainType() != EnumWorldType.FLAT ? 63D : 0.0D;
return worldInfo.func_46133_t() != EnumWorldType.FLAT ? 63D : 0.0D;
}
+
+
@@ -14,21 +14,23 @@
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
+ @Override
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
{
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
- if (world.isRemote)
- if (world.singleplayerWorld)
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (meta == 7)
+ if (meta == 7)
+ {
+ ret.add(new ItemStack(Item.wheat));
+ }
+
+ for(int n = 0; n < 3 + fortune; n++)
{
- return;
+ ret.add(new ItemStack(Item.wheat));
}
- }
- int j1 = 3 + i1;
- for (int k1 = 0; k1 < j1; k1++)
+
+ for (int n = 0; n < 3 + fortune; n++)
{
- {
- if (world.rand.nextInt(15) <= l)
+ if (world.rand.nextInt(15) <= meta)
{
@@ -25,20 +25,19 @@
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
@@ -67,7 +66,9 @@
@@ -67,7 +66,8 @@
public void updateTick(World world, int i, int j, int k, Random random)
{
- boolean flag = world.getBlockId(i, j - 1, k) == Block.netherrack.blockID;
+ Block base = Block.blocksList[world.getBlockId(i, j - 1, k)];
+ boolean flag = (base != null && base.isFireSource(world, i, j - 1, k, world.getBlockMetadata(i, j - 1, k), 0));
+
if ((world.worldProvider instanceof WorldProviderEnd) && world.getBlockId(i, j - 1, k) == Block.bedrock.blockID)
{
flag = true;
@@ -89,23 +90,23 @@
@@ -89,23 +89,23 @@
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
if (!flag && !canNeighborBurn(world, i, j, k))
if (!flag && !func_268_g(world, i, j, k))
{
- if (!world.isBlockNormalCube(i, j - 1, k) || l > 3)
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 0) || l > 3)
@@ -68,58 +67,78 @@
for (int i1 = i - 1; i1 <= i + 1; i1++)
{
for (int j1 = k - 1; j1 <= k + 1; j1++)
@@ -142,9 +143,24 @@
@@ -142,55 +142,66 @@
}
}
+ /**
+ * Deprecated for a side-sensitive version
+ */
+ @Deprecated
private void tryToCatchBlockOnFire(World world, int i, int j, int k, int l, Random random, int i1)
{
- int j1 = abilityToCatchFire[world.getBlockId(i, j, k)];
+ tryToCatchBlockOnFire(world, i, j, k, l, random, i1, 0);
- if (random.nextInt(l) < j1)
+ tryToCatchBlockOnFire(world, i, j, k, l, random, i1, 0);
+ }
+
+ private void tryToCatchBlockOnFire(World world, int i, int j, int k, int l, Random random, int i1, int face)
+ {
+ int j1 = 0;
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ if (block != null)
+ int j1 = 0;
+ if (block != null)
+ {
+ j1 = block.getFlammability(world, i, j, k, world.getBlockMetadata(i, j, k), face);
+ j1 = block.getFlammability(world, i, j, k, world.getBlockMetadata(i, j, k), face);
+ }
+
if (random.nextInt(l) < j1)
+ if(random.nextInt(l) < j1)
{
boolean flag = world.getBlockId(i, j, k) == Block.tnt.blockID;
@@ -170,27 +186,27 @@
- if (random.nextInt(i1 + 10) < 5 && !world.canLightningStrikeAt(i, j, k))
+ if(random.nextInt(i1 + 10) < 5 && !world.canLightningStrikeAt(i, j, k))
{
int k1 = i1 + random.nextInt(5) / 4;
- if (k1 > 15)
+ if(k1 > 15)
{
k1 = 15;
}
world.setBlockAndMetadataWithNotify(i, j, k, blockID, k1);
- }
- else
+ } else
{
world.setBlockWithNotify(i, j, k, 0);
}
- if (flag)
+ if(flag)
{
Block.tnt.onBlockDestroyedByPlayer(world, i, j, k, 1);
}
}
}
private boolean canNeighborBurn(World world, int i, int j, int k)
+
private boolean func_268_g(World world, int i, int j, int k)
{
- if (canBlockCatchFire(world, i + 1, j, k))
+ if (canBlockCatchFire(world, i + 1, j, k, 4))
+ if(canBlockCatchFire(world, i + 1, j, k, 4))
{
return true;
}
- if (canBlockCatchFire(world, i - 1, j, k))
+ if (canBlockCatchFire(world, i - 1, j, k, 5))
+ if(canBlockCatchFire(world, i - 1, j, k, 5))
{
return true;
}
- if (canBlockCatchFire(world, i, j - 1, k))
+ if (canBlockCatchFire(world, i, j - 1, k, 1))
+ if(canBlockCatchFire(world, i, j - 1, k, 1))
{
return true;
}
- if (canBlockCatchFire(world, i, j + 1, k))
+ if (canBlockCatchFire(world, i, j + 1, k, 0))
+ if(canBlockCatchFire(world, i, j + 1, k, 0))
{
return true;
}
- if (canBlockCatchFire(world, i, j, k - 1))
+ if (canBlockCatchFire(world, i, j, k - 1, 3))
+ if(canBlockCatchFire(world, i, j, k - 1, 3))
{
return true;
}
@@ -128,7 +147,7 @@
}
private int getChanceOfNeighborsEncouragingFire(World world, int i, int j, int k)
@@ -202,12 +218,12 @@
@@ -202,12 +213,12 @@
}
else
{
@@ -147,98 +166,73 @@
return l;
}
}
@@ -217,32 +233,32 @@
@@ -217,19 +228,40 @@
return false;
}
+ /**
+ * Deprecated for a side-sensitive version
+ */
+ @Deprecated
public boolean canBlockCatchFire(IBlockAccess iblockaccess, int i, int j, int k)
{
- return chanceToEncourageFire[iblockaccess.getBlockId(i, j, k)] > 0;
+ return canBlockCatchFire(iblockaccess, i, j, k, 0);
+ }
+
+ public boolean canBlockCatchFire(IBlockAccess world, int i, int j, int k, int face)
+ {
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ if (block != null)
+ {
+ return block.isFlammable(world, i, j, k, world.getBlockMetadata(i, j, k), face);
+ }
+ return false;
}
+ /**
+ * Deprecated for a side-sensitive version
+ */
+ @Deprecated
public int getChanceToEncourageFire(World world, int i, int j, int k, int l)
{
- int i1 = chanceToEncourageFire[world.getBlockId(i, j, k)];
- if (i1 > l)
- {
- return i1;
+ return getChanceToEncourageFire(world, i, j, k, l, 0);
+ }
+
+ public int getChanceToEncourageFire(World world, int i, int j, int k, int l, int face)
+ {
+ int i1 = 0;
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ if (block != null)
+ {
+ i1 = block.getFireSpreadSpeed(world, i, j, k, world.getBlockMetadata(i, j, k), face);
+ }
+ if(i1 > l)
{
return i1;
- }
- else
- {
- return l;
- }
+ return getChanceToEncourageFire(world, i, j, k, l, 0);
}
+ } else
{
return l;
}
@@ -237,12 +269,12 @@
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
- return world.isBlockNormalCube(i, j - 1, k) || canNeighborBurn(world, i, j, k);
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || canNeighborBurn(world, i, j, k);
- return world.isBlockNormalCube(i, j - 1, k) || func_268_g(world, i, j, k);
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || func_268_g(world, i, j, k);
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
- if (!world.isBlockNormalCube(i, j - 1, k) && !func_268_g(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !func_268_g(world, i, j, k))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -259,7 +275,7 @@
@@ -259,7 +291,7 @@
{
return;
}
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
- if (!world.isBlockNormalCube(i, j - 1, k) && !func_268_g(world, i, j, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !func_268_g(world, i, j, k))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -269,5 +285,40 @@
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
return;
}
+ }
+
+ /**
+ * Forge: Side sensitive version
+ */
+ public boolean canBlockCatchFire(IBlockAccess world, int i, int j, int k, int face)
+ {
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ if (block != null)
+ {
+ return block.isFlammable(world, i, j, k, world.getBlockMetadata(i, j, k), face);
+ }
+ return false;
+ }
+
+ /**
+ * Forge: Side sensitive version
+ */
+ public int getChanceToEncourageFire(World world, int i, int j, int k, int l, int face)
+ {
+ int i1 = 0;
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ if (block != null)
+ {
+ i1 = block.getFireSpreadSpeed(world, i, j, k, world.getBlockMetadata(i, j, k), face);
+ }
+
+ if (i1 > l)
+ {
+ return i1;
+ }
+ else
+ {
+ return l;
+ }
}
}
@@ -7,37 +7,48 @@
import java.util.Random;
public class BlockNetherStalk extends BlockFlower
@@ -57,25 +58,24 @@
@@ -57,25 +58,26 @@
return 6;
}
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
+ @Override
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int metadata, int fortune)
{
- if (world.isRemote)
- if (world.singleplayerWorld)
- {
- return;
- }
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
int j1 = 1;
- int j1 = 1;
- if (l >= 3)
+ if (meta >= 3)
{
j1 = 2 + world.rand.nextInt(3);
- {
- j1 = 2 + world.rand.nextInt(3);
- if (i1 > 0)
+ if (fortune > 0)
{
- {
- j1 += world.rand.nextInt(i1 + 1);
+ j1 += world.rand.nextInt(fortune + 1);
}
}
for (int k1 = 0; k1 < j1; k1++)
{
- }
- }
- for (int k1 = 0; k1 < j1; k1++)
- {
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
+ ret.add(new ItemStack(Item.netherStalkSeeds));
}
+ return ret;
- }
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+
+ int j1 = 1;
+ if (metadata >= 3)
+ {
+ j1 = 2 + world.rand.nextInt(3);
+ if (fortune > 0)
+ {
+ j1 += world.rand.nextInt(fortune + 1);
+ }
+ }
+ for (int k1 = 0; k1 < j1; k1++)
+ {
+ ret.add(new ItemStack(Item.netherStalkSeeds));
+ }
+ return ret;
+
}
public int idDropped(int i, Random random, int j)
@@ -5,7 +5,7 @@
}
}
- return !(Block.blocksList[i] instanceof BlockContainer);
+ return !(Block.blocksList[i] != null && Block.blocksList[i].hasTileEntity(world.getBlockMetadata(j, k, l)));
+ return !(Block.blocksList[i] != null && Block.blocksList[i].hasTileEntity(world.getBlockMetadata(j, l, l)));
}
private static boolean canExtend(World world, int i, int j, int k, int l)
@@ -50,12 +50,7 @@
}
public void onBlockAdded(World world, int i, int j, int k)
@@ -119,23 +132,23 @@
j1 &= 7;
}
boolean flag = false;
- if (!world.isBlockNormalCube(i, j - 1, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
@@ -123,19 +136,19 @@
{
flag = true;
}
@@ -1,14 +1,6 @@
--- ../src_base/minecraft_server/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
@@ -63,7 +63,6 @@
{
if (!canPlaceBlockAt(world, i, j, k))
{
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
return false;
}
@@ -75,15 +74,7 @@
@@ -75,15 +75,7 @@
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
@@ -25,7 +17,7 @@
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
}
@@ -94,14 +85,13 @@
@@ -94,7 +86,7 @@
public int quantityDropped(Random random)
{
@@ -34,10 +26,3 @@
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if (world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11)
{
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
@@ -4,8 +4,8 @@
private boolean canPlaceTorchOn(World world, int i, int j, int k)
{
- if (world.isBlockNormalCubeDefault(i, j, k, true))
+ if (world.isBlockSolidOnSide(i, j, k, 1))
- if (world.func_41047_b(i, j, k, true))
+ if(world.isBlockSolidOnSide(i, j, k, 1))
{
return true;
}
@@ -13,22 +13,22 @@
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
- if (world.func_41047_b(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
return true;
}
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
- if (world.func_41047_b(i + 1, j, k, true))
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
return true;
}
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
- if (world.func_41047_b(i, j, k - 1, true))
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
return true;
}
- if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
- if (world.func_41047_b(i, j, k + 1, true))
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
{
return true;
@@ -37,22 +37,22 @@
{
i1 = 5;
}
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
- if (l == 2 && world.func_41047_b(i, j, k + 1, true))
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
{
i1 = 4;
}
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
- if (l == 3 && world.func_41047_b(i, j, k - 1, true))
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
{
i1 = 3;
}
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
- if (l == 4 && world.func_41047_b(i + 1, j, k, true))
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
{
i1 = 2;
}
- if (l == 5 && world.isBlockNormalCubeDefault(i - 1, j, k, true))
- if (l == 5 && world.func_41047_b(i - 1, j, k, true))
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
{
i1 = 1;
@@ -61,22 +61,22 @@
public void onBlockAdded(World world, int i, int j, int k)
{
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
- if (world.func_41047_b(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
world.setBlockMetadataWithNotify(i, j, k, 1);
}
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
- else if (world.func_41047_b(i + 1, j, k, true))
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
- else if (world.func_41047_b(i, j, k - 1, true))
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
- else if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
- else if (world.func_41047_b(i, j, k + 1, true))
+ else if (world.isBlockSolidOnSide(i, j, k + 1, 2))
{
world.setBlockMetadataWithNotify(i, j, k, 4);
@@ -85,22 +85,22 @@
{
int i1 = world.getBlockMetadata(i, j, k);
boolean flag = false;
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
- if (!world.func_41047_b(i - 1, j, k, true) && i1 == 1)
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
{
flag = true;
}
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
- if (!world.func_41047_b(i + 1, j, k, true) && i1 == 2)
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
{
flag = true;
}
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
- if (!world.func_41047_b(i, j, k - 1, true) && i1 == 3)
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
{
flag = true;
}
- if (!world.isBlockNormalCubeDefault(i, j, k + 1, true) && i1 == 4)
- if (!world.func_41047_b(i, j, k + 1, true) && i1 == 4)
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
{
flag = true;
@@ -14,8 +14,8 @@
{
j1--;
}
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
+ if (!(isValidSupportBlock(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
- if (!func_41006_g(world.getBlockId(j1, j, k1)))
+ if (!(func_41006_g(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
{
world.setBlockWithNotify(i, j, k, 0);
dropBlockAsItem(world, i, j, k, i1, 0);
@@ -34,8 +34,8 @@
{
i--;
}
- return isValidSupportBlock(world.getBlockId(i, j, k));
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
- return func_41006_g(world.getBlockId(i, j, k));
+ return func_41006_g(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
}
public static boolean isTrapdoorOpen(int i)
@@ -39,12 +39,11 @@
isModified = true;
return true;
}
@@ -391,7 +383,11 @@
blocks[i << worldObj.xShift | k << worldObj.heightShift | j] = (byte)(byte0 & 0xff);
@@ -392,6 +384,11 @@
if (k1 != 0)
{
- Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ if (!worldObj.isRemote)
Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ if (!worldObj.singleplayerWorld)
+ {
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ }
@@ -52,7 +51,7 @@
}
data.setNibble(i, j, k, 0);
if (Block.lightOpacity[byte0 & 0xff] != 0)
@@ -414,28 +410,22 @@
@@ -414,28 +411,22 @@
{
Block.blocksList[l].onBlockAdded(worldObj, l1, j, i2);
}
@@ -85,7 +84,7 @@
isModified = true;
return true;
}
@@ -455,7 +445,7 @@
@@ -455,7 +446,7 @@
}
data.setNibble(i, j, k, l);
int j1 = getBlockID(i, j, k);
@@ -94,7 +93,7 @@
{
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
if (tileentity != null)
@@ -572,29 +562,27 @@
@@ -572,29 +563,27 @@
{
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
@@ -133,7 +132,7 @@
}
public void addTileEntity(TileEntity tileentity)
@@ -605,7 +593,7 @@
@@ -605,7 +594,7 @@
setChunkBlockTileEntity(i, j, k, tileentity);
if (isChunkLoaded)
{
@@ -142,7 +141,7 @@
}
}
@@ -616,12 +604,18 @@
@@ -616,12 +605,18 @@
tileentity.xCoord = xPosition * 16 + i;
tileentity.yCoord = j;
tileentity.zCoord = zPosition * 16 + k;
@@ -162,7 +161,7 @@
tileentity.validate();
chunkTileEntityMap.put(chunkposition, tileentity);
return;
@@ -903,4 +897,18 @@
@@ -903,4 +898,18 @@
{
return new ChunkCoordIntPair(xPosition, zPosition);
}
@@ -28,7 +28,7 @@
{
{
{
@@ -76,12 +81,35 @@
@@ -76,13 +81,36 @@
}
}
};
@@ -36,25 +36,27 @@
- private double minecartX;
- private double minecartY;
- private double minecartZ;
- private double minecartYaw;
- private double field_9159_ar;
- private double minecartPitch;
-
+ protected int turnProgress;
+ protected double minecartX;
+ protected double minecartY;
+ protected double minecartZ;
+ protected double minecartYaw;
+ protected double field_9159_ar;
+ protected double minecartPitch;
+
+ /*Forge: Minecart Compatibility Layer Integration. */
+ /*Forge: Minecart Compatibility Layer Integration.
+ */
+ protected double velocityX;
+ protected double velocityY;
+ protected double velocityZ;
+ protected double velocityZ;
+ public static float defaultMaxSpeedRail = 0.4f;
+ public static float defaultMaxSpeedGround = 0.4f;
+ public static float defaultMaxSpeedAirLateral = 0.4f;
+ public static float defaultMaxSpeedAirVertical = -1f;
+ public static double defaultDragAir = 0.94999998807907104D;
+ protected boolean canUseRail = true;
+ protected boolean canUseRail = true;
+ protected boolean canBePushed = true;
+ private static IMinecartCollisionHandler collisionHandler = null;
+
@@ -65,11 +67,11 @@
+ protected float maxSpeedGround;
+ protected float maxSpeedAirLateral;
+ protected float maxSpeedAirVertical;
+ protected double dragAir;
+
+ protected double dragAir;
+
public EntityMinecart(World world)
{
super(world);
@@ -92,6 +120,18 @@
preventEntitySpawning = true;
setSize(0.98F, 0.7F);
@@ -118,59 +120,33 @@
}
public EntityMinecart(World world, double d, double d1, double d2,
@@ -158,49 +208,8 @@
@@ -158,8 +208,10 @@
riddenByEntity.mountEntity(this);
}
setEntityDead();
- dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F);
- if (minecartType == 1)
- {
- EntityMinecart entityminecart = this;
- label0:
- for (int j = 0; j < entityminecart.getSizeInventory(); j++)
- {
- ItemStack itemstack = entityminecart.getStackInSlot(j);
- if (itemstack == null)
- {
- continue;
- }
- float f = rand.nextFloat() * 0.8F + 0.1F;
- float f1 = rand.nextFloat() * 0.8F + 0.1F;
- float f2 = rand.nextFloat() * 0.8F + 0.1F;
- do
- {
- if (itemstack.stackSize <= 0)
- {
- continue label0;
- }
- int k = rand.nextInt(21) + 10;
- if (k > itemstack.stackSize)
- {
- k = itemstack.stackSize;
- }
- itemstack.stackSize -= k;
- EntityItem entityitem = new EntityItem(worldObj, posX + (double)f, posY + (double)f1, posZ + (double)f2, new ItemStack(itemstack.itemID, k, itemstack.getItemDamage()));
- float f3 = 0.05F;
- entityitem.motionX = (float)rand.nextGaussian() * f3;
- entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F;
- entityitem.motionZ = (float)rand.nextGaussian() * f3;
- worldObj.spawnEntityInWorld(entityitem);
- }
- while (true);
- }
+
+ dropCartAsItem();
+
+ if (getSizeInventory() > 0)
{
EntityMinecart entityminecart = this;
label0:
@@ -194,12 +246,6 @@
}
while (true);
}
-
- dropItemWithOffset(Block.chest.blockID, 1, 0.0F);
- }
- else if (minecartType == 2)
- {
- dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F);
- }
+
+ dropCartAsItem();
}
}
return true;
}
@@ -258,7 +267,7 @@
@@ -258,7 +304,7 @@
{
func_41018_e_(func_41020_o() - 1);
}
@@ -179,7 +155,7 @@
{
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
}
@@ -299,22 +308,18 @@
@@ -299,22 +345,18 @@
double d2 = 0.40000000000000002D;
double d4 = 0.0078125D;
int l = worldObj.getBlockId(i, j, k);
@@ -205,7 +181,7 @@
if (i1 >= 2 && i1 <= 5)
{
posY = j + 1;
@@ -348,7 +353,7 @@
@@ -348,7 +390,7 @@
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (d13 * d9) / d11;
motionZ = (d13 * d10) / d11;
@@ -214,7 +190,7 @@
{
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d16 < 0.029999999999999999D)
@@ -391,30 +396,9 @@
@@ -391,30 +433,9 @@
posX = d18 + d9 * d17;
posZ = d19 + d10 * d17;
setPosition(posX, posY + (double)yOffset, posZ);
@@ -248,7 +224,7 @@
if (ai[0][1] != 0 && MathHelper.floor_double(posX) - i == ai[0][0] && MathHelper.floor_double(posZ) - k == ai[0][2])
{
setPosition(posX, posY + (double)ai[0][1], posZ);
@@ -423,39 +407,9 @@
@@ -423,39 +444,9 @@
{
setPosition(posX, posY + (double)ai[1][1], posZ);
}
@@ -291,7 +267,7 @@
Vec3D vec3d1 = func_182_g(posX, posY, posZ);
if (vec3d1 != null && vec3d != null)
{
@@ -476,26 +430,14 @@
@@ -476,26 +467,14 @@
motionX = d15 * (double)(k1 - i);
motionZ = d15 * (double)(l1 - k);
}
@@ -324,7 +300,7 @@
{
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D)
@@ -530,35 +472,7 @@
@@ -530,35 +509,7 @@
}
else
{
@@ -361,7 +337,7 @@
}
rotationPitch = 0.0F;
double d6 = prevPosX - posX;
@@ -580,7 +494,19 @@
@@ -580,7 +531,19 @@
field_469_aj = !field_469_aj;
}
setRotation(rotationYaw, rotationPitch);
@@ -382,7 +358,7 @@
if (list != null && list.size() > 0)
{
for (int j1 = 0; j1 < list.size(); j1++)
@@ -600,15 +526,9 @@
@@ -600,15 +563,9 @@
}
riddenByEntity = null;
}
@@ -401,7 +377,7 @@
}
public Vec3D func_182_g(double d, double d1, double d2)
@@ -623,12 +543,8 @@
@@ -623,12 +580,8 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@@ -415,7 +391,7 @@
if (i1 >= 2 && i1 <= 5)
{
d1 = j + 1;
@@ -683,13 +599,14 @@
@@ -683,13 +636,14 @@
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
nbttagcompound.setInteger("Type", minecartType);
@@ -433,7 +409,7 @@
{
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < cargoItems.length; i++)
@@ -702,7 +619,6 @@
@@ -702,7 +656,6 @@
nbttaglist.setTag(nbttagcompound1);
}
}
@@ -441,7 +417,7 @@
nbttagcompound.setTag("Items", nbttaglist);
}
}
@@ -710,13 +626,14 @@
@@ -710,13 +663,14 @@
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
minecartType = nbttagcompound.getInteger("Type");
@@ -459,20 +435,21 @@
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
cargoItems = new ItemStack[getSizeInventory()];
@@ -734,6 +651,12 @@
@@ -734,6 +688,13 @@
public void applyEntityCollision(Entity entity)
{
+ ForgeHooks.onMinecartEntityCollision(this, entity);
+
+ if (getCollisionHandler() != null)
+ {
+ getCollisionHandler().onEntityCollision(this, entity);
+ return;
+ }
if (worldObj.isRemote)
+ }
if (worldObj.singleplayerWorld)
{
return;
@@ -742,7 +665,7 @@
@@ -742,7 +703,7 @@
{
return;
}
@@ -481,7 +458,7 @@
{
entity.mountEntity(this);
}
@@ -780,7 +703,7 @@
@@ -780,7 +741,7 @@
}
double d7 = entity.motionX + motionX;
double d8 = entity.motionZ + motionZ;
@@ -490,7 +467,7 @@
{
motionX *= 0.20000000298023224D;
motionZ *= 0.20000000298023224D;
@@ -788,7 +711,7 @@
@@ -788,7 +749,7 @@
entity.motionX *= 0.94999998807907104D;
entity.motionZ *= 0.94999998807907104D;
}
@@ -499,7 +476,7 @@
{
entity.motionX *= 0.20000000298023224D;
entity.motionZ *= 0.20000000298023224D;
@@ -818,7 +741,7 @@
@@ -818,7 +779,7 @@
public int getSizeInventory()
{
@@ -508,7 +485,7 @@
}
public ItemStack getStackInSlot(int i)
@@ -874,7 +797,12 @@
@@ -874,7 +835,12 @@
public boolean interact(EntityPlayer entityplayer)
{
@@ -522,24 +499,24 @@
{
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
{
@@ -885,14 +813,14 @@
@@ -885,14 +851,14 @@
entityplayer.mountEntity(this);
}
}
- else if (minecartType == 1)
+ else if (getSizeInventory() > 0)
{
if (!worldObj.isRemote)
if (!worldObj.singleplayerWorld)
{
entityplayer.displayGUIChest(this);
}
}
- else if (minecartType == 2)
+ else if (minecartType == 2 && getClass() == EntityMinecart.class)
+ else if (minecartType == 2 && getClass() == EntityMinecart.class)
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex)
@@ -918,7 +846,7 @@
@@ -918,7 +884,7 @@
return entityplayer.getDistanceSqToEntity(this) <= 64D;
}
@@ -548,7 +525,7 @@
{
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
}
@@ -971,5 +899,384 @@
@@ -971,5 +937,384 @@
public int func_41021_q()
{
return dataWatcher.getWatchableObjectInt(18);
@@ -19,18 +19,7 @@
if (itemInUseCount <= 25 && itemInUseCount % 4 == 0)
{
func_35208_b(itemstack, 5);
@@ -274,6 +279,10 @@
protected void closeScreen()
{
+ if (craftingInventory != null)
+ {
+ craftingInventory.onCraftGuiClosed(this);
+ }
craftingInventory = inventorySlots;
}
@@ -433,7 +442,16 @@
@@ -433,7 +438,16 @@
public void dropCurrentItem()
{
@@ -48,7 +37,7 @@
}
public void dropPlayerItem(ItemStack itemstack)
@@ -480,6 +498,8 @@
@@ -480,6 +494,8 @@
worldObj.spawnEntityInWorld(entityitem);
}
@@ -57,7 +46,7 @@
public float getCurrentPlayerStrVsBlock(Block block)
{
float f = inventory.getStrVsBlock(block);
@@ -508,6 +528,45 @@
@@ -508,6 +524,45 @@
return f1;
}
@@ -103,12 +92,10 @@
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -711,7 +770,25 @@
{
i = 1 + i >> 1;
}
- i = applyArmorCalculations(damagesource, i);
+
@@ -707,6 +762,26 @@
protected void damageEntity(DamageSource damagesource, int i)
{
+ boolean doRegularComputation = true;
+ int initialDamage = i;
+
@@ -116,21 +103,23 @@
+ {
+ if (stack != null && stack.getItem() instanceof ISpecialArmor)
+ {
+ ISpecialArmor armor = (ISpecialArmor)stack.getItem();
+ ISpecialArmor armor = (ISpecialArmor) stack.getItem();
+ ArmorProperties props = armor.getProperties(this, initialDamage, i);
+ i = i - props.damageRemove;
+ doRegularComputation = doRegularComputation && props.allowRegularComputation;
+ }
+ }
+
+ if (doRegularComputation)
+ if (!doRegularComputation)
+ {
+ i = applyArmorCalculations(damagesource, i);
+ super.damageEntity(damagesource, i);
+ return;
+ }
i = applyPotionDamageCalculations(damagesource, i);
addExhaustion(damagesource.getHungerDamage());
health -= i;
@@ -758,7 +835,9 @@
+
if (!damagesource.isUnblockable() && isBlocking())
{
i = 1 + i >> 1;
@@ -758,7 +833,9 @@
public void destroyCurrentEquippedItem()
{
@@ -140,15 +129,15 @@
}
public double getYOffset()
@@ -884,6 +963,11 @@
@@ -884,6 +961,11 @@
public EnumStatus sleepInBedAt(int i, int j, int k)
{
+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, i, j, k);
+ if (customSleep != null)
+ if (customSleep != null)
+ {
+ return customSleep;
+ }
if (!worldObj.isRemote)
if (!worldObj.singleplayerWorld)
{
if (isPlayerSleeping() || !isEntityAlive())
@@ -1,50 +0,0 @@
--- ../src_base/minecraft_server/net/minecraft/src/EntityPlayerMP.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayerMP.java 0000-00-00 00:00:00.000000000 -0000
@@ -405,6 +405,7 @@
public void displayWorkbenchGUI(int i, int j, int k)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 1, "Crafting", 9));
craftingInventory = new ContainerWorkbench(inventory, worldObj, i, j, k);
craftingInventory.windowId = currentWindowId;
@@ -414,6 +415,7 @@
public void displayGUIEnchantment(int i, int j, int k)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 4, "Enchanting", 9));
craftingInventory = new ContainerEnchantment(inventory, worldObj, i, j, k);
craftingInventory.windowId = currentWindowId;
@@ -423,6 +425,7 @@
public void displayGUIChest(IInventory iinventory)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 0, iinventory.getInvName(), iinventory.getSizeInventory()));
craftingInventory = new ContainerChest(inventory, iinventory);
craftingInventory.windowId = currentWindowId;
@@ -432,6 +435,7 @@
public void displayGUIFurnace(TileEntityFurnace tileentityfurnace)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 2, tileentityfurnace.getInvName(), tileentityfurnace.getSizeInventory()));
craftingInventory = new ContainerFurnace(inventory, tileentityfurnace);
craftingInventory.windowId = currentWindowId;
@@ -441,6 +445,7 @@
public void displayGUIDispenser(TileEntityDispenser tileentitydispenser)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 3, tileentitydispenser.getInvName(), tileentitydispenser.getSizeInventory()));
craftingInventory = new ContainerDispenser(inventory, tileentitydispenser);
craftingInventory.windowId = currentWindowId;
@@ -450,6 +455,7 @@
public void displayGUIBrewingStand(TileEntityBrewingStand tileentitybrewingstand)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 5, tileentitybrewingstand.getInvName(), tileentitybrewingstand.getSizeInventory()));
craftingInventory = new ContainerBrewingStand(inventory, tileentitybrewingstand);
craftingInventory.windowId = currentWindowId;
@@ -9,7 +9,7 @@
public class Item
@@ -156,6 +157,9 @@
private String potionEffect;
private String potionInfo;
private String itemName;
+ // FORGE: To disable repair recipes.
@@ -18,15 +18,7 @@
protected Item(int i)
{
maxStackSize = 64;
@@ -389,10 +393,117 @@
float f8 = f6;
float f9 = f3 * f5;
double d3 = 5D;
+ if (entityplayer instanceof EntityPlayerMP)
+ {
+ d3 = ((EntityPlayerMP)entityplayer).itemInWorldManager.getBlockReachDistance();
+ }
Vec3D vec3d1 = vec3d.addVector((double)f7 * d3, (double)f8 * d3, (double)f9 * d3);
@@ -393,6 +397,109 @@
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, flag, !flag);
return movingobjectposition;
}
@@ -40,7 +32,7 @@
+ */
+ public void addCreativeItems(ArrayList itemList)
+ {
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.field_44008_bB.shiftedIndex)
+ {
+ itemList.add(new ItemStack(this, 1));
+ }
@@ -24,7 +24,7 @@
int i1 = world.getBlockId(i, j, k);
+ if (ForgeHooks.onUseBonemeal(world, i1, i, j, k))
+ {
+ if (!world.isRemote)
+ if (!world.singleplayerWorld)
+ {
+ itemstack.stackSize--;
+ }
@@ -32,7 +32,7 @@
+ }
if (i1 == Block.sapling.blockID)
{
if (!world.isRemote)
if (!world.singleplayerWorld)
@@ -103,14 +113,7 @@
world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
continue;
@@ -1,17 +1,14 @@
--- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000
@@ -1,7 +1,10 @@
@@ -1,5 +1,7 @@
package net.minecraft.src;
+import net.minecraft.src.forge.ForgeHooks;
+
public class ItemInWorldManager
{
+ private double blockReachDistance = 5.0d;
public World thisWorld;
public EntityPlayer thisPlayer;
private int gameType;
@@ -71,7 +74,7 @@
@@ -71,7 +73,7 @@
if (j != 0)
{
Block block = Block.blocksList[j];
@@ -20,7 +17,7 @@
if (f >= 1.0F)
{
field_22050_k = false;
@@ -99,7 +102,7 @@
@@ -99,7 +101,7 @@
{
Block.blocksList[i1].onBlockClicked(thisWorld, i, j, k, thisPlayer);
}
@@ -29,7 +26,7 @@
{
blockHarvessted(i, j, k);
}
@@ -120,7 +123,7 @@
@@ -120,7 +122,7 @@
if (i1 != 0)
{
Block block = Block.blocksList[i1];
@@ -38,7 +35,7 @@
if (f >= 0.7F)
{
blockHarvessted(i, j, k);
@@ -142,8 +145,13 @@
@@ -142,8 +144,13 @@
{
Block block = Block.blocksList[thisWorld.getBlockId(i, j, k)];
int l = thisWorld.getBlockMetadata(i, j, k);
@@ -54,7 +51,7 @@
{
block.onBlockDestroyedByPlayer(thisWorld, i, j, k, l);
}
@@ -152,6 +160,11 @@
@@ -152,6 +159,11 @@
public boolean blockHarvessted(int i, int j, int k)
{
@@ -66,7 +63,7 @@
int l = thisWorld.getBlockId(i, j, k);
int i1 = thisWorld.getBlockMetadata(i, j, k);
thisWorld.playAuxSFXAtEntity(thisPlayer, 2001, i, j, k, l + thisWorld.getBlockMetadata(i, j, k) * 256);
@@ -162,8 +175,7 @@
@@ -162,8 +174,7 @@
}
else
{
@@ -76,7 +73,7 @@
if (itemstack != null)
{
itemstack.onDestroyBlock(l, i, j, k, thisPlayer);
@@ -197,6 +209,7 @@
@@ -197,6 +208,7 @@
if (itemstack1.stackSize == 0)
{
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null;
@@ -84,7 +81,7 @@
}
return true;
}
@@ -208,6 +221,14 @@
@@ -208,6 +220,14 @@
public boolean activeBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
{
@@ -99,7 +96,7 @@
int i1 = world.getBlockId(i, j, k);
if (i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer))
{
@@ -228,7 +249,15 @@
@@ -228,7 +248,15 @@
}
else
{
@@ -116,17 +113,3 @@
}
}
@@ -236,4 +265,13 @@
{
thisWorld = worldserver;
}
+
+ public double getBlockReachDistance()
+ {
+ return blockReachDistance;
+ }
+ public void setBlockReachDistance(double distance)
+ {
+ blockReachDistance = distance;
+ }
}
@@ -1,10 +0,0 @@
--- ../src_base/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
@@ -1325,6 +1325,7 @@
{
method_getNextWindowId.invoke(entityplayermp, new Object[0]);
int j = field_currentWindowId.getInt(entityplayermp);
+ entityplayermp.closeCraftingGui();
entityplayermp.playerNetServerHandler.sendPacket(new Packet100OpenWindow(j, i, iinventory.getInvName(), iinventory.getSizeInventory()));
entityplayermp.craftingInventory = container;
entityplayermp.craftingInventory.windowId = j;
@@ -1,24 +0,0 @@
--- ../src_base/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000
@@ -295,7 +295,9 @@
double d1 = (playerEntity.posY - ((double)j + 0.5D)) + 1.5D;
double d3 = playerEntity.posZ - ((double)k + 0.5D);
double d5 = d * d + d1 * d1 + d3 * d3;
- if (d5 > 36D)
+ double dist = playerEntity.itemInWorldManager.getBlockReachDistance() + 1;
+ dist *= dist;
+ if (d5 > dist)
{
return;
}
@@ -366,7 +368,9 @@
{
j1 = i1;
}
- if (hasMoved && playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64D && (j1 > 16 || flag))
+ double dist = playerEntity.itemInWorldManager.getBlockReachDistance() + 3;
+ dist *= dist;
+ if (hasMoved && playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && (j1 > 16 || flag))
{
playerEntity.itemInWorldManager.activeBlockOrUseItem(playerEntity, worldserver, itemstack, i, j, k, l);
}
@@ -0,0 +1,15 @@
--- ../src_base/minecraft_server/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/Packet230ModLoader.java 0000-00-00 00:00:00.000000000 -0000
@@ -74,7 +74,11 @@
}));
}
byte abyte0[] = new byte[k1];
- datainputstream.read(abyte0, 0, k1);
+ int bytesRead = 0;
+ while (bytesRead < k1)
+ {
+ bytesRead += datainputstream.read(abyte0, bytesRead, k1 - bytesRead);
+ }
dataString[j1] = new String(abyte0);
}
}
@@ -1,11 +0,0 @@
--- ../src_base/minecraft_server/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
@@ -20,7 +20,7 @@
if (length > 0 && length < 32767)
{
data = new byte[length];
- datainputstream.read(data);
+ datainputstream.readFully(data);
}
}
@@ -76,12 +76,3 @@
{
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
{
@@ -428,7 +425,7 @@
}
}
- static int getNAdjacentTracks(RailLogic raillogic)
+ public static int getNAdjacentTracks(RailLogic raillogic)
{
return raillogic.getAdjacentTracks();
}
@@ -88,7 +88,7 @@
}
- private int getItemBurnTime(ItemStack itemstack)
+ public static int getItemBurnTime(ItemStack itemstack)
+ public int getItemBurnTime(ItemStack itemstack)
{
if (itemstack == null)
{
@@ -178,7 +178,7 @@
@@ -3028,4 +3029,38 @@
{
return getChunkProvider().findClosestStructure(this, s, i, j, k);
return getChunkProvider().func_40182_a(this, s, i, j, k);
}
+
+ /**
+6 -6
View File
@@ -1,13 +1,13 @@
@cmd /C build.bat
cmd /C build.bat
@cd ..
cd ..
@echo | cmd /C reobfuscate.bat
cmd /C reobfuscate.bat
@set PATH=E:\cygwin\bin;%PATH%
set PATH=E:\cygwin\bin;%PATH%
@cd forge
cd forge
@sh package.sh
sh package.sh 1.3.0
pause
+2 -2
View File
@@ -5,7 +5,7 @@ pushd .. >nul
rmdir /S /Q src_base
rmdir /S /Q src_work
@echo | cmd /C decompile.bat
cmd /C decompile.bat
pushd src >nul
del minecraft\net\minecraft\src\MLProp.java
@@ -17,7 +17,7 @@ pushd .. >nul
del ..\forge\modLoaderMP-win.patch
popd >nul
@echo | cmd /C updatemd5.bat
cmd /C updatemd5.bat
mkdir src_base
mkdir src_work
-1
View File
@@ -1 +0,0 @@
1 3 2 0