Compare commits

..
21 Commits
Author SHA1 Message Date
Space Toad 9ca1255fc4 tagged 1.3.2 2012-01-29 13:28:11 +00:00
Space Toad e3b3920661 bumbed version number 2012-01-29 13:27:26 +00:00
LexManos 61dc035977 Potions are not armor. 2012-01-28 07:34:39 +00:00
LexManos 7a6193e8f5 Reorganized SpecialArmor code to work properly. 2012-01-28 07:09:55 +00:00
LexManos 92b2a3666e Some typo fixes 2012-01-28 06:16:58 +00:00
LexManos c6121b5676 Updated for MCP Mappings 2012-01-25 13:08:09 +00:00
LexManos 08195cfc03 Streamlined the Setup, Build and Package scripts:
On windows they no longer need the user to press enter every step
Moved version info out to version.txt, This will only effect the svn. If you update the version do it in version.txt not in ForgeHooks.java.
Introduced the build number into the version string.
Cleaned up some extra echos in scripts.
2012-01-25 07:00:31 +00:00
LexManos fa564fb3c5 Reach and Rail bugfix 2012-01-23 20:44:10 +00:00
Space Toad 224597aa3a bumped version number 2012-01-22 01:28:22 +00:00
LexManos 9f31de24aa Install.cmd now tries to add the system folder to the current path. 2012-01-21 19:45:03 +00:00
LexManos 86a5cfd48b Disabled updatenames int he isntall scripts till MCP fixes the reobf issue.
Updated to MLMP 1.1v2, Which says it fixes bugs it doesn't But it does fix the packet bug.
Fixed a bug in Packet 250.
2012-01-20 18:44:00 +00:00
LexManos 52a18ab02b Updated MCP mappings 2012-01-19 19:21:48 +00:00
LexManos a560c7bf9a Fixed the Minecart Drop bug 2012-01-19 00:53:18 +00:00
Eloraam b767ce84ab Fixed a bug that caused snowballs to drop incorrectly. 2012-01-18 03:03:34 +00:00
LexManos 3bb04f70ca Small update to ContainerCreative hook for better compatibility with mods that extend block IDs. 2012-01-17 21:03:08 +00:00
LexManos 2319eec68b Fixed getCartClassForItem and getCartTypeForItem 2012-01-17 16:48:09 +00:00
LexManos 3b5b9c5d1e Bug Fix for Chests staying open on MP Servers
Implemented reach distance variable
2012-01-17 03:44:52 +00:00
LexManos 43a89e61e9 Fixed a few accessors I missed:
Server RailLogic.getNAdjacentTracks public
Server TileEntityFurnace.getItemBurnTime static

New GUIControls change, Made it into a scroll panel instead of a static position window.
This just makes things look better when multiple mods with KeyBindings are installed
2012-01-17 02:03:29 +00:00
LexManos 078d3c2750 Fixed a mapping issue with client side TileEntityFurnace patch 2012-01-16 02:13:08 +00:00
Space Toad 0be5c34f01 added missing files 2012-01-15 23:40:23 +00:00
Space Toad 779d34372b removed files from previous version 2012-01-15 23:39:28 +00:00
58 changed files with 1653 additions and 1134 deletions

No files matched your search

+9 -5
View File
@@ -1,11 +1,15 @@
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
cmd /C recompile.bat
@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
+5
View File
@@ -10,6 +10,11 @@ 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
@@ -0,0 +1,123 @@
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,12 +300,13 @@ public class ForgeHooks {
}
public static final int majorVersion=1;
public static final int minorVersion=3;
public static final int majorVersion=0;
public static final int minorVersion=0;
public static final int revisionVersion=0;
public static final int buildVersion=0;
static {
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));
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));
}
static boolean toolInit=false;
@@ -699,7 +699,15 @@ public class MinecraftForge {
*/
public static Class<? extends EntityMinecart> getCartClassForItem(ItemStack item)
{
MinecartKey k = minecartForItem.get(item);
MinecartKey k = null;
for (ItemStack key : minecartForItem.keySet())
{
if (key.isItemEqual(item))
{
k = minecartForItem.get(k);
break;
}
}
if(k != null)
{
return k.minecart;
@@ -716,7 +724,15 @@ public class MinecraftForge {
*/
public static int getCartTypeForItem(ItemStack item)
{
MinecartKey k = minecartForItem.get(item);
MinecartKey k = null;
for (ItemStack key : minecartForItem.keySet())
{
if (key.isItemEqual(item))
{
k = minecartForItem.get(k);
break;
}
}
if(k != null)
{
return k.type;
+20
View File
@@ -0,0 +1,20 @@
@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
@@ -0,0 +1,14 @@
#!/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
+7 -4
View File
@@ -3,14 +3,16 @@ 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
cmd /C cleanup.bat
cmd /C decompile.bat
echo | call cleanup.bat
echo | call decompile.bat
if exist runtime\bin\fernflower.jar-backup move runtime\bin\fernflower.jar-backup runtime\bin\fernflower.jar
@@ -49,6 +51,7 @@ popd >nul
xcopy /Y /E forge\src\* src
cmd /C updatemcp.bat
cmd /C updatenames.bat
rem Removed until MCP's Update Names is fixed
rem cmd /C updatemcp.bat
rem cmd /C updatenames.bat
cmd /C updatemd5.bat
+3 -3
View File
@@ -53,7 +53,7 @@ popd > /dev/null
cp -r forge/src/* src
./updatemcp.sh
./updatenames.sh
# Removed until MCP's UpdateNames Is fixed
#./updatemcp.sh
#./updatenames.sh
./updatemd5.sh
+12 -6
View File
@@ -1,10 +1,11 @@
version=$1
read major minor revision build <version.txt
version=$major.$minor.$revision.$build
build_dir=`pwd`
dir=`pwd`/../forge-$version
function remove_svn () {
(
cd $1
cd "$1"
if [ -d .svn ]; then
rm -rf .svn
@@ -24,7 +25,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
@@ -34,8 +35,8 @@ cd ../reobf
remove_svn .
rm -rf $dir
mkdir $dir
rm -rf "$dir"
mkdir "$dir"
cd minecraft
package_all "-client"
@@ -71,6 +72,11 @@ 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
@@ -81,5 +87,5 @@ cd ..
cd ..
zip -r $dir/minecraftforge-src-$version.zip forge
zip -r "$dir/minecraftforge-src-$version.zip" forge
rm -rf forge
@@ -17,17 +17,16 @@
+ 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.multiplayerWorld)
- {
- return;
- if (world.isRemote)
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (meta == 7)
+ {
+ ret.add(new ItemStack(Item.wheat));
+ if (meta == 7)
{
- 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)
@@ -25,24 +25,20 @@
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
@@ -67,11 +66,9 @@
@@ -67,7 +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 (!canPlaceBlockAt(world, i, j, k))
+
if ((world.worldProvider instanceof WorldProviderEnd) && world.getBlockId(i, j - 1, k) == Block.bedrock.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
@@ -89,23 +86,23 @@
flag = true;
@@ -89,23 +90,23 @@
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
if (!flag && !func_263_h(world, i, j, k))
if (!flag && !canNeighborBurn(world, i, j, k))
{
- if (!world.isBlockNormalCube(i, j - 1, k) || l > 3)
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) || l > 3)
@@ -72,7 +68,7 @@
for (int i1 = i - 1; i1 <= i + 1; i1++)
{
for (int j1 = k - 1; j1 <= k + 1; j1++)
@@ -142,9 +139,24 @@
@@ -142,9 +143,24 @@
}
}
@@ -98,9 +94,9 @@
if (random.nextInt(l) < j1)
{
boolean flag = world.getBlockId(i, j, k) == Block.tnt.blockID;
@@ -170,27 +182,27 @@
@@ -170,27 +186,27 @@
private boolean func_263_h(World world, int i, int j, int k)
private boolean canNeighborBurn(World world, int i, int j, int k)
{
- if (canBlockCatchFire(world, i + 1, j, k))
+ if (canBlockCatchFire(world, i + 1, j, k, 4))
@@ -132,7 +128,7 @@
}
private int getChanceOfNeighborsEncouragingFire(World world, int i, int j, int k)
@@ -202,12 +214,12 @@
@@ -202,12 +218,12 @@
}
else
{
@@ -151,7 +147,7 @@
return l;
}
}
@@ -217,32 +229,32 @@
@@ -217,32 +233,32 @@
return false;
}
@@ -164,8 +160,7 @@
- return chanceToEncourageFire[iblockaccess.getBlockId(i, j, k)] > 0;
+ return canBlockCatchFire(iblockaccess, i, j, k, 0);
}
-
+
+ /**
+ * Deprecated for a side-sensitive version
+ */
@@ -181,41 +176,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) || func_263_h(world, i, j, k);
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || func_263_h(world, i, j, 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);
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
- 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))
- 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))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -259,7 +271,7 @@
@@ -259,7 +275,7 @@
{
return;
}
- 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))
- 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))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -277,7 +289,7 @@
@@ -277,7 +293,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))
+ if (world.isBlockSolidOnSide(i, j - 1, k, 1) || Block.fire.canBlockCatchFire(world, i, j - 1, k, 1))
{
for (int l = 0; l < 3; l++)
{
@@ -289,7 +301,7 @@
@@ -289,7 +305,7 @@
}
else
{
@@ -224,7 +219,7 @@
{
for (int i1 = 0; i1 < 2; i1++)
{
@@ -299,7 +311,7 @@
@@ -299,7 +315,7 @@
world.spawnParticle("largesmoke", f1, f7, f13, 0.0D, 0.0D, 0.0D);
}
}
@@ -233,7 +228,7 @@
{
for (int j1 = 0; j1 < 2; j1++)
{
@@ -309,7 +321,7 @@
@@ -309,7 +325,7 @@
world.spawnParticle("largesmoke", f2, f8, f14, 0.0D, 0.0D, 0.0D);
}
}
@@ -242,7 +237,7 @@
{
for (int k1 = 0; k1 < 2; k1++)
{
@@ -319,7 +331,7 @@
@@ -319,7 +335,7 @@
world.spawnParticle("largesmoke", f3, f9, f15, 0.0D, 0.0D, 0.0D);
}
}
@@ -251,7 +246,7 @@
{
for (int l1 = 0; l1 < 2; l1++)
{
@@ -329,7 +341,7 @@
@@ -329,7 +345,7 @@
world.spawnParticle("largesmoke", f4, f10, f16, 0.0D, 0.0D, 0.0D);
}
}
@@ -260,7 +255,7 @@
{
for (int i2 = 0; i2 < 2; i2++)
{
@@ -341,4 +353,41 @@
@@ -341,4 +357,39 @@
}
}
}
@@ -284,7 +279,6 @@
+ 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)
+ {
@@ -299,6 +293,5 @@
+ {
+ return l;
+ }
+ }
+
+ }
}
@@ -7,7 +7,7 @@
import java.util.Random;
public class BlockNetherStalk extends BlockFlower
@@ -57,25 +58,25 @@
@@ -57,25 +58,24 @@
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.multiplayerWorld)
- if (world.isRemote)
- {
- return;
- }
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
int j1 = 1;
- if (l >= 3)
+ if (meta >= 3)
@@ -37,7 +37,6 @@
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
+ ret.add(new ItemStack(Item.netherStalkSeeds));
}
+
+ return ret;
}
@@ -1,6 +1,14 @@
--- ../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
@@ -75,15 +75,7 @@
@@ -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 @@
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
@@ -17,7 +25,7 @@
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
}
@@ -94,7 +86,7 @@
@@ -94,14 +85,13 @@
public int quantityDropped(Random random)
{
@@ -26,3 +34,10 @@
}
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.multiplayerWorld && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
if (!world.isRemote && 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.func_41082_b(i, j, k, true))
- if (world.isBlockNormalCubeDefault(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.func_41082_b(i - 1, j, k, true))
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
return true;
}
- if (world.func_41082_b(i + 1, j, k, true))
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
return true;
}
- if (world.func_41082_b(i, j, k - 1, true))
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
return true;
}
- if (world.func_41082_b(i, j, k + 1, true))
- if (world.isBlockNormalCubeDefault(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.func_41082_b(i, j, k + 1, true))
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
{
i1 = 4;
}
- if (l == 3 && world.func_41082_b(i, j, k - 1, true))
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
{
i1 = 3;
}
- if (l == 4 && world.func_41082_b(i + 1, j, k, true))
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
{
i1 = 2;
}
- if (l == 5 && world.func_41082_b(i - 1, j, k, true))
- if (l == 5 && world.isBlockNormalCubeDefault(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.func_41082_b(i - 1, j, k, true))
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
world.setBlockMetadataWithNotify(i, j, k, 1);
}
- else if (world.func_41082_b(i + 1, j, k, true))
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
- else if (world.func_41082_b(i, j, k - 1, true))
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
- else if (world.func_41082_b(i, j, k + 1, true))
- else if (world.isBlockNormalCubeDefault(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.func_41082_b(i - 1, j, k, true) && i1 == 1)
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
{
flag = true;
}
- if (!world.func_41082_b(i + 1, j, k, true) && i1 == 2)
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
{
flag = true;
}
- if (!world.func_41082_b(i, j, k - 1, true) && i1 == 3)
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
{
flag = true;
}
- if (!world.func_41082_b(i, j, k + 1, true) && i1 == 4)
- if (!world.isBlockNormalCubeDefault(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 (!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)))
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
+ if (!(isValidSupportBlock(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 func_41052_f(world.getBlockId(i, j, k));
+ return func_41052_f(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
- return isValidSupportBlock(world.getBlockId(i, j, k));
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
}
public static boolean isTrapdoorOpen(int i)
@@ -215,6 +222,11 @@
private static boolean func_41052_f(int i)
private static boolean isValidSupportBlock(int i)
{
+ if (disableValidation)
+ {
@@ -44,7 +44,7 @@
if (k1 != 0)
{
- Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ if (!worldObj.multiplayerWorld)
+ if (!worldObj.isRemote)
+ {
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ }
@@ -1,34 +1,28 @@
--- ../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
@@ -64,20 +64,23 @@
}
@@ -65,17 +65,20 @@
itemList.add(new ItemStack(ablock[l1], 1, k2));
}
-
+
+ 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++)
- 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.field_44019_bC.shiftedIndex)
+ if (Item.itemsList[i2] != null)
- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.monsterPlacer.shiftedIndex)
+ if (Block.blocksList[x] != null)
{
- itemList.add(new ItemStack(Item.itemsList[i2]));
+ Item.itemsList[i2].addCreativeItems((ArrayList)itemList);
+ Block.blocksList[x].addCreativeItems((ArrayList)itemList);
}
}
- for (int j2 = 1; j2 < 16; j2++)
- {
- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2));
- }
-
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())))
+ 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;
@@ -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 ignoreFrustumCheck;
public boolean ignoreFrustrumCheck;
public boolean isAirBorne;
+
+ //Forge: Used to store custom data for each entity.
@@ -28,11 +28,11 @@
{
{
{
@@ -76,16 +81,36 @@
@@ -76,16 +81,35 @@
}
}
};
- private int minecartPosRotationIncrements;
- private int turnProgress;
- private double minecartX;
- private double minecartY;
- private double minecartZ;
@@ -42,7 +42,7 @@
- private double velocityY;
- private double velocityZ;
-
+ protected int minecartPosRotationIncrements;
+ protected int turnProgress;
+ protected double minecartX;
+ protected double minecartY;
+ protected double minecartZ;
@@ -51,9 +51,8 @@
+ 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;
@@ -62,7 +61,7 @@
+ protected boolean canUseRail = true;
+ protected boolean canBePushed = true;
+ private static IMinecartCollisionHandler collisionHandler = null;
+
+
+ /*
+ * Instance versions of the above physics properties
+ */
@@ -70,12 +69,12 @@
+ protected float maxSpeedGround;
+ protected float maxSpeedAirLateral;
+ protected float maxSpeedAirVertical;
+ protected double dragAir;
+ protected double dragAir;
+
public EntityMinecart(World world)
{
super(world);
@@ -95,6 +120,18 @@
@@ -95,6 +119,18 @@
preventEntitySpawning = true;
setSize(0.98F, 0.7F);
yOffset = height / 2.0F;
@@ -94,7 +93,7 @@
}
protected boolean canTriggerWalking()
@@ -112,17 +149,27 @@
@@ -112,17 +148,27 @@
public AxisAlignedBB getCollisionBox(Entity entity)
{
@@ -123,20 +122,59 @@
}
public EntityMinecart(World world, double d, double d1, double d2,
@@ -197,12 +244,6 @@
}
while (true);
}
@@ -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);
- }
-
- dropItemWithOffset(Block.chest.blockID, 1, 0.0F);
- }
- else if (minecartType == 2)
- {
- dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F);
}
- }
+
+ dropCartAsItem();
}
return true;
@@ -268,7 +309,7 @@
}
@@ -268,7 +273,7 @@
{
func_41024_b(func_41025_i() - 1);
}
@@ -145,7 +183,7 @@
{
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
}
@@ -309,22 +350,18 @@
@@ -309,22 +314,18 @@
double d2 = 0.40000000000000002D;
double d4 = 0.0078125D;
int l = worldObj.getBlockId(i, j, k);
@@ -171,7 +209,7 @@
if (i1 >= 2 && i1 <= 5)
{
posY = j + 1;
@@ -358,7 +395,7 @@
@@ -358,7 +359,7 @@
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (d13 * d9) / d11;
motionZ = (d13 * d10) / d11;
@@ -180,7 +218,7 @@
{
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d16 < 0.029999999999999999D)
@@ -401,30 +438,9 @@
@@ -401,30 +402,9 @@
posX = d18 + d9 * d17;
posZ = d19 + d10 * d17;
setPosition(posX, posY + (double)yOffset, posZ);
@@ -214,7 +252,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 +449,9 @@
@@ -433,39 +413,9 @@
{
setPosition(posX, posY + (double)ai[1][1], posZ);
}
@@ -257,7 +295,7 @@
Vec3D vec3d1 = func_514_g(posX, posY, posZ);
if (vec3d1 != null && vec3d != null)
{
@@ -486,26 +472,14 @@
@@ -486,26 +436,14 @@
motionX = d15 * (double)(k1 - i);
motionZ = d15 * (double)(l1 - k);
}
@@ -290,7 +328,7 @@
{
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D)
@@ -540,35 +514,7 @@
@@ -540,35 +478,7 @@
}
else
{
@@ -327,7 +365,7 @@
}
rotationPitch = 0.0F;
double d6 = prevPosX - posX;
@@ -590,7 +536,20 @@
@@ -590,7 +500,20 @@
field_856_i = !field_856_i;
}
setRotation(rotationYaw, rotationPitch);
@@ -349,7 +387,7 @@
if (list != null && list.size() > 0)
{
for (int j1 = 0; j1 < list.size(); j1++)
@@ -610,15 +569,8 @@
@@ -610,15 +533,8 @@
}
riddenByEntity = null;
}
@@ -367,7 +405,7 @@
}
public Vec3D func_515_a(double d, double d1, double d2, double d3)
@@ -633,11 +585,7 @@
@@ -633,11 +549,7 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@@ -380,7 +418,7 @@
d1 = j;
if (i1 >= 2 && i1 <= 5)
{
@@ -679,12 +627,8 @@
@@ -679,12 +591,8 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@@ -394,7 +432,7 @@
if (i1 >= 2 && i1 <= 5)
{
d1 = j + 1;
@@ -739,13 +683,13 @@
@@ -739,13 +647,13 @@
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
nbttagcompound.setInteger("Type", minecartType);
@@ -411,7 +449,7 @@
{
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < cargoItems.length; i++)
@@ -766,13 +710,13 @@
@@ -766,13 +674,13 @@
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
minecartType = nbttagcompound.getInteger("Type");
@@ -428,20 +466,20 @@
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
cargoItems = new ItemStack[getSizeInventory()];
@@ -795,6 +739,12 @@
@@ -795,6 +703,12 @@
public void applyEntityCollision(Entity entity)
{
+ ForgeHooks.onMinecartEntityCollision(this, entity);
+ if (getCollisionHandler() != null)
+ {
+ getCollisionHandler().onEntityCollision(this, entity);
+ return;
+ }
if (worldObj.multiplayerWorld)
+ ForgeHooks.onMinecartEntityCollision(this, entity);
+ if (getCollisionHandler() != null)
+ {
+ getCollisionHandler().onEntityCollision(this, entity);
+ return;
+ }
if (worldObj.isRemote)
{
return;
@@ -803,7 +753,7 @@
@@ -803,7 +717,7 @@
{
return;
}
@@ -450,7 +488,7 @@
{
entity.mountEntity(this);
}
@@ -841,7 +791,7 @@
@@ -841,7 +755,7 @@
}
double d7 = entity.motionX + motionX;
double d8 = entity.motionZ + motionZ;
@@ -459,7 +497,7 @@
{
motionX *= 0.20000000298023224D;
motionZ *= 0.20000000298023224D;
@@ -849,7 +799,7 @@
@@ -849,7 +763,7 @@
entity.motionX *= 0.94999998807907104D;
entity.motionZ *= 0.94999998807907104D;
}
@@ -468,7 +506,7 @@
{
entity.motionX *= 0.20000000298023224D;
entity.motionZ *= 0.20000000298023224D;
@@ -879,7 +829,7 @@
@@ -879,7 +793,7 @@
public int getSizeInventory()
{
@@ -477,7 +515,7 @@
}
public ItemStack getStackInSlot(int i)
@@ -935,7 +885,11 @@
@@ -935,7 +849,11 @@
public boolean interact(EntityPlayer entityplayer)
{
@@ -490,14 +528,14 @@
{
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
{
@@ -946,14 +900,14 @@
@@ -946,14 +864,14 @@
entityplayer.mountEntity(this);
}
}
- else if (minecartType == 1)
+ else if (getSizeInventory() > 0)
{
if (!worldObj.multiplayerWorld)
if (!worldObj.isRemote)
{
entityplayer.displayGUIChest(this);
}
@@ -507,7 +545,7 @@
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex)
@@ -1000,7 +954,7 @@
@@ -1000,7 +918,7 @@
return entityplayer.getDistanceSqToEntity(this) <= 64D;
}
@@ -516,7 +554,7 @@
{
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
}
@@ -1054,4 +1008,382 @@
@@ -1054,4 +972,382 @@
{
return dataWatcher.getWatchableObjectInt(18);
}
@@ -93,35 +93,34 @@
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -764,6 +820,27 @@
protected void damageEntity(DamageSource damagesource, int i)
{
+ boolean doRegularComputation = true;
@@ -768,7 +824,25 @@
{
i = 1 + i >> 1;
}
- i = applyArmorCalculations(damagesource, 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)
+ {
+ super.damageEntity(damagesource, i);
+ return;
+ i = applyArmorCalculations(damagesource, i);
+ }
+
if (!damagesource.isUnblockable() && isBlocking())
{
i = 1 + i >> 1;
@@ -815,7 +892,9 @@
i = applyPotionDamageCalculations(damagesource, i);
addExhaustion(damagesource.getHungerDamage());
health -= i;
@@ -815,7 +889,9 @@
public void destroyCurrentEquippedItem()
{
@@ -131,15 +130,15 @@
}
public double getYOffset()
@@ -947,6 +1026,11 @@
@@ -947,6 +1023,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.multiplayerWorld)
+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, i, j, k);
+ if (customSleep != null)
+ {
+ return customSleep;
+ }
if (!worldObj.isRemote)
{
if (isPlayerSleeping() || !isEntityAlive())
@@ -0,0 +1,122 @@
--- ../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 potionModifier;
private String potionEffect;
private String itemName;
+ // FORGE: To disable repair recipes.
@@ -18,6 +18,15 @@
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);
@@ -32,7 +41,7 @@
+ */
+ public void addCreativeItems(ArrayList itemList)
+ {
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.field_44019_bC.shiftedIndex)
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
+ {
+ itemList.add(new ItemStack(this, 1));
+ }
@@ -18,7 +18,7 @@
+
+ if (ForgeHooks.onUseBonemeal(world, i1, i, j, k))
+ {
+ if (!world.multiplayerWorld)
+ if (!world.isRemote)
+ {
+ itemstack.stackSize--;
+ }
@@ -27,7 +27,7 @@
+
if (i1 == Block.sapling.blockID)
{
if (!world.multiplayerWorld)
if (!world.isRemote)
@@ -109,14 +122,7 @@
world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
continue;
@@ -1,15 +0,0 @@
--- ../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);
}
}
@@ -0,0 +1,11 @@
--- ../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.stepSoundDir2(), (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.getStepSound(), (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.stepSoundDir2(), (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.getStepSound(), (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].equals(itemstack))
+ else if (furnaceItemStacks[2].isItemEqual(itemstack))
{
- furnaceItemStacks[2].stackSize++;
+ furnaceItemStacks[2].stackSize += itemstack.stackSize;
@@ -158,7 +158,7 @@
+ }
}
public void markEntityForDespawn(TileEntity tileentity)
public void markTileEntityForDespawn(TileEntity tileentity)
@@ -2109,7 +2104,7 @@
}
else
@@ -190,7 +190,7 @@
@@ -3493,4 +3492,39 @@
{
return worldInfo.func_46133_t() != EnumWorldType.FLAT ? 63D : 0.0D;
return worldInfo.getTerrainType() != EnumWorldType.FLAT ? 63D : 0.0D;
}
+
+
@@ -14,23 +14,21 @@
- 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.singleplayerWorld)
- if (world.isRemote)
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (meta == 7)
+ {
+ ret.add(new ItemStack(Item.wheat));
+ }
+
+ for(int n = 0; n < 3 + fortune; n++)
+ if (meta == 7)
{
- 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,19 +25,20 @@
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
@@ -67,7 +66,8 @@
@@ -67,7 +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;
+ 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 +89,23 @@
@@ -89,23 +90,23 @@
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
if (!flag && !func_268_g(world, i, j, k))
if (!flag && !canNeighborBurn(world, i, j, k))
{
- if (!world.isBlockNormalCube(i, j - 1, k) || l > 3)
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 0) || l > 3)
@@ -67,78 +68,58 @@
for (int i1 = i - 1; i1 <= i + 1; i1++)
{
for (int j1 = k - 1; j1 <= k + 1; j1++)
@@ -142,55 +142,66 @@
@@ -142,9 +143,24 @@
}
}
+ /**
+ * 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)];
- if (random.nextInt(l) < j1)
+ tryToCatchBlockOnFire(world, i, j, k, l, random, i1, 0);
+ 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)
+ {
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ int j1 = 0;
+ if (block != null)
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
+ 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;
- 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);
}
}
}
@@ -170,27 +186,27 @@
+
private boolean func_268_g(World world, int i, int j, int k)
private boolean canNeighborBurn(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;
}
@@ -147,7 +128,7 @@
}
private int getChanceOfNeighborsEncouragingFire(World world, int i, int j, int k)
@@ -202,12 +213,12 @@
@@ -202,12 +218,12 @@
}
else
{
@@ -166,73 +147,98 @@
return l;
}
}
@@ -217,19 +228,40 @@
@@ -217,32 +233,32 @@
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 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;
- {
- return i1;
- }
- else
+ } else
{
return l;
}
@@ -237,12 +269,12 @@
- {
- return l;
- }
+ 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) || func_268_g(world, i, j, k);
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || func_268_g(world, i, j, 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);
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
- 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))
- 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))
{
world.setBlockWithNotify(i, j, k, 0);
return;
@@ -259,7 +291,7 @@
@@ -259,7 +275,7 @@
{
return;
}
- 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))
- 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))
{
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,48 +7,37 @@
import java.util.Random;
public class BlockNetherStalk extends BlockFlower
@@ -57,25 +58,26 @@
@@ -57,25 +58,24 @@
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 metadata, int fortune)
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
{
- if (world.singleplayerWorld)
- if (world.isRemote)
- {
- return;
- }
- int j1 = 1;
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
int j1 = 1;
- if (l >= 3)
- {
- j1 = 2 + world.rand.nextInt(3);
+ if (meta >= 3)
{
j1 = 2 + world.rand.nextInt(3);
- if (i1 > 0)
- {
+ if (fortune > 0)
{
- j1 += world.rand.nextInt(i1 + 1);
- }
- }
- for (int k1 = 0; k1 < j1; k1++)
- {
+ j1 += world.rand.nextInt(fortune + 1);
}
}
for (int k1 = 0; k1 < j1; k1++)
{
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
- }
+ 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;
+
+ 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, l, l)));
+ return !(Block.blocksList[i] != null && Block.blocksList[i].hasTileEntity(world.getBlockMetadata(j, k, l)));
}
private static boolean canExtend(World world, int i, int j, int k, int l)
@@ -50,7 +50,12 @@
}
public void onBlockAdded(World world, int i, int j, int k)
@@ -123,19 +136,19 @@
@@ -119,23 +132,23 @@
j1 &= 7;
}
boolean flag = false;
- if (!world.isBlockNormalCube(i, j - 1, k))
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
{
flag = true;
}
@@ -1,6 +1,14 @@
--- ../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
@@ -75,15 +75,7 @@
@@ -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 @@
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
@@ -17,7 +25,7 @@
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
}
@@ -94,7 +86,7 @@
@@ -94,14 +85,13 @@
public int quantityDropped(Random random)
{
@@ -26,3 +34,10 @@
}
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.func_41047_b(i, j, k, true))
+ if(world.isBlockSolidOnSide(i, j, k, 1))
- if (world.isBlockNormalCubeDefault(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.func_41047_b(i - 1, j, k, true))
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
return true;
}
- if (world.func_41047_b(i + 1, j, k, true))
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
return true;
}
- if (world.func_41047_b(i, j, k - 1, true))
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
return true;
}
- if (world.func_41047_b(i, j, k + 1, true))
- if (world.isBlockNormalCubeDefault(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.func_41047_b(i, j, k + 1, true))
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
{
i1 = 4;
}
- if (l == 3 && world.func_41047_b(i, j, k - 1, true))
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
{
i1 = 3;
}
- if (l == 4 && world.func_41047_b(i + 1, j, k, true))
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
{
i1 = 2;
}
- if (l == 5 && world.func_41047_b(i - 1, j, k, true))
- if (l == 5 && world.isBlockNormalCubeDefault(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.func_41047_b(i - 1, j, k, true))
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
{
world.setBlockMetadataWithNotify(i, j, k, 1);
}
- else if (world.func_41047_b(i + 1, j, k, true))
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
- else if (world.func_41047_b(i, j, k - 1, true))
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
- else if (world.func_41047_b(i, j, k + 1, true))
- else if (world.isBlockNormalCubeDefault(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.func_41047_b(i - 1, j, k, true) && i1 == 1)
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
{
flag = true;
}
- if (!world.func_41047_b(i + 1, j, k, true) && i1 == 2)
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
{
flag = true;
}
- if (!world.func_41047_b(i, j, k - 1, true) && i1 == 3)
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
{
flag = true;
}
- if (!world.func_41047_b(i, j, k + 1, true) && i1 == 4)
- if (!world.isBlockNormalCubeDefault(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 (!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)))
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
+ if (!(isValidSupportBlock(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 func_41006_g(world.getBlockId(i, j, k));
+ return func_41006_g(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
- return isValidSupportBlock(world.getBlockId(i, j, k));
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
}
public static boolean isTrapdoorOpen(int i)
@@ -39,11 +39,12 @@
isModified = true;
return true;
}
@@ -392,6 +384,11 @@
@@ -391,7 +383,11 @@
blocks[i << worldObj.xShift | k << worldObj.heightShift | j] = (byte)(byte0 & 0xff);
if (k1 != 0)
{
Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ if (!worldObj.singleplayerWorld)
- Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ if (!worldObj.isRemote)
+ {
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
+ }
@@ -51,7 +52,7 @@
}
data.setNibble(i, j, k, 0);
if (Block.lightOpacity[byte0 & 0xff] != 0)
@@ -414,28 +411,22 @@
@@ -414,28 +410,22 @@
{
Block.blocksList[l].onBlockAdded(worldObj, l1, j, i2);
}
@@ -84,7 +85,7 @@
isModified = true;
return true;
}
@@ -455,7 +446,7 @@
@@ -455,7 +445,7 @@
}
data.setNibble(i, j, k, l);
int j1 = getBlockID(i, j, k);
@@ -93,7 +94,7 @@
{
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
if (tileentity != null)
@@ -572,29 +563,27 @@
@@ -572,29 +562,27 @@
{
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
@@ -132,7 +133,7 @@
}
public void addTileEntity(TileEntity tileentity)
@@ -605,7 +594,7 @@
@@ -605,7 +593,7 @@
setChunkBlockTileEntity(i, j, k, tileentity);
if (isChunkLoaded)
{
@@ -141,7 +142,7 @@
}
}
@@ -616,12 +605,18 @@
@@ -616,12 +604,18 @@
tileentity.xCoord = xPosition * 16 + i;
tileentity.yCoord = j;
tileentity.zCoord = zPosition * 16 + k;
@@ -161,7 +162,7 @@
tileentity.validate();
chunkTileEntityMap.put(chunkposition, tileentity);
return;
@@ -903,4 +898,18 @@
@@ -903,4 +897,18 @@
{
return new ChunkCoordIntPair(xPosition, zPosition);
}
@@ -28,7 +28,7 @@
{
{
{
@@ -76,13 +81,36 @@
@@ -76,12 +81,35 @@
}
}
};
@@ -36,27 +36,25 @@
- private double minecartX;
- private double minecartY;
- private double minecartZ;
- private double field_9159_ar;
- private double minecartYaw;
- private double minecartPitch;
-
+ protected int turnProgress;
+ protected double minecartX;
+ protected double minecartY;
+ protected double minecartZ;
+ protected double field_9159_ar;
+ protected double minecartYaw;
+ 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;
+
@@ -67,11 +65,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);
@@ -120,33 +118,59 @@
}
public EntityMinecart(World world, double d, double d1, double d2,
@@ -158,8 +208,10 @@
@@ -158,49 +208,8 @@
riddenByEntity.mountEntity(this);
}
setEntityDead();
- dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F);
- if (minecartType == 1)
+
+ dropCartAsItem();
+
+ if (getSizeInventory() > 0)
{
EntityMinecart entityminecart = this;
label0:
@@ -194,12 +246,6 @@
}
while (true);
}
- {
- 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);
- }
-
- dropItemWithOffset(Block.chest.blockID, 1, 0.0F);
- }
- else if (minecartType == 2)
- {
- dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F);
}
- }
+
+ dropCartAsItem();
}
return true;
@@ -258,7 +304,7 @@
}
@@ -258,7 +267,7 @@
{
func_41018_e_(func_41020_o() - 1);
}
@@ -155,7 +179,7 @@
{
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
}
@@ -299,22 +345,18 @@
@@ -299,22 +308,18 @@
double d2 = 0.40000000000000002D;
double d4 = 0.0078125D;
int l = worldObj.getBlockId(i, j, k);
@@ -181,7 +205,7 @@
if (i1 >= 2 && i1 <= 5)
{
posY = j + 1;
@@ -348,7 +390,7 @@
@@ -348,7 +353,7 @@
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (d13 * d9) / d11;
motionZ = (d13 * d10) / d11;
@@ -190,7 +214,7 @@
{
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d16 < 0.029999999999999999D)
@@ -391,30 +433,9 @@
@@ -391,30 +396,9 @@
posX = d18 + d9 * d17;
posZ = d19 + d10 * d17;
setPosition(posX, posY + (double)yOffset, posZ);
@@ -224,7 +248,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 +444,9 @@
@@ -423,39 +407,9 @@
{
setPosition(posX, posY + (double)ai[1][1], posZ);
}
@@ -267,7 +291,7 @@
Vec3D vec3d1 = func_182_g(posX, posY, posZ);
if (vec3d1 != null && vec3d != null)
{
@@ -476,26 +467,14 @@
@@ -476,26 +430,14 @@
motionX = d15 * (double)(k1 - i);
motionZ = d15 * (double)(l1 - k);
}
@@ -300,7 +324,7 @@
{
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D)
@@ -530,35 +509,7 @@
@@ -530,35 +472,7 @@
}
else
{
@@ -337,7 +361,7 @@
}
rotationPitch = 0.0F;
double d6 = prevPosX - posX;
@@ -580,7 +531,19 @@
@@ -580,7 +494,19 @@
field_469_aj = !field_469_aj;
}
setRotation(rotationYaw, rotationPitch);
@@ -358,7 +382,7 @@
if (list != null && list.size() > 0)
{
for (int j1 = 0; j1 < list.size(); j1++)
@@ -600,15 +563,9 @@
@@ -600,15 +526,9 @@
}
riddenByEntity = null;
}
@@ -377,7 +401,7 @@
}
public Vec3D func_182_g(double d, double d1, double d2)
@@ -623,12 +580,8 @@
@@ -623,12 +543,8 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@@ -391,7 +415,7 @@
if (i1 >= 2 && i1 <= 5)
{
d1 = j + 1;
@@ -683,13 +636,14 @@
@@ -683,13 +599,14 @@
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
nbttagcompound.setInteger("Type", minecartType);
@@ -409,7 +433,7 @@
{
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < cargoItems.length; i++)
@@ -702,7 +656,6 @@
@@ -702,7 +619,6 @@
nbttaglist.setTag(nbttagcompound1);
}
}
@@ -417,7 +441,7 @@
nbttagcompound.setTag("Items", nbttaglist);
}
}
@@ -710,13 +663,14 @@
@@ -710,13 +626,14 @@
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
minecartType = nbttagcompound.getInteger("Type");
@@ -435,21 +459,20 @@
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
cargoItems = new ItemStack[getSizeInventory()];
@@ -734,6 +688,13 @@
@@ -734,6 +651,12 @@
public void applyEntityCollision(Entity entity)
{
+ ForgeHooks.onMinecartEntityCollision(this, entity);
+
+ if (getCollisionHandler() != null)
+ {
+ getCollisionHandler().onEntityCollision(this, entity);
+ return;
+ }
if (worldObj.singleplayerWorld)
+ }
if (worldObj.isRemote)
{
return;
@@ -742,7 +703,7 @@
@@ -742,7 +665,7 @@
{
return;
}
@@ -458,7 +481,7 @@
{
entity.mountEntity(this);
}
@@ -780,7 +741,7 @@
@@ -780,7 +703,7 @@
}
double d7 = entity.motionX + motionX;
double d8 = entity.motionZ + motionZ;
@@ -467,7 +490,7 @@
{
motionX *= 0.20000000298023224D;
motionZ *= 0.20000000298023224D;
@@ -788,7 +749,7 @@
@@ -788,7 +711,7 @@
entity.motionX *= 0.94999998807907104D;
entity.motionZ *= 0.94999998807907104D;
}
@@ -476,7 +499,7 @@
{
entity.motionX *= 0.20000000298023224D;
entity.motionZ *= 0.20000000298023224D;
@@ -818,7 +779,7 @@
@@ -818,7 +741,7 @@
public int getSizeInventory()
{
@@ -485,7 +508,7 @@
}
public ItemStack getStackInSlot(int i)
@@ -874,7 +835,12 @@
@@ -874,7 +797,12 @@
public boolean interact(EntityPlayer entityplayer)
{
@@ -499,24 +522,24 @@
{
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
{
@@ -885,14 +851,14 @@
@@ -885,14 +813,14 @@
entityplayer.mountEntity(this);
}
}
- else if (minecartType == 1)
+ else if (getSizeInventory() > 0)
{
if (!worldObj.singleplayerWorld)
if (!worldObj.isRemote)
{
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 +884,7 @@
@@ -918,7 +846,7 @@
return entityplayer.getDistanceSqToEntity(this) <= 64D;
}
@@ -525,7 +548,7 @@
{
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
}
@@ -971,5 +937,384 @@
@@ -971,5 +899,384 @@
public int func_41021_q()
{
return dataWatcher.getWatchableObjectInt(18);
@@ -19,7 +19,18 @@
if (itemInUseCount <= 25 && itemInUseCount % 4 == 0)
{
func_35208_b(itemstack, 5);
@@ -433,7 +438,16 @@
@@ -274,6 +279,10 @@
protected void closeScreen()
{
+ if (craftingInventory != null)
+ {
+ craftingInventory.onCraftGuiClosed(this);
+ }
craftingInventory = inventorySlots;
}
@@ -433,7 +442,16 @@
public void dropCurrentItem()
{
@@ -37,7 +48,7 @@
}
public void dropPlayerItem(ItemStack itemstack)
@@ -480,6 +494,8 @@
@@ -480,6 +498,8 @@
worldObj.spawnEntityInWorld(entityitem);
}
@@ -46,7 +57,7 @@
public float getCurrentPlayerStrVsBlock(Block block)
{
float f = inventory.getStrVsBlock(block);
@@ -508,6 +524,45 @@
@@ -508,6 +528,45 @@
return f1;
}
@@ -92,10 +103,12 @@
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -707,6 +762,26 @@
protected void damageEntity(DamageSource damagesource, int i)
{
@@ -711,7 +770,25 @@
{
i = 1 + i >> 1;
}
- i = applyArmorCalculations(damagesource, i);
+
+ boolean doRegularComputation = true;
+ int initialDamage = i;
+
@@ -103,23 +116,21 @@
+ {
+ 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)
+ {
+ super.damageEntity(damagesource, i);
+ return;
+ i = applyArmorCalculations(damagesource, i);
+ }
+
if (!damagesource.isUnblockable() && isBlocking())
{
i = 1 + i >> 1;
@@ -758,7 +833,9 @@
i = applyPotionDamageCalculations(damagesource, i);
addExhaustion(damagesource.getHungerDamage());
health -= i;
@@ -758,7 +835,9 @@
public void destroyCurrentEquippedItem()
{
@@ -129,15 +140,15 @@
}
public double getYOffset()
@@ -884,6 +961,11 @@
@@ -884,6 +963,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.singleplayerWorld)
if (!worldObj.isRemote)
{
if (isPlayerSleeping() || !isEntityAlive())
@@ -0,0 +1,50 @@
--- ../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 potionInfo;
private String potionEffect;
private String itemName;
+ // FORGE: To disable repair recipes.
@@ -18,7 +18,15 @@
protected Item(int i)
{
maxStackSize = 64;
@@ -393,6 +397,109 @@
@@ -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);
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, flag, !flag);
return movingobjectposition;
}
@@ -32,7 +40,7 @@
+ */
+ public void addCreativeItems(ArrayList itemList)
+ {
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.field_44008_bB.shiftedIndex)
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.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.singleplayerWorld)
+ if (!world.isRemote)
+ {
+ itemstack.stackSize--;
+ }
@@ -32,7 +32,7 @@
+ }
if (i1 == Block.sapling.blockID)
{
if (!world.singleplayerWorld)
if (!world.isRemote)
@@ -103,14 +113,7 @@
world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
continue;
@@ -1,14 +1,17 @@
--- ../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,5 +1,7 @@
@@ -1,7 +1,10 @@
package net.minecraft.src;
+import net.minecraft.src.forge.ForgeHooks;
+
public class ItemInWorldManager
{
+ private double blockReachDistance = 5.0d;
public World thisWorld;
@@ -71,7 +73,7 @@
public EntityPlayer thisPlayer;
private int gameType;
@@ -71,7 +74,7 @@
if (j != 0)
{
Block block = Block.blocksList[j];
@@ -17,7 +20,7 @@
if (f >= 1.0F)
{
field_22050_k = false;
@@ -99,7 +101,7 @@
@@ -99,7 +102,7 @@
{
Block.blocksList[i1].onBlockClicked(thisWorld, i, j, k, thisPlayer);
}
@@ -26,7 +29,7 @@
{
blockHarvessted(i, j, k);
}
@@ -120,7 +122,7 @@
@@ -120,7 +123,7 @@
if (i1 != 0)
{
Block block = Block.blocksList[i1];
@@ -35,7 +38,7 @@
if (f >= 0.7F)
{
blockHarvessted(i, j, k);
@@ -142,8 +144,13 @@
@@ -142,8 +145,13 @@
{
Block block = Block.blocksList[thisWorld.getBlockId(i, j, k)];
int l = thisWorld.getBlockMetadata(i, j, k);
@@ -51,7 +54,7 @@
{
block.onBlockDestroyedByPlayer(thisWorld, i, j, k, l);
}
@@ -152,6 +159,11 @@
@@ -152,6 +160,11 @@
public boolean blockHarvessted(int i, int j, int k)
{
@@ -63,7 +66,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 +174,7 @@
@@ -162,8 +175,7 @@
}
else
{
@@ -73,7 +76,7 @@
if (itemstack != null)
{
itemstack.onDestroyBlock(l, i, j, k, thisPlayer);
@@ -197,6 +208,7 @@
@@ -197,6 +209,7 @@
if (itemstack1.stackSize == 0)
{
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null;
@@ -81,7 +84,7 @@
}
return true;
}
@@ -208,6 +220,14 @@
@@ -208,6 +221,14 @@
public boolean activeBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
{
@@ -96,7 +99,7 @@
int i1 = world.getBlockId(i, j, k);
if (i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer))
{
@@ -228,7 +248,15 @@
@@ -228,7 +249,15 @@
}
else
{
@@ -113,3 +116,17 @@
}
}
@@ -236,4 +265,13 @@
{
thisWorld = worldserver;
}
+
+ public double getBlockReachDistance()
+ {
+ return blockReachDistance;
+ }
+ public void setBlockReachDistance(double distance)
+ {
+ blockReachDistance = distance;
+ }
}
@@ -0,0 +1,10 @@
--- ../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;
@@ -0,0 +1,24 @@
--- ../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);
}
@@ -1,15 +0,0 @@
--- ../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);
}
}
@@ -0,0 +1,11 @@
--- ../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,3 +76,12 @@
{
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 int getItemBurnTime(ItemStack itemstack)
+ public static int getItemBurnTime(ItemStack itemstack)
{
if (itemstack == null)
{
@@ -178,7 +178,7 @@
@@ -3028,4 +3029,38 @@
{
return getChunkProvider().func_40182_a(this, s, i, j, k);
return getChunkProvider().findClosestStructure(this, s, i, j, k);
}
+
+ /**
+6 -6
View File
@@ -1,13 +1,13 @@
cmd /C build.bat
@cmd /C build.bat
cd ..
@cd ..
cmd /C reobfuscate.bat
@echo | cmd /C reobfuscate.bat
set PATH=E:\cygwin\bin;%PATH%
@set PATH=E:\cygwin\bin;%PATH%
cd forge
@cd forge
sh package.sh 1.3.0
@sh package.sh
pause
+2 -2
View File
@@ -5,7 +5,7 @@ pushd .. >nul
rmdir /S /Q src_base
rmdir /S /Q src_work
cmd /C decompile.bat
@echo | 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
cmd /C updatemd5.bat
@echo | cmd /C updatemd5.bat
mkdir src_base
mkdir src_work
+1
View File
@@ -0,0 +1 @@
1 3 2 0