mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e08c63b57b | ||
|
|
db1e2c863d | ||
|
|
ea7be67db2 | ||
|
|
6144650579 |
No files matched your search
@@ -21,7 +21,3 @@
|
||||
/patches-/
|
||||
# FML changelog
|
||||
changelog.txt
|
||||
/patches_old/
|
||||
/patches_old_bak/
|
||||
*.py
|
||||
*.7z
|
||||
@@ -1,10 +0,0 @@
|
||||
Contributing to Forge
|
||||
=====================
|
||||
|
||||
1) Keep patches to Minecraft classes minimal. If you need a lot of things done, you may either add to relevant forge classes or make a new class.
|
||||
|
||||
2) An example mod must be provided for all PRs adding events/hooks to Forge. Whether it's a full mod using your proposed hooks, or just a pastebin containing a simple example, an example mod is required. Please also explain in detail what your new hook does.
|
||||
|
||||
3) Follow Forge coding guidelines (braces on newlines, spaces instead of tabs, etc)
|
||||
|
||||
For more information, refer to [the wiki](https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge)
|
||||
@@ -15,11 +15,6 @@ MacOS/Linux: ./gradlew setupDevWorkspace
|
||||
|
||||
If you wish to use the Eclipse IDE, run gradle eclipse instead of gradle setupDevWorkspace, or install the Gradle plugin for Eclipse and import the Forge source folder as a Gradle project.
|
||||
|
||||
To get the decompiled classes:
|
||||
If you have Gradle: gradle setupDecompWorkspace
|
||||
If you DO NOT have Gradle installed:
|
||||
Windows: ./gradlew.bat setupDecompWorkspace
|
||||
MacOS/Linux: ./gradlew setupDecompWorkspace
|
||||
|
||||
For Contributors: (Note: This assumes you have Gradle installed. If you don't, use ./gradlew(.bat) instead of gradle.
|
||||
|
||||
|
||||
+4
-10
@@ -34,12 +34,11 @@ repositories {
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = '1.8'
|
||||
mcpVersion = '9.10'
|
||||
mappings = 'snapshot_nodoc_20141130'
|
||||
version = '1.7.2'
|
||||
mcpVersion = '9.03'
|
||||
fmlDir = projectDir.getAbsolutePath() + "/fml";
|
||||
mainClass = 'net.minecraftforge.fml.relauncher.ServerLaunchWrapper'
|
||||
tweakClass = 'net.minecraftforge.fml.common.launcher.FMLTweaker'
|
||||
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
|
||||
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
|
||||
installerVersion = "1.4"
|
||||
}
|
||||
|
||||
@@ -50,11 +49,6 @@ jenkins {
|
||||
job = 'minecraftforge'
|
||||
}
|
||||
|
||||
// crowdin stuff
|
||||
if (project.hasProperty("crowdinKey"))
|
||||
tasks.getLocalizations.apiKey = project.crowdinKey
|
||||
|
||||
|
||||
launch4j {
|
||||
jreMinVersion = '1.6.0'
|
||||
}
|
||||
|
||||
Binary file not shown.
+1
-1
Submodule fml updated: d4ded9d6e2...7eb36a1481.
File diff suppressed because it is too large.
Load diff
@@ -1,9 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockAir.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockAir.java
|
||||
@@ -36,4 +36,6 @@
|
||||
}
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) {}
|
||||
+
|
||||
+ public boolean func_176200_f(World worldIn, BlockPos pos){ return true; }
|
||||
}
|
||||
@@ -1,54 +1,73 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
||||
@@ -12,7 +12,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -6,8 +6,13 @@
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+import static net.minecraftforge.common.EnumPlantType.*;
|
||||
|
||||
-public class BlockBush extends Block
|
||||
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
|
||||
+public class BlockBush extends Block implements IPlantable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000208";
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
@@ -27,7 +32,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_149854_a(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c());
|
||||
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c().canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
||||
- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_));
|
||||
+ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_);
|
||||
}
|
||||
|
||||
protected boolean func_149854_a(Block p_149854_1_)
|
||||
@@ -85,4 +85,33 @@
|
||||
@@ -57,7 +62,7 @@
|
||||
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
|
||||
+ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
|
||||
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
@@ -79,4 +84,37 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
|
||||
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
|
||||
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
|
||||
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
|
||||
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
|
||||
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ return net.minecraftforge.common.EnumPlantType.Plains;
|
||||
+ if (this == Blocks.field_150464_aj) return Crop;
|
||||
+ if (this == Blocks.field_150459_bM) return Crop;
|
||||
+ if (this == Blocks.field_150469_bN) return Crop;
|
||||
+ if (this == Blocks.field_150394_bc) return Crop;
|
||||
+ if (this == Blocks.field_150393_bb) return Crop;
|
||||
+ if (this == Blocks.field_150330_I) return Desert;
|
||||
+ if (this == Blocks.field_150392_bi) return Water;
|
||||
+ if (this == Blocks.field_150337_Q) return Cave;
|
||||
+ if (this == Blocks.field_150338_P) return Cave;
|
||||
+ if (this == Blocks.field_150388_bm) return Nether;
|
||||
+ if (this == Blocks.field_150345_g) return Plains;
|
||||
+ if (this == Blocks.field_150329_H) return Plains;
|
||||
+ if (this == Blocks.field_150398_cm) return Plains;
|
||||
+ if (this == Blocks.field_150328_O) return Plains;
|
||||
+ if (this == Blocks.field_150327_N) return Plains;
|
||||
+ return Plains;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() != this) return func_176223_P();
|
||||
+ return state;
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return world.func_72805_g(x, y, z);
|
||||
+ }
|
||||
}
|
||||
@@ -1,55 +1,100 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
|
||||
@@ -18,6 +18,7 @@
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -14,6 +14,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import static net.minecraft.util.EnumFacing.*;
|
||||
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public abstract class BlockButton extends Block
|
||||
{
|
||||
@@ -57,7 +58,7 @@
|
||||
private final boolean field_150047_a;
|
||||
@@ -49,12 +52,19 @@
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
|
||||
+ return p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
|
||||
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
|
||||
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
|
||||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST)) ||
|
||||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST));
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -69,7 +70,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = aenumfacing[j];
|
||||
|
||||
- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r())
|
||||
+ if (p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -80,7 +81,7 @@
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_180642_1_.func_180495_p(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())).func_177230_c().func_149721_r() ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
|
||||
+ return p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_, true) ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
|
||||
+ return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) ||
|
||||
+ (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) ||
|
||||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) ||
|
||||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH));
|
||||
}
|
||||
|
||||
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
|
||||
@@ -89,7 +90,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176585_a);
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
@@ -63,19 +73,21 @@
|
||||
int k1 = j1 & 8;
|
||||
j1 &= 7;
|
||||
|
||||
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
|
||||
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
|
||||
{
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
@@ -338,6 +339,8 @@
|
||||
return new BlockState(this, new IProperty[] {field_176585_a, field_176584_b});
|
||||
}
|
||||
|
||||
+ @Override public net.minecraft.item.Item func_180660_a(IBlockState state, Random rnd, int fortune){ return null; }
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_);
|
||||
+
|
||||
static final class SwitchEnumFacing
|
||||
+ if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
|
||||
{
|
||||
static final int[] field_180420_a = new int[EnumFacing.values().length];
|
||||
j1 = 4;
|
||||
}
|
||||
- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
|
||||
+ else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
|
||||
{
|
||||
j1 = 2;
|
||||
}
|
||||
- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
|
||||
{
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -89,7 +101,11 @@
|
||||
|
||||
private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_)
|
||||
{
|
||||
- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1)));
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1;
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2;
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3;
|
||||
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ + 1, NORTH)) return 4;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -99,22 +115,22 @@
|
||||
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,37 +1,49 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
|
||||
@@ -19,7 +19,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -11,9 +11,13 @@
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
|
||||
-public class BlockCactus extends Block
|
||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
|
||||
+public class BlockCactus extends Block implements IPlantable
|
||||
{
|
||||
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
|
||||
private static final String __OBFID = "CL_00000210";
|
||||
@@ -115,7 +115,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon field_150041_a;
|
||||
@@ -125,7 +129,7 @@
|
||||
else
|
||||
{
|
||||
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
|
||||
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
|
||||
+ return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
|
||||
Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
|
||||
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
|
||||
+ return block.canSustainPlant(p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this);
|
||||
}
|
||||
|
||||
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
|
||||
@@ -143,4 +143,16 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176587_a});
|
||||
@@ -141,4 +145,22 @@
|
||||
this.field_150041_a = p_149651_1_.func_94245_a(this.func_149641_N() + "_top");
|
||||
this.field_150040_b = p_149651_1_.func_94245_a(this.func_149641_N() + "_bottom");
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Desert;
|
||||
+ return EnumPlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return func_176223_P();
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
@@ -1,11 +1,44 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
|
||||
@@ -531,7 +531,7 @@
|
||||
@@ -23,6 +23,8 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
|
||||
{
|
||||
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_177230_c().func_149721_r();
|
||||
+ return p_176456_1_.isSideSolid(p_176456_2_.func_177984_a(), EnumFacing.DOWN, false);
|
||||
}
|
||||
|
||||
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockChest extends BlockContainer
|
||||
{
|
||||
private final Random field_149955_b = new Random();
|
||||
@@ -407,7 +409,7 @@
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r())
|
||||
+ else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -415,19 +417,19 @@
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
|
||||
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -1,29 +1,46 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
@@ -137,7 +137,14 @@
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -160,6 +161,13 @@
|
||||
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- int j = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int p_149690_5_, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> dropped = super.getDrops(world, pos, state, fortune);
|
||||
+ int j = ((Integer)state.func_177229_b(field_176501_a)).intValue();
|
||||
+ ArrayList<ItemStack> dropped = super.getDrops(world, x, y, z, p_149690_5_, fortune);
|
||||
int j1 = func_149987_c(p_149690_5_);
|
||||
byte b0 = 1;
|
||||
|
||||
if (j >= 2)
|
||||
@@ -147,8 +154,9 @@
|
||||
@@ -170,8 +178,9 @@
|
||||
|
||||
for (int k = 0; k < b0; ++k)
|
||||
for (int k1 = 0; k1 < b0; ++k1)
|
||||
{
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
|
||||
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151100_aR, 1, 3));
|
||||
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, 3));
|
||||
}
|
||||
+ return dropped;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -216,4 +225,10 @@
|
||||
++j1;
|
||||
p_149853_1_.func_72921_c(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public Item func_149650_a(int par1, Random par2Random, int par3)
|
||||
+ {
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
@@ -1,68 +1,79 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
||||
@@ -82,11 +82,11 @@
|
||||
float f1 = 0.0F;
|
||||
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos1.func_177982_a(i, 0, j));
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
|
||||
+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos1.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -12,6 +13,7 @@
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockCrops extends BlockBush implements IGrowable
|
||||
{
|
||||
@@ -89,11 +91,11 @@
|
||||
{
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.field_150458_ak)
|
||||
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this))
|
||||
{
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
|
||||
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos1.func_177982_a(i, 0, j)))
|
||||
- if (p_149864_1_.func_72805_g(l, p_149864_3_ - 1, i1) > 0)
|
||||
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1))
|
||||
{
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -143,24 +143,6 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
@@ -145,22 +147,6 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
|
||||
-
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- int j = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue();
|
||||
-
|
||||
- if (j >= 7)
|
||||
- if (p_149690_5_ >= 7)
|
||||
- {
|
||||
- int k = 3 + p_180653_5_;
|
||||
- int j1 = 3 + p_149690_7_;
|
||||
-
|
||||
- for (int l = 0; l < k; ++l)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
- {
|
||||
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
|
||||
- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_)
|
||||
- {
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0));
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -203,4 +185,26 @@
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
@@ -204,4 +190,23 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176488_a});
|
||||
this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
+ int age = ((Integer)state.func_177229_b(field_176488_a)).intValue();
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
+
|
||||
+ if (age >= 7)
|
||||
+ if (metadata >= 7)
|
||||
+ {
|
||||
+ int k = 3 + fortune;
|
||||
+
|
||||
+ for (int i = 0; i < 3 + fortune; ++i)
|
||||
+ {
|
||||
+ if (rand.nextInt(15) <= age)
|
||||
+ if (world.field_73012_v.nextInt(15) <= metadata)
|
||||
+ {
|
||||
+ ret.add(new ItemStack(this.func_149866_i(), 1, 0));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,33 +1,45 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -13,7 +13,7 @@
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -8,9 +10,11 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush
|
||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
|
||||
+public class BlockDeadBush extends BlockBush implements IShearable
|
||||
{
|
||||
private static final String __OBFID = "CL_00000224";
|
||||
|
||||
@@ -41,14 +41,15 @@
|
||||
@@ -33,14 +37,15 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0));
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150330_I, 1, p_149636_6_));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; }
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ return new java.util.ArrayList<ItemStack>(java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I)));
|
||||
+ return new ArrayList<ItemStack>(Arrays.asList(new ItemStack(Blocks.field_150330_I, 1, world.func_72805_g(x, y, z))));
|
||||
+ }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
|
||||
@@ -149,7 +149,7 @@
|
||||
@@ -249,7 +249,7 @@
|
||||
{
|
||||
if (this.field_149764_J == Material.field_151573_f)
|
||||
{
|
||||
@@ -9,12 +9,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,7 +267,7 @@
|
||||
@@ -367,7 +367,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_176196_2_.func_177956_o() >= 255 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
|
||||
+ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
|
||||
- return p_149742_3_ >= 255 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
|
||||
+ return p_149742_3_ >= p_149742_1_.func_72800_K() - 1 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
|
||||
}
|
||||
|
||||
public int func_149656_h()
|
||||
@@ -1,80 +1,52 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
|
||||
@@ -24,7 +24,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -18,8 +19,9 @@
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockDoublePlant extends BlockBush implements IGrowable
|
||||
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
||||
+public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable
|
||||
{
|
||||
public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
|
||||
public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
|
||||
@@ -89,6 +89,8 @@
|
||||
Object object = flag ? this : p_176475_1_.func_180495_p(blockpos1).func_177230_c();
|
||||
Object object1 = flag ? p_176475_1_.func_180495_p(blockpos2).func_177230_c() : this;
|
||||
public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"};
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -81,6 +83,7 @@
|
||||
|
||||
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
+ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
int l = p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
}
|
||||
@@ -262,4 +265,22 @@
|
||||
int l = this.func_149885_e(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
|
||||
this.func_149642_a(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, new ItemStack(this, 1, l));
|
||||
}
|
||||
+
|
||||
if (object == this)
|
||||
{
|
||||
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
|
||||
@@ -97,17 +99,13 @@
|
||||
if (object1 == this)
|
||||
{
|
||||
p_176475_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 3);
|
||||
-
|
||||
- if (!flag)
|
||||
- {
|
||||
- this.func_176226_b(p_176475_1_, blockpos2, p_176475_3_, 0);
|
||||
- }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
{
|
||||
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
||||
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
|
||||
@@ -157,7 +155,6 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
|
||||
{
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
@@ -296,6 +293,32 @@
|
||||
return Block.EnumOffsetType.XZ;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
|
||||
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
|
||||
+ int metadata = world.func_72805_g(x, y, z);
|
||||
+ int type = func_149890_d(metadata);
|
||||
+ return func_149887_c(metadata) && (type == 3 || type == 4);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
|
||||
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
|
||||
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ int type = func_149890_d(world.func_72805_g(x, y, z));
|
||||
+ if (type == 3 || type == 2)
|
||||
+ ret.add(new ItemStack(Blocks.field_150329_H, 2, type == 3 ? 2 : 1));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
+ {
|
||||
+ //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (state.func_177230_c() == this && state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && world.func_180495_p(pos.func_177984_a()).func_177230_c() == this)
|
||||
+ world.func_175698_g(pos.func_177984_a());
|
||||
+ return world.func_175698_g(pos);
|
||||
+ }
|
||||
+
|
||||
static enum EnumBlockHalf implements IStringSerializable
|
||||
{
|
||||
UPPER,
|
||||
}
|
||||
@@ -1,10 +1,19 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_)
|
||||
@@ -84,7 +84,7 @@
|
||||
{
|
||||
+ if (p_180685_0_.func_175623_d(p_180685_1_)) return true;
|
||||
Block block = p_180685_0_.func_180495_p(p_180685_1_).func_177230_c();
|
||||
Material material = block.field_149764_J;
|
||||
return block == Blocks.field_150480_ab || material == Material.field_151579_a || material == Material.field_151586_h || material == Material.field_151587_i;
|
||||
Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_);
|
||||
|
||||
- if (block.field_149764_J == Material.field_151579_a)
|
||||
+ if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -94,6 +94,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ //TODO: King, take a look here when doing liquids!
|
||||
Material material = block.field_149764_J;
|
||||
return material == Material.field_151586_h ? true : material == Material.field_151587_i;
|
||||
}
|
||||
@@ -1,11 +1,20 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
@@ -89,7 +89,7 @@
|
||||
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
|
||||
{
|
||||
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
|
||||
- return block instanceof BlockCrops || block instanceof BlockStem;
|
||||
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
|
||||
}
|
||||
@@ -12,6 +12,8 @@
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)
|
||||
public class BlockFarmland extends Block
|
||||
{
|
||||
@@ -94,7 +96,7 @@
|
||||
{
|
||||
Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1);
|
||||
|
||||
- if (block == Blocks.field_150464_aj || block == Blocks.field_150394_bc || block == Blocks.field_150393_bb || block == Blocks.field_150469_bN || block == Blocks.field_150459_bM)
|
||||
+ if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,211 +1,309 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
|
||||
@@ -42,18 +42,24 @@
|
||||
int j = p_176221_3_.func_177956_o();
|
||||
int k = p_176221_3_.func_177952_p();
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()))
|
||||
+ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
boolean flag = (i + j + k & 1) == 1;
|
||||
boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1;
|
||||
int l = 0;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.IdentityHashMap;
|
||||
+import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
+import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -12,11 +15,15 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProviderEnd;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))
|
||||
+ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN))
|
||||
{
|
||||
l = flag ? 1 : 2;
|
||||
}
|
||||
|
||||
- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag));
|
||||
+ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)))
|
||||
+ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST )))
|
||||
+ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)))
|
||||
+ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST )))
|
||||
+ .func_177226_a(field_176542_R, Integer.valueOf(l))
|
||||
+ .func_177226_a(field_176540_b, Boolean.valueOf(flag1))
|
||||
+ .func_177226_a(field_176544_M, Boolean.valueOf(flag));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,6 +115,7 @@
|
||||
|
||||
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
|
||||
{
|
||||
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
||||
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
|
||||
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
|
||||
public class BlockFire extends Block
|
||||
{
|
||||
- private int[] field_149849_a = new int[256];
|
||||
- private int[] field_149848_b = new int[256];
|
||||
+ @Deprecated
|
||||
+ private int[] field_149849_a = new int[4096];
|
||||
+ @Deprecated
|
||||
+ private int[] field_149848_b = new int[4096];
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] field_149850_M;
|
||||
private static final String __OBFID = "CL_00000245";
|
||||
@@ -54,10 +61,10 @@
|
||||
Blocks.field_150480_ab.func_149842_a(func_149682_b(Blocks.field_150404_cg), 60, 20);
|
||||
}
|
||||
@@ -148,13 +155,8 @@
|
||||
}
|
||||
|
||||
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
|
||||
- boolean flag = block == Blocks.field_150424_aL;
|
||||
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
|
||||
+ @Deprecated // Use setFireInfo
|
||||
public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_)
|
||||
{
|
||||
- this.field_149849_a[p_149842_1_] = p_149842_2_;
|
||||
- this.field_149848_b[p_149842_1_] = p_149842_3_;
|
||||
+ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_);
|
||||
}
|
||||
|
||||
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
|
||||
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
@@ -94,13 +101,8 @@
|
||||
{
|
||||
if (p_149674_1_.func_82736_K().func_82766_b("doFireTick"))
|
||||
{
|
||||
- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150424_aL;
|
||||
+ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP);
|
||||
|
||||
- if (p_149674_1_.field_73011_w instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150357_h)
|
||||
- {
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_))
|
||||
if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_))
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
@@ -183,7 +185,7 @@
|
||||
return;
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
@@ -128,7 +130,7 @@
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
}
|
||||
- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0)
|
||||
+ else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0)
|
||||
{
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
@@ -142,12 +144,12 @@
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
|
||||
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l);
|
||||
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l);
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l, DOWN );
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l, SOUTH);
|
||||
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l, NORTH);
|
||||
|
||||
for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1)
|
||||
{
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
return;
|
||||
@@ -198,12 +200,12 @@
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i);
|
||||
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i, EnumFacing.WEST);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i, EnumFacing.EAST);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i, EnumFacing.UP);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i, EnumFacing.DOWN);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i, EnumFacing.SOUTH);
|
||||
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i, EnumFacing.NORTH);
|
||||
|
||||
for (int j = -1; j <= 1; ++j)
|
||||
{
|
||||
@@ -262,22 +264,30 @@
|
||||
@@ -201,10 +203,16 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated // Use Block.getFlammability
|
||||
public int func_176532_c(Block p_176532_1_)
|
||||
+ @Deprecated
|
||||
private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_)
|
||||
{
|
||||
Integer integer = (Integer)this.field_149848_b.get(p_176532_1_);
|
||||
return integer == null ? 0 : integer.intValue();
|
||||
}
|
||||
|
||||
+ @Deprecated // Use Block.getFlammability
|
||||
public int func_176534_d(Block p_176534_1_)
|
||||
{
|
||||
Integer integer = (Integer)this.field_149849_a.get(p_176534_1_);
|
||||
return integer == null ? 0 : integer.intValue();
|
||||
}
|
||||
|
||||
+ @Deprecated // Use tryCatchFire with face below
|
||||
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
|
||||
{
|
||||
- int k = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
|
||||
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
|
||||
- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))];
|
||||
+ this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP);
|
||||
+ }
|
||||
|
||||
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
|
||||
+ private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face)
|
||||
+ {
|
||||
+ int k = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
|
||||
+ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face);
|
||||
+
|
||||
if (p_176536_4_.nextInt(p_176536_3_) < k)
|
||||
if (p_149841_6_.nextInt(p_149841_5_) < j1)
|
||||
{
|
||||
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
|
||||
@@ -314,7 +324,7 @@
|
||||
boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.field_150335_W;
|
||||
@@ -234,7 +242,12 @@
|
||||
|
||||
private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_)
|
||||
{
|
||||
- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1)))));
|
||||
+ return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) ||
|
||||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH);
|
||||
}
|
||||
|
||||
private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_)
|
||||
@@ -247,12 +260,13 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
EnumFacing enumfacing = aenumfacing[j];
|
||||
|
||||
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
|
||||
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -338,7 +348,7 @@
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
EnumFacing enumfacing = aenumfacing[k];
|
||||
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
|
||||
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
|
||||
}
|
||||
|
||||
return i;
|
||||
@@ -350,9 +360,10 @@
|
||||
- int l = this.func_149846_a(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, b0);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l);
|
||||
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l);
|
||||
+ int l = b0;
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN );
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH);
|
||||
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
@@ -262,15 +276,16 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ @Deprecated // Use canCatchFire with face sensitive version below
|
||||
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
|
||||
+ @Deprecated
|
||||
public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_)
|
||||
{
|
||||
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
|
||||
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
|
||||
- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0;
|
||||
+ return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -396,9 +407,9 @@
|
||||
double d1;
|
||||
double d2;
|
||||
|
||||
- if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177977_b()))
|
||||
+ if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177977_b(), EnumFacing.UP))
|
||||
{
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177976_e()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177976_e(), EnumFacing.EAST))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -409,7 +420,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177974_f()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177974_f(), EnumFacing.WEST))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -420,7 +431,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177978_c()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177978_c(), EnumFacing.SOUTH))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -431,7 +442,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177968_d()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177968_d(), EnumFacing.NORTH))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -442,7 +453,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177984_a()))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177984_a(), EnumFacing.DOWN))
|
||||
{
|
||||
for (i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -490,4 +501,19 @@
|
||||
+ @Deprecated
|
||||
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_)
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R, field_176540_b, field_176544_M});
|
||||
- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))];
|
||||
- return i1 > p_149846_5_ ? i1 : p_149846_5_;
|
||||
+ return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
|
||||
}
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
@@ -314,9 +329,9 @@
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_))
|
||||
+ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP))
|
||||
{
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -327,7 +342,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -338,7 +353,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -349,7 +364,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -360,7 +375,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN))
|
||||
{
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -405,4 +420,101 @@
|
||||
{
|
||||
return MapColor.field_151656_f;
|
||||
}
|
||||
+
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
+ private static class FireInfo
|
||||
+ {
|
||||
+ private int encouragement = 0;
|
||||
+ private int flammibility = 0;
|
||||
+ }
|
||||
+ private IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
|
||||
+
|
||||
+ public void setFireInfo(Block block, int encouragement, int flammibility)
|
||||
+ {
|
||||
+ if (block == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
||||
+ int id = Block.func_149682_b(block);
|
||||
+ this.field_149849_a[id] = encouragement;
|
||||
+ this.field_149848_b[id] = flammibility;
|
||||
+
|
||||
+ FireInfo info = getInfo(block, true);
|
||||
+ info.encouragement = encouragement;
|
||||
+ info.flammibility = flammibility;
|
||||
+ }
|
||||
+
|
||||
+ private FireInfo getInfo(Block block, boolean garentee)
|
||||
+ {
|
||||
+ FireInfo ret = blockInfo.get(block);
|
||||
+ if (ret == null && garentee)
|
||||
+ {
|
||||
+ ret = new FireInfo();
|
||||
+ blockInfo.put(block, ret);
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ public void rebuildFireInfo()
|
||||
+ {
|
||||
+ for (int x = 0; x < 4096; x++)
|
||||
+ {
|
||||
+ //If we care.. we could detect changes in here and make sure we keep them, however
|
||||
+ //it's my thinking that anyone who hacks into the private variables should DIAF and we don't care about them.
|
||||
+ field_149849_a[x] = 0;
|
||||
+ field_149848_b[x] = 0;
|
||||
+ }
|
||||
+
|
||||
+ for (Entry<Block, FireInfo> e : blockInfo.entrySet())
|
||||
+ {
|
||||
+ int id = Block.func_149682_b(e.getKey());
|
||||
+ if (id >= 0 && id < 4096)
|
||||
+ {
|
||||
+ field_149849_a[id] = e.getValue().encouragement;
|
||||
+ field_149848_b[id] = e.getValue().flammibility;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public int getFlammability(Block block)
|
||||
+ {
|
||||
+ int id = Block.func_149682_b(block);
|
||||
+ return id >= 0 && id < 4096 ? field_149848_b[id] : 0;
|
||||
+ }
|
||||
+
|
||||
+ public int getEncouragement(Block block)
|
||||
+ {
|
||||
+ int id = Block.func_149682_b(block);
|
||||
+ return id >= 0 && id < 4096 ? field_149849_a[id] : 0;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param pos Block position
|
||||
+ * @param x X Position
|
||||
+ * @param y Y Position
|
||||
+ * @param z Z Position
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return True if the face can catch fire.
|
||||
+ */
|
||||
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
|
||||
+ public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face)
|
||||
+ {
|
||||
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
|
||||
+ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x X Position
|
||||
+ * @param y Y Position
|
||||
+ * @param z Z Position
|
||||
+ * @param oldChance The previous maximum chance.
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return The chance of the block catching fire, or oldChance if it is higher
|
||||
+ */
|
||||
+ public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face)
|
||||
+ {
|
||||
+ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
|
||||
+ return (newChance > oldChance ? newChance : oldChance);
|
||||
+ }
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
}
|
||||
@@ -1,48 +1,38 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -162,13 +162,6 @@
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -139,12 +140,6 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
- TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
|
||||
-
|
||||
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
|
||||
- {
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
|
||||
- }
|
||||
-
|
||||
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
}
|
||||
|
||||
@@ -388,6 +381,31 @@
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
@@ -242,4 +237,14 @@
|
||||
|
||||
return new TileEntityFlowerPot(Item.func_150898_a((Block)object), b0);
|
||||
}
|
||||
+
|
||||
+ /*============================FORGE START=====================================*/
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
|
||||
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
+ TileEntityFlowerPot te = this.func_149929_e(world, x, y, z);
|
||||
+ if (te != null && te.func_145965_a() != null)
|
||||
+ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
+ {
|
||||
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
|
||||
+ return super.removedByPlayer(world, pos, player, willHarvest);
|
||||
+ }
|
||||
+ @Override
|
||||
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
|
||||
+ {
|
||||
+ super.func_180657_a(world, player, pos, state, te);
|
||||
+ world.func_175698_g(pos);
|
||||
+ }
|
||||
+ /*===========================FORGE END==========================================*/
|
||||
+
|
||||
public static enum EnumFlowerType implements IStringSerializable
|
||||
{
|
||||
EMPTY("empty"),
|
||||
}
|
||||
@@ -1,41 +1,37 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
|
||||
@@ -59,7 +59,7 @@
|
||||
@@ -43,7 +43,7 @@
|
||||
{
|
||||
if (!p_180650_1_.field_72995_K)
|
||||
if (!p_149674_1_.field_72995_K)
|
||||
{
|
||||
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
|
||||
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
|
||||
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
|
||||
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
|
||||
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
|
||||
}
|
||||
@@ -73,7 +73,7 @@
|
||||
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
|
||||
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
|
||||
@@ -56,7 +56,7 @@
|
||||
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
|
||||
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
|
||||
|
||||
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos1, Blocks.field_150349_c.func_176223_P());
|
||||
}
|
||||
@@ -120,18 +120,11 @@
|
||||
continue;
|
||||
}
|
||||
}
|
||||
- else if (p_176474_1_.func_180495_p(blockpos2).func_177230_c().field_149764_J == Material.field_151579_a)
|
||||
+ else if (p_176474_1_.func_175623_d(blockpos2))
|
||||
{
|
||||
if (p_176474_2_.nextInt(8) == 0)
|
||||
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
- BlockFlower.EnumFlowerType enumflowertype = p_176474_1_.func_180494_b(blockpos2).func_180623_a(p_176474_2_, blockpos2);
|
||||
- BlockFlower blockflower = enumflowertype.func_176964_a().func_180346_a();
|
||||
- IBlockState iblockstate1 = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), enumflowertype);
|
||||
-
|
||||
- if (blockflower.func_180671_f(p_176474_1_, blockpos2, iblockstate1))
|
||||
- {
|
||||
- p_176474_1_.func_180501_a(blockpos2, iblockstate1, 3);
|
||||
- }
|
||||
+ p_176474_1_.func_180494_b(blockpos2).plantFlower(p_176474_1_, p_176474_2_, blockpos2);
|
||||
p_149674_1_.func_147449_b(i1, j1, k1, Blocks.field_150349_c);
|
||||
}
|
||||
@@ -184,15 +184,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- String s = p_149853_1_.func_72807_a(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1);
|
||||
- field_149992_a.debug("Flower in " + p_149853_1_.func_72807_a(i1, k1).field_76791_y + ": " + s);
|
||||
- BlockFlower blockflower = BlockFlower.func_149857_e(s);
|
||||
-
|
||||
- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1))
|
||||
- {
|
||||
- int i2 = BlockFlower.func_149856_f(s);
|
||||
- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3);
|
||||
- }
|
||||
+ p_149853_1_.func_72807_a(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,50 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
||||
@@ -40,14 +40,17 @@
|
||||
p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
p_180657_2_.func_71020_j(0.025F);
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_))
|
||||
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_))
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -13,6 +14,7 @@
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
public class BlockIce extends BlockBreakable
|
||||
{
|
||||
@@ -43,14 +45,16 @@
|
||||
p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
p_149636_2_.func_71020_j(0.025F);
|
||||
|
||||
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_))
|
||||
+ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_))
|
||||
{
|
||||
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
|
||||
ItemStack itemstack = this.func_180643_i(p_180657_4_);
|
||||
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
ItemStack itemstack = this.func_149644_j(p_149636_6_);
|
||||
|
||||
- if (itemstack != null)
|
||||
- {
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack);
|
||||
- }
|
||||
+ if (itemstack != null) items.add(itemstack);
|
||||
+
|
||||
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_);
|
||||
+
|
||||
+ ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_);
|
||||
+ for (ItemStack is : items)
|
||||
+ func_180635_a(p_180657_1_, p_180657_3_, is);
|
||||
+ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -58,7 +61,9 @@
|
||||
@@ -61,7 +65,9 @@
|
||||
}
|
||||
|
||||
int i = EnchantmentHelper.func_77517_e(p_180657_2_);
|
||||
+ harvesters.set(p_180657_2_);
|
||||
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
|
||||
int i1 = EnchantmentHelper.func_77517_e(p_149636_2_);
|
||||
+ harvesters.set(p_149636_2_);
|
||||
this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1);
|
||||
+ harvesters.set(null);
|
||||
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o();
|
||||
Material material = p_149636_1_.func_147439_a(p_149636_3_, p_149636_4_ - 1, p_149636_5_).func_149688_o();
|
||||
|
||||
if (material.func_76230_c() || material.func_76224_d())
|
||||
@@ -1,32 +1,93 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
|
||||
@@ -80,7 +80,10 @@
|
||||
@@ -5,10 +5,14 @@
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
+import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_177230_c().func_149721_r() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_177230_c().func_149721_r()));
|
||||
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST, true) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST, true) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH, true) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH, true);
|
||||
}
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
@@ -124,7 +127,7 @@
|
||||
|
||||
protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_)
|
||||
{
|
||||
- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_177230_c().func_149721_r();
|
||||
+ return p_176381_1_.isSideSolid(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_, true);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -155,6 +158,8 @@
|
||||
return new BlockState(this, new IProperty[] {field_176382_a});
|
||||
}
|
||||
|
||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
static final class SwitchEnumFacing
|
||||
public class BlockLadder extends Block
|
||||
{
|
||||
private static final String __OBFID = "CL_00000262";
|
||||
@@ -79,29 +83,32 @@
|
||||
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
|
||||
}
|
||||
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
{
|
||||
int j1 = p_149660_9_;
|
||||
|
||||
- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
|
||||
+ if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
|
||||
{
|
||||
static final int[] field_180190_a = new int[EnumFacing.values().length];
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
|
||||
+ if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
|
||||
{
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
|
||||
{
|
||||
j1 = 5;
|
||||
}
|
||||
@@ -114,22 +121,22 @@
|
||||
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_);
|
||||
boolean flag = false;
|
||||
|
||||
- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r())
|
||||
+ if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r())
|
||||
+ if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r())
|
||||
+ if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r())
|
||||
+ if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -147,4 +154,10 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,108 +1,151 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
@@ -18,7 +18,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -15,8 +16,9 @@
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public abstract class BlockLeaves extends BlockLeavesBase
|
||||
+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable
|
||||
+public abstract class BlockLeaves extends BlockLeavesBase implements IShearable
|
||||
{
|
||||
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
|
||||
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
|
||||
@@ -76,9 +76,9 @@
|
||||
BlockPos blockpos1 = p_180663_2_.func_177982_a(i1, j1, k1);
|
||||
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
|
||||
|
||||
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(field_176236_b)).booleanValue())
|
||||
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
|
||||
int[] field_150128_a;
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -82,10 +84,10 @@
|
||||
{
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
{
|
||||
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
|
||||
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
|
||||
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
|
||||
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,11 +119,12 @@
|
||||
{
|
||||
for (i2 = -b0; i2 <= b0; ++i2)
|
||||
@@ -127,9 +129,9 @@
|
||||
{
|
||||
- Block block = p_180650_1_.func_180495_p(new BlockPos(j + k1, k + l1, l + i2)).func_177230_c();
|
||||
+ BlockPos tmp = new BlockPos(j + k1, k + l1, l + i2);
|
||||
+ Block block = p_180650_1_.func_180495_p(tmp).func_177230_c();
|
||||
Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2);
|
||||
|
||||
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
|
||||
+ if (!block.canSustainLeaves(p_180650_1_, tmp))
|
||||
+ if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
|
||||
{
|
||||
- if (block.func_149688_o() == Material.field_151584_j)
|
||||
+ if (block.isLeaves(p_180650_1_, tmp))
|
||||
+ if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
|
||||
{
|
||||
this.field_150128_a[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -2;
|
||||
this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
|
||||
}
|
||||
@@ -230,40 +231,7 @@
|
||||
@@ -236,40 +238,7 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- int j = this.func_176232_d(p_180653_3_);
|
||||
- int j1 = this.func_150123_b(p_149690_5_);
|
||||
-
|
||||
- if (p_180653_5_ > 0)
|
||||
- if (p_149690_7_ > 0)
|
||||
- {
|
||||
- j -= 2 << p_180653_5_;
|
||||
- j1 -= 2 << p_149690_7_;
|
||||
-
|
||||
- if (j < 10)
|
||||
- if (j1 < 10)
|
||||
- {
|
||||
- j = 10;
|
||||
- j1 = 10;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (p_180653_1_.field_73012_v.nextInt(j) == 0)
|
||||
- if (p_149690_1_.field_73012_v.nextInt(j1) == 0)
|
||||
- {
|
||||
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
|
||||
- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_);
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_)));
|
||||
- }
|
||||
-
|
||||
- j = 200;
|
||||
- j1 = 200;
|
||||
-
|
||||
- if (p_180653_5_ > 0)
|
||||
- if (p_149690_7_ > 0)
|
||||
- {
|
||||
- j -= 10 << p_180653_5_;
|
||||
- j1 -= 10 << p_149690_7_;
|
||||
-
|
||||
- if (j < 40)
|
||||
- if (j1 < 40)
|
||||
- {
|
||||
- j = 40;
|
||||
- j1 = 40;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, j);
|
||||
- this.func_150124_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, j1);
|
||||
- }
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_);
|
||||
}
|
||||
|
||||
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) {}
|
||||
@@ -298,4 +266,48 @@
|
||||
protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {}
|
||||
@@ -281,13 +250,7 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
@@ -318,4 +281,67 @@
|
||||
}
|
||||
|
||||
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
|
||||
public abstract String[] func_150125_e();
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
+ @Override
|
||||
+ public void beginLeavesDecay(World world, BlockPos pos)
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ if (!(Boolean)state.func_177229_b(field_176236_b))
|
||||
+ {
|
||||
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ int chance = this.func_176232_d(state);
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z) & 3));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void beginLeavesDecay(World world, int x, int y, int z)
|
||||
+ {
|
||||
+
|
||||
+ int i2 = world.func_72805_g(x, y, z);
|
||||
+
|
||||
+ if ((i2 & 8) == 0)
|
||||
+ {
|
||||
+ world.func_72921_c(x, y, z, i2 | 8, 4);
|
||||
+ }
|
||||
+ world.func_72921_c(x, y, z, world.func_72805_g(x, y, z) | 8, 4);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLeaves(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ int chance = this.func_150123_b(metadata);
|
||||
+
|
||||
+ if (fortune > 0)
|
||||
+ {
|
||||
@@ -110,8 +153,8 @@
|
||||
+ if (chance < 10) chance = 10;
|
||||
+ }
|
||||
+
|
||||
+ if (rand.nextInt(chance) == 0)
|
||||
+ ret.add(new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state)));
|
||||
+ if (world.field_73012_v.nextInt(chance) == 0)
|
||||
+ ret.add(new ItemStack(this.func_149650_a(metadata, world.field_73012_v, fortune), 1, this.func_149692_a(metadata)));
|
||||
+
|
||||
+ chance = 200;
|
||||
+ if (fortune > 0)
|
||||
@@ -121,10 +164,8 @@
|
||||
+ }
|
||||
+
|
||||
+ this.captureDrops(true);
|
||||
+ if (world instanceof World)
|
||||
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
|
||||
+ this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang
|
||||
+ ret.addAll(this.captureDrops(false));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
@@ -1,67 +1,128 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
|
||||
@@ -47,24 +47,24 @@
|
||||
@@ -10,6 +10,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockLever extends Block
|
||||
{
|
||||
private static final String __OBFID = "CL_00000264";
|
||||
@@ -42,12 +45,23 @@
|
||||
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : this.func_176358_d(p_176198_1_, p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()));
|
||||
+ return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_);
|
||||
- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()))));
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
|
||||
+ return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) ||
|
||||
+ (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) ||
|
||||
+ (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
|
||||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
|
||||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return this.func_176358_d(p_176196_1_, p_176196_2_.func_177976_e()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177974_f()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177978_c()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177968_d()) ? true : (World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) ? true : this.func_176358_d(p_176196_1_, p_176196_2_.func_177984_a())))));
|
||||
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST ) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST ) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP ) ||
|
||||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177984_a(), EnumFacing.DOWN );
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r()))));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ - 1, p_149742_4_, UP ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN );
|
||||
}
|
||||
|
||||
- protected boolean func_176358_d(World p_176358_1_, BlockPos p_176358_2_)
|
||||
- {
|
||||
- return p_176358_1_.func_180495_p(p_176358_2_).func_177230_c().func_149721_r();
|
||||
- }
|
||||
-
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
{
|
||||
IBlockState iblockstate = this.func_176223_P().func_177226_a(field_176359_b, Boolean.valueOf(false));
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
@@ -56,32 +70,32 @@
|
||||
int j1 = p_149660_9_ & 7;
|
||||
byte b0 = -1;
|
||||
|
||||
- if (this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())))
|
||||
+ if (p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_))
|
||||
- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r())
|
||||
+ if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN))
|
||||
{
|
||||
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(p_180642_3_, p_180642_8_.func_174811_aO()));
|
||||
b0 = 0;
|
||||
}
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
enumfacing1 = (EnumFacing)iterator.next();
|
||||
- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_))
|
||||
+ if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP))
|
||||
{
|
||||
b0 = 5;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
|
||||
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
|
||||
{
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
|
||||
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
|
||||
{
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
|
||||
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
|
||||
{
|
||||
b0 = 1;
|
||||
}
|
||||
@@ -147,42 +161,42 @@
|
||||
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- while (enumfacing1 == p_180642_3_ || !this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(enumfacing1.func_176734_d())));
|
||||
+ while (enumfacing1 == p_180642_3_ || !p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1));
|
||||
|
||||
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(enumfacing1, p_180642_8_.func_174811_aO()));
|
||||
}
|
||||
@@ -116,7 +116,8 @@
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
|
||||
{
|
||||
- if (this.func_176356_e(p_176204_1_, p_176204_2_) && !this.func_176358_d(p_176204_1_, p_176204_2_.func_177972_a(((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c().func_176734_d())))
|
||||
+ EnumFacing dir = ((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c();
|
||||
+ if (this.func_176356_e(p_176204_1_, p_176204_2_) && !p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(dir.func_176734_d()), dir))
|
||||
{
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
@@ -235,6 +236,12 @@
|
||||
return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b});
|
||||
}
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
+
|
||||
+ private boolean canAttach(World world, BlockPos pos, EnumFacing side)
|
||||
+ {
|
||||
+ return world.isSideSolid(pos, side);
|
||||
+ }
|
||||
+
|
||||
public static enum EnumOrientation implements IStringSerializable
|
||||
{
|
||||
DOWN_X(0, "down_x", EnumFacing.DOWN),
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
|
||||
@@ -67,7 +67,7 @@
|
||||
{
|
||||
for (int l1 = -1; l1 <= 1; ++l1)
|
||||
{
|
||||
- int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).field_76759_H;
|
||||
+ int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier();
|
||||
l += (i2 & 16711680) >> 16;
|
||||
i1 += (i2 & 65280) >> 8;
|
||||
j1 += i2 & 255;
|
||||
@@ -1,24 +1,45 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -38,9 +38,9 @@
|
||||
BlockPos blockpos1 = (BlockPos)iterator.next();
|
||||
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
|
||||
@@ -7,6 +7,7 @@
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
|
||||
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
|
||||
public abstract class BlockLog extends BlockRotatedPillar
|
||||
@@ -53,14 +54,10 @@
|
||||
{
|
||||
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
|
||||
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
|
||||
for (int l1 = -b0; l1 <= b0; ++l1)
|
||||
{
|
||||
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
|
||||
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
|
||||
{
|
||||
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
-
|
||||
- if ((i2 & 8) == 0)
|
||||
- {
|
||||
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
|
||||
- }
|
||||
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,9 @@
|
||||
return super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176299_a, BlockLog.EnumAxis.func_176870_a(p_180642_3_.func_176740_k()));
|
||||
}
|
||||
|
||||
+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
public static enum EnumAxis implements IStringSerializable
|
||||
@@ -79,4 +76,16 @@
|
||||
{
|
||||
X("x"),
|
||||
return this.field_150166_b[p_150161_1_ % this.field_150166_b.length];
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isWood(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,17 +1,26 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -39,10 +39,14 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
@@ -7,6 +7,7 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMobSpawner extends BlockContainer
|
||||
@@ -36,10 +37,15 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
- int j = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
- int j1 = 15 + p_149690_1_.field_73012_v.nextInt(15) + p_149690_1_.field_73012_v.nextInt(15);
|
||||
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
|
||||
}
|
||||
|
||||
+ private Random rand = new Random();
|
||||
+ @Override
|
||||
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ public int getExpDrop(IBlockAccess world, int metadata, int fortune)
|
||||
+ {
|
||||
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
|
||||
+ return 15 + rand.nextInt(15) + rand.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public boolean func_149662_c()
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
@@ -76,7 +76,7 @@
|
||||
if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256)
|
||||
@@ -4,6 +4,7 @@
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockMushroom extends BlockBush implements IGrowable
|
||||
{
|
||||
@@ -85,7 +86,7 @@
|
||||
if (p_149718_3_ >= 0 && p_149718_3_ < 256)
|
||||
{
|
||||
IBlockState iblockstate1 = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
|
||||
- return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_149854_a(iblockstate1.func_177230_c()));
|
||||
+ return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate1.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this));
|
||||
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
|
||||
- return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block);
|
||||
+ return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,20 +1,20 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
@@ -39,7 +39,7 @@
|
||||
@@ -37,7 +37,7 @@
|
||||
{
|
||||
if (!p_180650_1_.field_72995_K)
|
||||
if (!p_149674_1_.field_72995_K)
|
||||
{
|
||||
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
|
||||
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
|
||||
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
|
||||
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
|
||||
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
|
||||
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
|
||||
@@ -50,7 +50,7 @@
|
||||
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
|
||||
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
|
||||
|
||||
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
|
||||
{
|
||||
p_180650_1_.func_175656_a(blockpos1, this.func_176223_P());
|
||||
}
|
||||
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
|
||||
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
p_149674_1_.func_147449_b(i1, j1, k1, this);
|
||||
}
|
||||
@@ -1,42 +1,58 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -36,7 +36,7 @@
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -11,6 +12,7 @@
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockNetherWart extends BlockBush
|
||||
{
|
||||
@@ -33,7 +35,7 @@
|
||||
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
|
||||
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
|
||||
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
|
||||
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
}
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
@@ -52,9 +52,11 @@
|
||||
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
|
||||
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
|
||||
@@ -60,9 +62,12 @@
|
||||
return 6;
|
||||
}
|
||||
|
||||
+ @SuppressWarnings("unused")
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ if (false && !p_180653_1_.field_72995_K)
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+
|
||||
+ if (false && !p_149690_1_.field_72995_K)
|
||||
{
|
||||
int j = 1;
|
||||
int j1 = 1;
|
||||
|
||||
@@ -105,4 +107,24 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176486_a});
|
||||
@@ -109,4 +114,23 @@
|
||||
this.field_149883_a[i] = p_149651_1_.func_94245_a(this.func_149641_N() + "_stage_" + i);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ int count = 1;
|
||||
+
|
||||
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
|
||||
+ if (metadata >= 3)
|
||||
+ {
|
||||
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
|
||||
+ count = 2 + world.field_73012_v.nextInt(3) + (fortune > 0 ? world.field_73012_v.nextInt(fortune + 1) : 0);
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < count; i++)
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
@@ -105,14 +105,15 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176240_P)).func_176839_a() - 4)));
|
||||
+ }
|
||||
}
|
||||
@@ -1,23 +1,24 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
||||
@@ -58,7 +58,9 @@
|
||||
if (tileentity instanceof TileEntityNote)
|
||||
@@ -45,7 +45,9 @@
|
||||
|
||||
if (tileentitynote != null)
|
||||
{
|
||||
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
|
||||
+ int old = tileentitynote.field_145879_a;
|
||||
tileentitynote.func_145877_a();
|
||||
+ if (old == tileentitynote.field_145879_a) return false;
|
||||
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
|
||||
tileentitynote.func_145878_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);
|
||||
}
|
||||
|
||||
@@ -96,6 +98,10 @@
|
||||
@@ -73,6 +75,11 @@
|
||||
|
||||
public boolean func_180648_a(World p_180648_1_, BlockPos p_180648_2_, IBlockState p_180648_3_, int p_180648_4_, int p_180648_5_)
|
||||
public boolean func_149696_a(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_)
|
||||
{
|
||||
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_180648_1_, p_180648_2_, p_180648_3_, p_180648_5_, p_180648_4_);
|
||||
+ int meta = p_149696_1_.func_72805_g(p_149696_2_, p_149696_3_, p_149696_4_);
|
||||
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, meta, p_149696_6_, p_149696_5_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
||||
+ p_180648_4_ = e.instrument.ordinal();
|
||||
+ p_180648_5_ = e.getVanillaNoteId();
|
||||
float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D);
|
||||
p_180648_1_.func_72908_a((double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 0.5D, (double)p_180648_2_.func_177952_p() + 0.5D, "note." + this.func_176433_b(p_180648_4_), 3.0F, f);
|
||||
p_180648_1_.func_175688_a(EnumParticleTypes.NOTE, (double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 1.2D, (double)p_180648_2_.func_177952_p() + 0.5D, (double)p_180648_5_ / 24.0D, 0.0D, 0.0D, new int[0]);
|
||||
+ p_149696_5_ = e.instrument.ordinal();
|
||||
+ p_149696_6_ = e.getVanillaNoteId();
|
||||
float f = (float)Math.pow(2.0D, (double)(p_149696_6_ - 12) / 12.0D);
|
||||
String s = "harp";
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
@@ -155,4 +155,11 @@
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176239_P)).func_176839_a())));
|
||||
+ }
|
||||
}
|
||||
@@ -1,59 +1,58 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
||||
@@ -10,6 +10,7 @@
|
||||
@@ -7,6 +7,7 @@
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MathHelper;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockOre extends Block
|
||||
@@ -54,34 +55,40 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
@@ -51,34 +52,40 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
-
|
||||
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
|
||||
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
|
||||
+ private Random rand = new Random();
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
|
||||
+ {
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
|
||||
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
|
||||
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
|
||||
{
|
||||
int j = 0;
|
||||
int j1 = 0;
|
||||
|
||||
if (this == Blocks.field_150365_q)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
|
||||
+ j = MathHelper.func_76136_a(rand, 0, 2);
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 0, 2);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 0, 2);
|
||||
}
|
||||
else if (this == Blocks.field_150482_ag)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
|
||||
+ j = MathHelper.func_76136_a(rand, 3, 7);
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150412_bA)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
|
||||
+ j = MathHelper.func_76136_a(rand, 3, 7);
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
|
||||
}
|
||||
else if (this == Blocks.field_150369_x)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
|
||||
+ j = MathHelper.func_76136_a(rand, 2, 5);
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
else if (this == Blocks.field_150449_bY)
|
||||
{
|
||||
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
|
||||
+ j = MathHelper.func_76136_a(rand, 2, 5);
|
||||
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
|
||||
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
|
||||
}
|
||||
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
|
||||
+ return j;
|
||||
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
|
||||
+ return j1;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_)
|
||||
public int func_149692_a(int p_149692_1_)
|
||||
@@ -1,41 +1,52 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
||||
@@ -39,7 +39,10 @@
|
||||
@@ -15,6 +15,8 @@
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
|
||||
public class BlockPane extends Block
|
||||
{
|
||||
@@ -62,10 +64,10 @@
|
||||
|
||||
public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_)
|
||||
{
|
||||
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c()))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c()))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c()))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c())));
|
||||
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
|
||||
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
|
||||
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
|
||||
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -65,10 +68,10 @@
|
||||
|
||||
public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List p_180638_5_, Entity p_180638_6_)
|
||||
{
|
||||
- boolean flag = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177978_c()).func_177230_c());
|
||||
- boolean flag1 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177968_d()).func_177230_c());
|
||||
- boolean flag2 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177976_e()).func_177230_c());
|
||||
- boolean flag3 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177974_f()).func_177230_c());
|
||||
+ boolean flag = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.NORTH);
|
||||
+ boolean flag1 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.SOUTH);
|
||||
+ boolean flag2 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.WEST);
|
||||
+ boolean flag3 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.EAST);
|
||||
- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1));
|
||||
- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1));
|
||||
- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_));
|
||||
- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_));
|
||||
+ boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH);
|
||||
+ boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH);
|
||||
+ boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST );
|
||||
+ boolean flag3 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ + 1, p_149743_3_, p_149743_4_, EAST );
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
|
||||
{
|
||||
@@ -187,4 +190,11 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
|
||||
@@ -117,10 +119,10 @@
|
||||
float f1 = 0.5625F;
|
||||
float f2 = 0.4375F;
|
||||
float f3 = 0.5625F;
|
||||
- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1));
|
||||
- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1));
|
||||
- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_));
|
||||
- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_));
|
||||
+ boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH);
|
||||
+ boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH);
|
||||
+ boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST );
|
||||
+ boolean flag3 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_, EAST );
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
|
||||
{
|
||||
@@ -186,4 +188,10 @@
|
||||
this.field_149761_L = p_149651_1_.func_94245_a(this.field_150101_M);
|
||||
this.field_150102_N = p_149651_1_.func_94245_a(this.field_150100_a);
|
||||
}
|
||||
+
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir)
|
||||
+ {
|
||||
+ BlockPos off = pos.func_177972_a(dir);
|
||||
+ Block block = world.func_180495_p(off).func_177230_c();
|
||||
+ return func_150098_a(block) || block.isSideSolid(world, off, dir.func_176734_d());
|
||||
+ return func_150098_a(world.func_147439_a(x, y, z)) ||
|
||||
+ world.isSideSolid(x, y, z, dir.getOpposite(), false);
|
||||
+ }
|
||||
}
|
||||
@@ -1,31 +1,65 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -200,7 +200,7 @@
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
+import net.minecraft.server.management.PlayerManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityPiston;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -360,7 +361,8 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
|
||||
+ if (!flag1 && !block.isAir(p_180648_1_, blockpos1) && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
|
||||
- return !(p_150080_0_ instanceof ITileEntityProvider);
|
||||
+ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.func_72805_g(p_150080_2_, p_150080_3_, p_150080_4_)));
|
||||
+
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,14 +377,14 @@
|
||||
{
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= p_150077_0_.func_72800_K())
|
||||
{
|
||||
this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false);
|
||||
}
|
||||
@@ -344,7 +344,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !(p_180696_0_ instanceof ITileEntityProvider);
|
||||
+ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_)));
|
||||
Block block = p_150077_0_.func_147439_a(i1, j1, k1);
|
||||
|
||||
- if (block.func_149688_o() != Material.field_151579_a)
|
||||
+ if (!block.isAir(p_150077_0_, i1, j1, k1))
|
||||
{
|
||||
if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true))
|
||||
{
|
||||
@@ -420,14 +422,14 @@
|
||||
{
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= p_150079_1_.func_72800_K())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = p_150079_1_.func_147439_a(i1, j1, k1);
|
||||
|
||||
- if (block.func_149688_o() != Material.field_151579_a)
|
||||
+ if (!block.isAir(p_150079_1_, i1, j1, k1))
|
||||
{
|
||||
if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true))
|
||||
{
|
||||
@@ -448,7 +450,9 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), 0);
|
||||
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
|
||||
+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f;
|
||||
+ block.func_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), chance, 0);
|
||||
p_150079_1_.func_147468_f(i1, j1, k1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -384,7 +384,9 @@
|
||||
{
|
||||
blockpos1 = (BlockPos)list1.get(j);
|
||||
Block block = p_176319_1_.func_180495_p(blockpos1).func_177230_c();
|
||||
- block.func_176226_b(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), 0);
|
||||
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
|
||||
+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f;
|
||||
+ block.func_180653_a(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), chance, 0);
|
||||
p_176319_1_.func_175698_g(blockpos1);
|
||||
--i;
|
||||
ablock[i] = block;
|
||||
@@ -1,37 +1,47 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
@@ -110,16 +110,7 @@
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
+import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityPiston;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -90,15 +92,7 @@
|
||||
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_);
|
||||
- TileEntityPiston tileentitypiston = this.func_149963_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
|
||||
-
|
||||
- if (tileentitypiston != null)
|
||||
- {
|
||||
- IBlockState iblockstate1 = tileentitypiston.func_174927_b();
|
||||
- iblockstate1.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate1, 0);
|
||||
- tileentitypiston.func_145861_a().func_149697_b(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, tileentitypiston.func_145832_p(), 0);
|
||||
- }
|
||||
- }
|
||||
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
}
|
||||
|
||||
public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_)
|
||||
@@ -283,4 +274,16 @@
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -231,4 +225,13 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b});
|
||||
this.field_149761_L = p_149651_1_.func_94245_a("piston_top_normal");
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos);
|
||||
+ if (tileentitypiston != null)
|
||||
+ {
|
||||
+ IBlockState pushed = tileentitypiston.func_174927_b();
|
||||
+ return pushed.func_177230_c().getDrops(world, pos, pushed, fortune);
|
||||
+ }
|
||||
+ return new java.util.ArrayList();
|
||||
+ TileEntityPiston te = this.func_149963_e(world, x, y, z);
|
||||
+ if (te != null)
|
||||
+ return te.func_145861_a().getDrops(world, x, y, z, te.func_145832_p(), 0);
|
||||
+ return new ArrayList<ItemStack>();
|
||||
+ }
|
||||
}
|
||||
@@ -1,25 +1,32 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
|
||||
@@ -24,13 +24,14 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -46,14 +47,15 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
-
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
- {
|
||||
- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0)
|
||||
- if (p_149690_5_ >= 7 && p_149690_1_.field_73012_v.nextInt(50) == 0)
|
||||
- {
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI));
|
||||
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151170_bI));
|
||||
- }
|
||||
- }
|
||||
}
|
||||
+ @Override
|
||||
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
||||
+ java.util.Random rand = world instanceof World ? ((World)world).field_73012_v : new java.util.Random();
|
||||
+ if (((Integer)state.func_177229_b(field_176488_a)) >= 7 && rand.nextInt(50) == 0)
|
||||
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
+ if (metadata >= 7 && world.field_73012_v.nextInt(50) == 0)
|
||||
+ ret.add(new ItemStack(Items.field_151170_bI));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -1,11 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
@@ -109,7 +109,7 @@
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
|
||||
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
+ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
}
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)
|
||||
@@ -1,51 +1,109 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
@@ -33,7 +33,7 @@
|
||||
public static boolean func_176563_d(IBlockState p_176563_0_)
|
||||
@@ -5,6 +5,7 @@
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
+import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
public static final boolean func_150051_a(Block p_150051_0_)
|
||||
{
|
||||
Block block = p_176563_0_.func_177230_c();
|
||||
- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
|
||||
+ return block instanceof BlockRailBase;
|
||||
- return p_150051_0_ == Blocks.field_150448_aq || p_150051_0_ == Blocks.field_150318_D || p_150051_0_ == Blocks.field_150319_E || p_150051_0_ == Blocks.field_150408_cc;
|
||||
+ return p_150051_0_ instanceof BlockRailBase;
|
||||
}
|
||||
|
||||
protected BlockRailBase(boolean p_i45389_1_)
|
||||
@@ -174,7 +174,56 @@
|
||||
@@ -78,7 +79,7 @@
|
||||
|
||||
public int func_149645_b()
|
||||
{
|
||||
- return 9;
|
||||
+ return renderType;
|
||||
}
|
||||
|
||||
public int func_149745_a(Random p_149745_1_)
|
||||
@@ -193,6 +194,111 @@
|
||||
}
|
||||
}
|
||||
|
||||
public abstract IProperty func_176560_l();
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
|
||||
+ public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z)
|
||||
+ {
|
||||
+ return !this.field_150053_a;
|
||||
+ return !func_150050_e();
|
||||
+ }
|
||||
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
|
||||
+ public boolean canMakeSlopes(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's metadata (without the power bit if the rail uses one).
|
||||
+ * Can be used to make the cart think the rail something other than it is,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * Valid rail metadata is defined as follows:
|
||||
+ * 0x0: flat track going North-South
|
||||
+ * 0x1: flat track going West-East
|
||||
+ * 0x2: track ascending to the East
|
||||
+ * 0x3: track ascending to the West
|
||||
+ * 0x4: track ascending to the North
|
||||
+ * 0x5: track ascending to the South
|
||||
+ * 0x6: WestNorth corner (connecting East and South)
|
||||
+ * 0x7: EastNorth corner (connecting West and South)
|
||||
+ * 0x8: EastSouth corner (connecting West and North)
|
||||
+ * 0x9: WestSouth corner (connecting East and North)
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @param y The rail X coordinate.
|
||||
+ * @param x The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return The metadata.
|
||||
+ */
|
||||
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)
|
||||
+ {
|
||||
+ int meta = world.func_72805_g(x, y, z);
|
||||
+ if(func_150050_e())
|
||||
+ {
|
||||
+ meta = meta & 7;
|
||||
+ }
|
||||
+ return meta;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param x The rail X coordinate.
|
||||
+ * @param y The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
|
||||
+ {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
@@ -55,68 +113,96 @@
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param y The rail X coordinate.
|
||||
+ * @param x The rail Y coordinate.
|
||||
+ * @param z The rail Z coordinate.
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Moved render type to a field and a setter.
|
||||
+ * This allows for a mod to change the render type
|
||||
+ * for vanilla rails, and any mod rails that extend
|
||||
+ * this class.
|
||||
+ */
|
||||
+ private int renderType = 9;
|
||||
+
|
||||
+ public void setRenderType(int value)
|
||||
+ {
|
||||
+ renderType = value;
|
||||
+ }
|
||||
+
|
||||
+ /* ======================================== FORGE END =====================================*/
|
||||
+
|
||||
public static enum EnumRailDirection implements IStringSerializable
|
||||
public class Rail
|
||||
{
|
||||
NORTH_SOUTH(0, "north_south"),
|
||||
@@ -251,6 +300,7 @@
|
||||
private World field_150660_b;
|
||||
@@ -202,6 +308,7 @@
|
||||
private final boolean field_150656_f;
|
||||
private final List field_150657_g = Lists.newArrayList();
|
||||
private List field_150657_g = new ArrayList();
|
||||
private static final String __OBFID = "CL_00000196";
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
|
||||
public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_)
|
||||
{
|
||||
@@ -259,7 +309,8 @@
|
||||
this.field_180366_e = p_i45739_4_;
|
||||
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
|
||||
BlockRailBase.EnumRailDirection enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
|
||||
- this.field_150656_f = this.field_180365_d.field_150053_a;
|
||||
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
|
||||
+ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
|
||||
this.func_180360_a(enumraildirection);
|
||||
@@ -209,19 +316,10 @@
|
||||
this.field_150661_c = p_i45388_3_;
|
||||
this.field_150658_d = p_i45388_4_;
|
||||
this.field_150659_e = p_i45388_5_;
|
||||
- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
- int l = p_i45388_2_.func_72805_g(p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
-
|
||||
- if (((BlockRailBase)block).field_150053_a)
|
||||
- {
|
||||
- this.field_150656_f = true;
|
||||
- l &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.field_150656_f = false;
|
||||
- }
|
||||
-
|
||||
+ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
+ int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
+ this.field_150656_f = !block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
+ canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
|
||||
this.func_150648_a(l);
|
||||
}
|
||||
|
||||
@@ -448,7 +499,7 @@
|
||||
@@ -412,7 +510,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
|
||||
{
|
||||
@@ -461,7 +512,7 @@
|
||||
@@ -425,7 +523,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
|
||||
{
|
||||
@@ -604,7 +655,7 @@
|
||||
@@ -570,7 +668,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
|
||||
{
|
||||
@@ -617,7 +668,7 @@
|
||||
@@ -583,7 +681,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
|
||||
{
|
||||
@@ -1,24 +1,22 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
@@ -295,6 +295,21 @@
|
||||
return this.func_176223_P().func_177226_a(field_176387_N, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
|
||||
@@ -228,4 +228,19 @@
|
||||
{
|
||||
return new TileEntityComparator();
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
|
||||
+ {
|
||||
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World)
|
||||
+ {
|
||||
+ func_176204_a((World)world, pos, world.func_180495_p(pos), world.func_180495_p(neighbor).func_177230_c());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
|
||||
+ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ)
|
||||
+ {
|
||||
+ if (y == tileY && world instanceof World)
|
||||
+ {
|
||||
+ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
public static enum Mode implements IStringSerializable
|
||||
{
|
||||
COMPARE("compare"),
|
||||
}
|
||||
@@ -1,20 +1,29 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
@@ -92,12 +92,16 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
@@ -10,6 +10,7 @@
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
+import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRedstoneOre extends Block
|
||||
@@ -88,12 +89,17 @@
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
+ }
|
||||
|
||||
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
|
||||
+ @Override
|
||||
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
||||
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
|
||||
+ private Random rand = new Random();
|
||||
+ @Override // World, meta, fortune
|
||||
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
|
||||
+ {
|
||||
+ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this))
|
||||
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
|
||||
{
|
||||
- int j = 1 + p_180653_1_.field_73012_v.nextInt(5);
|
||||
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
|
||||
+ return 1 + RANDOM.nextInt(5);
|
||||
- int j1 = 1 + p_149690_1_.field_73012_v.nextInt(5);
|
||||
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
|
||||
+ return 1 + rand.nextInt(5);
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@@ -1,59 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -60,10 +60,10 @@
|
||||
BlockPos blockpos1 = p_176341_2_.func_177972_a(p_176341_3_);
|
||||
Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c();
|
||||
|
||||
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos1), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177977_b()))))
|
||||
+ if (!canRestoneConnect(p_176341_1_, blockpos1, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos1.func_177977_b(), null)))
|
||||
@@ -405,7 +405,7 @@
|
||||
}
|
||||
else if (!Blocks.field_150413_aR.func_149907_e(block))
|
||||
{
|
||||
Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c();
|
||||
- return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
|
||||
+ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos1.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
|
||||
- return block.func_149744_f() && p_150174_4_ != -1;
|
||||
+ return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -393,35 +393,25 @@
|
||||
Block block = iblockstate.func_177230_c();
|
||||
boolean flag = block.func_149721_r();
|
||||
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r();
|
||||
- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos1.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos1.func_177977_b())));
|
||||
+ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos1.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos1, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos1.func_177977_b(), null)));
|
||||
}
|
||||
|
||||
- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
|
||||
+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
|
||||
- }
|
||||
+ IBlockState state = world.func_180495_p(pos);
|
||||
|
||||
- protected static boolean func_176346_d(IBlockState p_176346_0_)
|
||||
- {
|
||||
- return func_176343_a(p_176346_0_, (EnumFacing)null);
|
||||
- }
|
||||
-
|
||||
- protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_)
|
||||
- {
|
||||
- Block block = p_176343_0_.func_177230_c();
|
||||
-
|
||||
- if (block == Blocks.field_150488_af)
|
||||
+ if (state.func_177230_c() == Blocks.field_150488_af)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- else if (Blocks.field_150413_aR.func_149907_e(block))
|
||||
+ else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c()))
|
||||
{
|
||||
- EnumFacing enumfacing1 = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N);
|
||||
- return enumfacing1 == p_176343_1_ || enumfacing1.func_176734_d() == p_176343_1_;
|
||||
+ EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N);
|
||||
+ return direction == side || direction.func_176734_d() == side;
|
||||
}
|
||||
else
|
||||
{
|
||||
- return block.func_149744_f() && p_176343_1_ != null;
|
||||
+ return state.func_177230_c().canConnectRedstone(world, pos, side);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,47 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
|
||||
@@ -19,7 +19,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -11,7 +11,11 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockReed extends Block
|
||||
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
|
||||
+import net.minecraftforge.common.EnumPlantType;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import net.minecraftforge.common.IPlantable;
|
||||
+
|
||||
+public class BlockReed extends Block implements IPlantable
|
||||
{
|
||||
public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15);
|
||||
private static final String __OBFID = "CL_00000300";
|
||||
@@ -67,6 +67,7 @@
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
{
|
||||
Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c();
|
||||
+ if (block.canSustainPlant(p_176196_1_, p_176196_2_, EnumFacing.UP, this)) return true;
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
@@ -172,4 +173,15 @@
|
||||
@@ -57,7 +61,7 @@
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176355_a});
|
||||
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
- return block == this ? true : (block != Blocks.field_150349_c && block != Blocks.field_150346_d && block != Blocks.field_150354_m ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h))));
|
||||
+ return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this);
|
||||
}
|
||||
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -120,4 +124,22 @@
|
||||
{
|
||||
return p_149720_1_.func_72807_a(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
|
||||
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return net.minecraftforge.common.EnumPlantType.Beach;
|
||||
+ return EnumPlantType.Beach;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public IBlockState getPlant(IBlockAccess world, BlockPos pos)
|
||||
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return this.func_176223_P();
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return world.func_72805_g(x, y, z);
|
||||
+ }
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
|
||||
@@ -66,6 +66,7 @@
|
||||
@@ -71,6 +71,7 @@
|
||||
|
||||
public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_)
|
||||
public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_)
|
||||
{
|
||||
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return;
|
||||
Object object = p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return;
|
||||
int l = p_149878_1_.func_72805_g(p_149878_2_, p_149878_3_, p_149878_4_) & 7;
|
||||
Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
|
||||
int i1 = 0;
|
||||
@@ -1,55 +1,62 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
|
||||
@@ -122,8 +122,6 @@
|
||||
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_);
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -108,8 +109,6 @@
|
||||
return p_149692_1_;
|
||||
}
|
||||
|
||||
- public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) {}
|
||||
- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {}
|
||||
-
|
||||
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_)
|
||||
public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
|
||||
{
|
||||
if (p_176208_4_.field_71075_bZ.field_75098_d)
|
||||
@@ -131,13 +129,18 @@
|
||||
p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true));
|
||||
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4);
|
||||
if (p_149681_6_.field_71075_bZ.field_75098_d)
|
||||
@@ -118,29 +117,38 @@
|
||||
p_149681_1_.func_72921_c(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4);
|
||||
}
|
||||
+ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0);
|
||||
|
||||
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
|
||||
+ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0);
|
||||
+
|
||||
super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
|
||||
}
|
||||
|
||||
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
|
||||
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
- if (!p_180663_1_.field_72995_K)
|
||||
+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
- if (!p_149749_1_.field_72995_K)
|
||||
+ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
+ }
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune)
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
{
|
||||
if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
|
||||
if ((p_149749_6_ & 8) == 0)
|
||||
{
|
||||
@@ -146,7 +149,7 @@
|
||||
if (tileentity instanceof TileEntitySkull)
|
||||
ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_));
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
+ if (tileentityskull == null) return ret;
|
||||
+
|
||||
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_145907_c() != null && tileentityskull.func_145907_c().length() > 0)
|
||||
{
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
|
||||
- ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_176222_j(p_180663_1_, p_180663_2_));
|
||||
+ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a());
|
||||
|
||||
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
|
||||
{
|
||||
@@ -156,12 +159,11 @@
|
||||
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
|
||||
}
|
||||
|
||||
- func_180635_a(p_180663_1_, p_180663_2_, itemstack);
|
||||
+ ret.add(itemstack);
|
||||
itemstack.func_77982_d(new NBTTagCompound());
|
||||
itemstack.func_77978_p().func_74778_a("SkullOwner", tileentityskull.func_145907_c());
|
||||
}
|
||||
|
||||
- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack);
|
||||
+ ret.add(itemstack);
|
||||
}
|
||||
-
|
||||
- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
|
||||
- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
@@ -1,34 +1,35 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
|
||||
@@ -80,7 +80,7 @@
|
||||
@@ -73,7 +73,7 @@
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
IBlockState iblockstate = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
||||
Block block = iblockstate.func_177230_c();
|
||||
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
|
||||
}
|
||||
|
||||
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
|
||||
@@ -92,7 +92,6 @@
|
||||
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
|
||||
@@ -85,7 +85,6 @@
|
||||
{
|
||||
if (!this.func_176196_c(p_176314_1_, p_176314_2_))
|
||||
if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_))
|
||||
{
|
||||
- this.func_176226_b(p_176314_1_, p_176314_2_, p_176314_3_, 0);
|
||||
p_176314_1_.func_175698_g(p_176314_2_);
|
||||
- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.func_72805_g(p_150155_2_, p_150155_3_, p_150155_4_), 0);
|
||||
p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_);
|
||||
return false;
|
||||
}
|
||||
@@ -104,9 +103,8 @@
|
||||
@@ -97,10 +96,8 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0));
|
||||
+ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
p_180657_1_.func_175698_g(p_180657_3_);
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- int i1 = p_149636_6_ & 7;
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.field_151126_ay, i1 + 1, 0));
|
||||
+ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_);
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
}
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
@@ -116,14 +114,13 @@
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
@@ -110,14 +107,13 @@
|
||||
|
||||
public int func_149745_a(Random p_149745_1_)
|
||||
{
|
||||
@@ -36,18 +37,46 @@
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
|
||||
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
|
||||
{
|
||||
if (p_180650_1_.func_175642_b(EnumSkyBlock.BLOCK, p_180650_2_) > 11)
|
||||
if (p_149674_1_.func_72972_b(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11)
|
||||
{
|
||||
- this.func_176226_b(p_180650_1_, p_180650_2_, p_180650_1_.func_180495_p(p_180650_2_), 0);
|
||||
p_180650_1_.func_175698_g(p_180650_2_);
|
||||
- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.func_72805_g(p_149674_2_, p_149674_3_, p_149674_4_), 0);
|
||||
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
}
|
||||
@@ -153,4 +150,6 @@
|
||||
@@ -127,4 +123,34 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {field_176315_a});
|
||||
return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
|
||||
}
|
||||
+
|
||||
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; }
|
||||
+ /**
|
||||
+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand)
|
||||
+ * version in 1.1.
|
||||
+ *
|
||||
+ * @param meta Blocks Metadata
|
||||
+ * @param fortune Current item fortune level
|
||||
+ * @param random Random number generator
|
||||
+ * @return The number of items to drop
|
||||
+ */
|
||||
+ public int quantityDropped(int meta, int fortune, Random random)
|
||||
+ {
|
||||
+ return (meta & 7) + 1;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Determines if a new block can be replace the space occupied by this one,
|
||||
+ * Used in the player's placement code to make the block act like water, and lava.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x X Position
|
||||
+ * @param y Y position
|
||||
+ * @param z Z position
|
||||
+ * @return True if the block is replaceable by another block
|
||||
+ */
|
||||
+ public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ int meta = world.func_72805_g(x, y, z);
|
||||
+ return meta >= 7 ? false : field_149764_J.func_76222_j();
|
||||
+ }
|
||||
}
|
||||
@@ -1,45 +1,79 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
|
||||
@@ -108,7 +108,7 @@
|
||||
p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_));
|
||||
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
- if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -14,6 +15,7 @@
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class BlockStem extends BlockBush implements IGrowable
|
||||
{
|
||||
@@ -101,7 +103,7 @@
|
||||
|
||||
Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1);
|
||||
|
||||
- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
+ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
|
||||
{
|
||||
p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P());
|
||||
p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a);
|
||||
}
|
||||
@@ -162,24 +162,29 @@
|
||||
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
|
||||
{
|
||||
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
|
||||
+ }
|
||||
@@ -144,11 +146,11 @@
|
||||
Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1);
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (!p_180653_1_.field_72995_K)
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
{
|
||||
Item item = this.func_176481_j();
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
- int j = ((Integer)p_180653_3_.func_177229_b(field_176484_a)).intValue();
|
||||
+ int j = ((Integer)state.func_177229_b(field_176484_a)).intValue();
|
||||
|
||||
for (int k = 0; k < 3; ++k)
|
||||
- if (block8 == Blocks.field_150458_ak)
|
||||
+ if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this))
|
||||
{
|
||||
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
|
||||
+ if (RANDOM.nextInt(15) <= j)
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (p_149875_1_.func_72805_g(l, p_149875_3_ - 1, i1) > 0)
|
||||
+ if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1))
|
||||
{
|
||||
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item));
|
||||
+ ret.add(new ItemStack(item));
|
||||
f1 = 3.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+ return ret;
|
||||
@@ -211,11 +213,12 @@
|
||||
return l < 7 ? -1 : (p_149873_1_.func_147439_a(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.func_147439_a(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1))));
|
||||
}
|
||||
|
||||
protected Item func_176481_j()
|
||||
+ @SuppressWarnings("unused")
|
||||
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
|
||||
{
|
||||
super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
|
||||
|
||||
- if (!p_149690_1_.field_72995_K)
|
||||
+ if (false && !p_149690_1_.field_72995_K)
|
||||
{
|
||||
Item item = null;
|
||||
|
||||
@@ -282,4 +285,23 @@
|
||||
{
|
||||
this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
|
||||
}
|
||||
+
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+
|
||||
+ Item item = null;
|
||||
+ item = field_149877_a == Blocks.field_150423_aK ? Items.field_151080_bb : item;
|
||||
+ item = field_149877_a == Blocks.field_150440_ba ? Items.field_151081_bc : item;
|
||||
+
|
||||
+ for (int i = 0; item != null && i < 3; i++)
|
||||
+ {
|
||||
+ if (world.field_73012_v.nextInt(15) <= meta)
|
||||
+ ret.add(new ItemStack(item));
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,66 +1,83 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
|
||||
@@ -23,7 +23,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -17,8 +18,10 @@
|
||||
import net.minecraft.world.ColorizerGrass;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockTallGrass extends BlockBush implements IGrowable
|
||||
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
||||
+public class BlockTallGrass extends BlockBush implements IGrowable, IShearable
|
||||
{
|
||||
public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class);
|
||||
private static final String __OBFID = "CL_00000321";
|
||||
@@ -44,7 +44,7 @@
|
||||
private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"};
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -53,7 +56,7 @@
|
||||
|
||||
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
|
||||
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
|
||||
{
|
||||
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
|
||||
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
|
||||
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
|
||||
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
|
||||
}
|
||||
|
||||
public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_)
|
||||
@@ -74,7 +74,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -71,7 +74,7 @@
|
||||
|
||||
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
|
||||
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
- return p_180660_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
|
||||
- return p_149650_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
|
||||
+ return null;
|
||||
}
|
||||
|
||||
public int func_149679_a(int p_149679_1_, Random p_149679_2_)
|
||||
@@ -84,13 +84,7 @@
|
||||
@@ -81,13 +84,7 @@
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a()));
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150329_H, 1, p_149636_6_));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
@@ -210,4 +204,22 @@
|
||||
}
|
||||
@@ -143,4 +140,28 @@
|
||||
Blocks.field_150398_cm.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override
|
||||
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
|
||||
+ {
|
||||
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)world.func_180495_p(pos).func_177229_b(field_176497_a)).func_177044_a()));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ @Override
|
||||
+ public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
||||
+ if (RANDOM.nextInt(8) != 0) return ret;
|
||||
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM);
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ if (world.field_73012_v.nextInt(8) != 0) return ret;
|
||||
+ ItemStack seed = ForgeHooks.getGrassSeed(world);
|
||||
+ if (seed != null) ret.add(seed);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z)));
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
@@ -1,38 +1,108 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
|
||||
@@ -70,7 +70,7 @@
|
||||
@@ -10,6 +10,7 @@
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class BlockTorch extends Block
|
||||
{
|
||||
@@ -51,13 +52,17 @@
|
||||
else
|
||||
{
|
||||
Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c();
|
||||
- return block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn;
|
||||
+ return block.canPlaceTorchOnTop(p_176594_1_, p_176594_2_);
|
||||
Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_);
|
||||
- return block == Blocks.field_150422_aJ || block == Blocks.field_150386_bk || block == Blocks.field_150359_w || block == Blocks.field_150463_bK;
|
||||
+ return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
BlockPos blockpos1 = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d());
|
||||
boolean flag = p_176595_3_.func_176740_k().func_176722_c();
|
||||
- return flag && p_176595_1_.func_175677_d(blockpos1, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
|
||||
+ return flag && p_176595_1_.isSideSolid(blockpos1, p_176595_3_, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
|
||||
- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_))));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH, true) ||
|
||||
+ func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
}
|
||||
|
||||
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
|
||||
@@ -120,7 +120,7 @@
|
||||
|
||||
enumfacing1 = (EnumFacing)iterator.next();
|
||||
}
|
||||
- while (!p_180642_1_.func_175677_d(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), true));
|
||||
+ while (!p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1, true));
|
||||
|
||||
return this.func_176223_P().func_177226_a(field_176596_a, enumfacing1);
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
@@ -69,22 +74,22 @@
|
||||
j1 = 5;
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
EnumFacing enumfacing1 = enumfacing.func_176734_d();
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
|
||||
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
|
||||
{
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
|
||||
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
|
||||
{
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
|
||||
{
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
|
||||
{
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -106,19 +111,19 @@
|
||||
{
|
||||
if (p_149726_1_.func_72805_g(p_149726_2_, p_149726_3_, p_149726_4_) == 0)
|
||||
{
|
||||
- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true))
|
||||
+ if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2);
|
||||
}
|
||||
- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true))
|
||||
+ else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2);
|
||||
}
|
||||
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true))
|
||||
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2);
|
||||
}
|
||||
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true))
|
||||
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true))
|
||||
{
|
||||
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2);
|
||||
}
|
||||
@@ -143,22 +148,22 @@
|
||||
int l = p_150108_1_.func_72805_g(p_150108_2_, p_150108_3_, p_150108_4_);
|
||||
boolean flag = false;
|
||||
|
||||
- if (axis.func_176722_c() && !p_176592_1_.func_175677_d(p_176592_2_.func_177972_a(enumfacing1), true))
|
||||
+ if (axis.func_176722_c() && !p_176592_1_.isSideSolid(p_176592_2_.func_177972_a(enumfacing1), enumfacing1, true))
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4)
|
||||
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,43 +1,49 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
@@ -25,6 +25,8 @@
|
||||
@@ -11,9 +11,12 @@
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockTrapDoor extends Block
|
||||
{
|
||||
+ /** Set this to allow trapdoors to remain free-floating */
|
||||
+ public static boolean disableValidation = false;
|
||||
public static final PropertyDirection field_176284_a = PropertyDirection.func_177712_a("facing", EnumFacing.Plane.HORIZONTAL);
|
||||
public static final PropertyBool field_176283_b = PropertyBool.func_177716_a("open");
|
||||
public static final PropertyEnum field_176285_M = PropertyEnum.func_177709_a("half", BlockTrapDoor.DoorHalf.class);
|
||||
@@ -141,9 +143,10 @@
|
||||
{
|
||||
if (!p_176204_1_.field_72995_K)
|
||||
{
|
||||
+ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a);
|
||||
BlockPos blockpos1 = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d());
|
||||
private static final String __OBFID = "CL_00000327";
|
||||
|
||||
- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()))
|
||||
+ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()) || p_176204_1_.isSideSolid(blockpos1, direction, true)))
|
||||
protected BlockTrapDoor(Material p_i45434_1_)
|
||||
@@ -163,7 +166,7 @@
|
||||
--i1;
|
||||
}
|
||||
|
||||
- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)))
|
||||
+ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2))))
|
||||
{
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
@@ -187,7 +190,10 @@
|
||||
p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_);
|
||||
this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0);
|
||||
@@ -218,6 +221,7 @@
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return !p_176198_3_.func_176740_k().func_176720_b() && func_150119_a(p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c());
|
||||
+ if (disableValidation) return true;
|
||||
+ EnumFacing dir = p_176198_3_.func_176734_d();
|
||||
+ p_176198_2_ = p_176198_2_.func_177972_a(dir);
|
||||
+ return !p_176198_3_.func_176740_k().func_176720_b() && (func_150119_a(p_176198_1_.func_180495_p(p_176198_2_).func_177230_c()) || p_176198_1_.isSideSolid(p_176198_2_, p_176198_3_, true));
|
||||
if (p_149707_5_ == 0)
|
||||
{
|
||||
return false;
|
||||
@@ -248,7 +252,7 @@
|
||||
--p_149707_2_;
|
||||
}
|
||||
|
||||
- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_));
|
||||
+ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP);
|
||||
}
|
||||
}
|
||||
|
||||
protected static EnumFacing func_176281_b(int p_176281_0_)
|
||||
@@ -224,6 +230,7 @@
|
||||
@@ -259,6 +263,7 @@
|
||||
|
||||
private static boolean func_150119_a(Block p_150119_0_)
|
||||
{
|
||||
+ if (disableValidation) return true;
|
||||
return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +1,96 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
@@ -60,7 +60,7 @@
|
||||
@@ -9,6 +9,9 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
|
||||
+import net.minecraftforge.common.util.ForgeDirection;
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
public class BlockTripWireHook extends Block
|
||||
{
|
||||
private static final String __OBFID = "CL_00000329";
|
||||
@@ -47,34 +50,41 @@
|
||||
|
||||
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
|
||||
{
|
||||
- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
|
||||
+ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
|
||||
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
|
||||
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
|
||||
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
|
||||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
|
||||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
|
||||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
|
||||
}
|
||||
|
||||
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
||||
@@ -77,7 +77,7 @@
|
||||
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
|
||||
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
|
||||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
|
||||
}
|
||||
|
||||
enumfacing = (EnumFacing)iterator.next();
|
||||
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
{
|
||||
byte b0 = 0;
|
||||
|
||||
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
|
||||
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
|
||||
{
|
||||
b0 = 2;
|
||||
}
|
||||
- while (!p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r());
|
||||
+ while (!p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -107,7 +107,7 @@
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a);
|
||||
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
|
||||
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
|
||||
{
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
|
||||
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
|
||||
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
|
||||
{
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
|
||||
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
@@ -97,22 +107,22 @@
|
||||
int i1 = l & 3;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3)
|
||||
{
|
||||
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
|
||||
p_176204_1_.func_175698_g(p_176204_2_);
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2)
|
||||
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -133,7 +143,7 @@
|
||||
boolean flag3 = (p_150136_6_ & 8) == 8;
|
||||
boolean flag4 = !p_150136_5_;
|
||||
boolean flag5 = false;
|
||||
- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_);
|
||||
+ boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP);
|
||||
int l1 = Direction.field_71583_a[k1];
|
||||
int i2 = Direction.field_71581_b[k1];
|
||||
int j2 = 0;
|
||||
@@ -1,42 +1,61 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
|
||||
@@ -26,7 +26,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
+import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -16,8 +18,10 @@
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.IShearable;
|
||||
|
||||
-public class BlockVine extends Block
|
||||
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable
|
||||
+public class BlockVine extends Block implements IShearable
|
||||
{
|
||||
public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up");
|
||||
public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north");
|
||||
@@ -416,13 +416,7 @@
|
||||
private static final String __OBFID = "CL_00000330";
|
||||
|
||||
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
|
||||
@@ -375,14 +379,28 @@
|
||||
|
||||
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
|
||||
{
|
||||
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
|
||||
{
|
||||
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
|
||||
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0));
|
||||
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
|
||||
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150395_bd, 1, 0));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
|
||||
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
|
||||
}
|
||||
}
|
||||
@@ -508,6 +502,16 @@
|
||||
return i;
|
||||
}
|
||||
|
||||
+ /*************************FORGE START***********************************/
|
||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
+ {
|
||||
+ return java.util.Arrays.asList(new ItemStack(this, 1));
|
||||
+ }
|
||||
+ /*************************FORGE END***********************************/
|
||||
+
|
||||
static final class SwitchEnumFacing
|
||||
{
|
||||
static final int[] field_177057_a = new int[EnumFacing.values().length];
|
||||
+ @Override
|
||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ ret.add(new ItemStack(this, 1));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
@@ -80,7 +80,7 @@
|
||||
{
|
||||
Block block = this.field_177261_a.func_180495_p(p_177251_1_).func_177230_c();
|
||||
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
+ if (block.isAir(field_177261_a, p_177251_1_))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -111,7 +111,7 @@
|
||||
BlockPos blockpos1 = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i);
|
||||
block = this.field_177261_a.func_180495_p(blockpos1).func_177230_c();
|
||||
|
||||
- if (block.func_149688_o() == Material.field_151579_a || !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos1, this.field_177257_d, false) || blockpos1.equals(this.field_177259_b))
|
||||
+ if (block.isAir(field_177261_a, blockpos1)|| !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos1, this.field_177257_d, false) || blockpos1.equals(this.field_177259_b))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
block = this.field_177261_a.func_180495_p(blockpos2).func_177230_c();
|
||||
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
+ if (block.isAir(field_177261_a, blockpos2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockState.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java
|
||||
@@ -47,6 +47,16 @@
|
||||
|
||||
public BlockState(Block p_i45663_1_, IProperty ... p_i45663_2_)
|
||||
{
|
||||
+ this(p_i45663_1_, p_i45663_2_, null);
|
||||
+ }
|
||||
+
|
||||
+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap unlistedProperties)
|
||||
+ {
|
||||
+ return new StateImplementation(block, properties);
|
||||
+ }
|
||||
+
|
||||
+ protected BlockState(Block p_i45663_1_, IProperty[] p_i45663_2_, ImmutableMap unlistedProperties)
|
||||
+ {
|
||||
this.field_177627_c = p_i45663_1_;
|
||||
Arrays.sort(p_i45663_2_, new Comparator()
|
||||
{
|
||||
@@ -70,7 +80,7 @@
|
||||
{
|
||||
List list = (List)iterator.next();
|
||||
Map map = MapPopulator.func_179400_b(this.field_177624_d, list);
|
||||
- BlockState.StateImplementation stateimplementation = new BlockState.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map), null);
|
||||
+ BlockState.StateImplementation stateimplementation = createState(p_i45663_1_, ImmutableMap.copyOf(map), unlistedProperties);
|
||||
linkedhashmap.put(map, stateimplementation);
|
||||
arraylist.add(stateimplementation);
|
||||
}
|
||||
@@ -231,5 +241,10 @@
|
||||
{
|
||||
this(p_i45661_1_, p_i45661_2_);
|
||||
}
|
||||
+
|
||||
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
|
||||
+ {
|
||||
+ return field_177238_c;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,48 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -296,7 +296,6 @@
|
||||
this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
|
||||
field_147123_G.info("Setting user: " + this.field_71449_j.func_111285_a());
|
||||
- field_147123_G.info("(Session ID is " + this.field_71449_j.func_111286_b() + ")");
|
||||
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
|
||||
this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1;
|
||||
this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1;
|
||||
@@ -484,7 +483,7 @@
|
||||
@@ -135,6 +135,14 @@
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
import net.minecraft.world.storage.ISaveHandler;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.GuiIngameForge;
|
||||
+import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.ForgeEventFactory;
|
||||
+import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
+import net.minecraftforge.event.world.WorldEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.LWJGLException;
|
||||
@@ -246,7 +254,7 @@
|
||||
this.func_71389_H();
|
||||
this.field_71449_j = p_i1014_1_;
|
||||
field_147123_G.info("Setting user: " + p_i1014_1_.func_111285_a());
|
||||
- field_147123_G.info("(Session ID is " + p_i1014_1_.func_111286_b() + ")");
|
||||
+ //logger.info("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid...
|
||||
this.field_71459_aj = p_i1014_5_;
|
||||
this.field_71443_c = p_i1014_2_;
|
||||
this.field_71440_d = p_i1014_3_;
|
||||
@@ -419,7 +427,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
- Display.create((new PixelFormat()).withDepthBits(24));
|
||||
+ ForgeHooksClient.createDisplay();
|
||||
}
|
||||
catch (LWJGLException lwjglexception)
|
||||
{
|
||||
@@ -518,7 +526,7 @@
|
||||
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
|
||||
net.minecraftforge.fml.client.FMLClientHandler.instance().finishMinecraftLoading();
|
||||
FMLClientHandler.instance().finishMinecraftLoading();
|
||||
this.func_71361_d("Post startup");
|
||||
- this.field_71456_v = new GuiIngame(this);
|
||||
+ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this);
|
||||
+ this.field_71456_v = new GuiIngameForge(this);
|
||||
|
||||
if (this.field_71475_ae != null)
|
||||
{
|
||||
@@ -891,11 +890,6 @@
|
||||
@@ -701,11 +709,6 @@
|
||||
|
||||
public void func_147108_a(GuiScreen p_147108_1_)
|
||||
{
|
||||
@@ -29,76 +54,83 @@
|
||||
if (p_147108_1_ == null && this.field_71441_e == null)
|
||||
{
|
||||
p_147108_1_ = new GuiMainMenu();
|
||||
@@ -905,6 +899,17 @@
|
||||
@@ -715,6 +718,17 @@
|
||||
p_147108_1_ = new GuiGameOver();
|
||||
}
|
||||
|
||||
+ GuiScreen old = this.field_71462_r;
|
||||
+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_);
|
||||
+ GuiOpenEvent event = new GuiOpenEvent(p_147108_1_);
|
||||
+
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event)) return;
|
||||
+
|
||||
+ p_147108_1_ = event.gui;
|
||||
+ if (old != null && p_147108_1_ != old)
|
||||
+ {
|
||||
+ old.func_146281_b();
|
||||
+ }
|
||||
+
|
||||
+
|
||||
if (p_147108_1_ instanceof GuiMainMenu)
|
||||
{
|
||||
this.field_71474_y.field_74330_P = false;
|
||||
@@ -1388,7 +1393,7 @@
|
||||
@@ -1296,7 +1310,7 @@
|
||||
|
||||
if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b))
|
||||
{
|
||||
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
|
||||
+ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x);
|
||||
this.field_71439_g.func_71038_i();
|
||||
}
|
||||
}
|
||||
@@ -1468,15 +1473,19 @@
|
||||
case 2:
|
||||
BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
|
||||
- if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a)
|
||||
+ if (!this.field_71441_e.func_175623_d(blockpos))
|
||||
if (this.field_71439_g.func_82246_f(i, j, k))
|
||||
{
|
||||
int i = itemstack != null ? itemstack.field_77994_a : 0;
|
||||
- this.field_71452_i.func_78867_a(i, j, k, this.field_71476_x.field_72310_e);
|
||||
+ this.field_71452_i.addBlockHitEffects(i, j, k, this.field_71476_x);
|
||||
this.field_71439_g.func_71038_i();
|
||||
}
|
||||
}
|
||||
@@ -1377,11 +1391,12 @@
|
||||
int j = this.field_71476_x.field_72312_c;
|
||||
int k = this.field_71476_x.field_72309_d;
|
||||
|
||||
+
|
||||
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b).isCanceled();
|
||||
+ if (result) { //Forge: Kept separate to simplify patch
|
||||
if (this.field_71442_b.func_178890_a(this.field_71439_g, this.field_71441_e, itemstack, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f))
|
||||
- if (this.field_71441_e.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a)
|
||||
+ if (!this.field_71441_e.func_147439_a(i, j, k).isAir(field_71441_e, i, j, k))
|
||||
{
|
||||
int l = itemstack != null ? itemstack.field_77994_a : 0;
|
||||
|
||||
- if (this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_BLOCK, i, j, k, this.field_71476_x.field_72310_e, this.field_71441_e).isCanceled();
|
||||
+ if (result && this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
|
||||
{
|
||||
flag = false;
|
||||
this.field_71439_g.func_71038_i();
|
||||
}
|
||||
+ }
|
||||
@@ -1408,7 +1423,8 @@
|
||||
{
|
||||
ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g();
|
||||
|
||||
if (itemstack == null)
|
||||
{
|
||||
@@ -1697,6 +1706,8 @@
|
||||
- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(field_71439_g, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, this.field_71441_e).isCanceled();
|
||||
+ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
|
||||
{
|
||||
this.field_71460_t.field_78516_c.func_78445_c();
|
||||
}
|
||||
@@ -1607,6 +1623,8 @@
|
||||
|
||||
while (Mouse.next())
|
||||
{
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
|
||||
+ if (ForgeHooksClient.postMouseEvent()) continue;
|
||||
+
|
||||
i = Mouse.getEventButton();
|
||||
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
|
||||
|
||||
@@ -2217,6 +2228,8 @@
|
||||
if (field_142025_a && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157)))
|
||||
@@ -2080,6 +2098,11 @@
|
||||
|
||||
public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_)
|
||||
{
|
||||
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
|
||||
+ if (field_71441_e != null)
|
||||
+ {
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(field_71441_e));
|
||||
+ }
|
||||
+
|
||||
if (p_71353_1_ == null)
|
||||
{
|
||||
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
|
||||
@@ -2230,6 +2243,18 @@
|
||||
@@ -2092,6 +2115,18 @@
|
||||
if (this.field_71437_Z != null)
|
||||
{
|
||||
this.field_71437_Z.func_71263_m();
|
||||
this.field_71437_Z.func_175592_a();
|
||||
+ if (field_71461_s != null)
|
||||
+ {
|
||||
+ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal"));
|
||||
@@ -114,40 +146,37 @@
|
||||
}
|
||||
|
||||
this.field_71437_Z = null;
|
||||
@@ -2361,134 +2386,11 @@
|
||||
@@ -2240,113 +2275,10 @@
|
||||
if (this.field_71476_x != null)
|
||||
{
|
||||
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
|
||||
- int i = 0;
|
||||
- boolean flag1 = false;
|
||||
- TileEntity tileentity = null;
|
||||
- Object object;
|
||||
- Item item;
|
||||
int j;
|
||||
|
||||
- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
- {
|
||||
- BlockPos blockpos = this.field_71476_x.func_178782_a();
|
||||
- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c();
|
||||
- j = this.field_71476_x.field_72311_b;
|
||||
- int k = this.field_71476_x.field_72312_c;
|
||||
- int l = this.field_71476_x.field_72309_d;
|
||||
- Block block = this.field_71441_e.func_147439_a(j, k, l);
|
||||
-
|
||||
- if (block.func_149688_o() == Material.field_151579_a)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- object = block.func_180665_b(this.field_71441_e, blockpos);
|
||||
- item = block.func_149694_d(this.field_71441_e, j, k, l);
|
||||
-
|
||||
- if (object == null)
|
||||
- if (item == null)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (flag && GuiScreen.func_146271_m())
|
||||
- {
|
||||
- tileentity = this.field_71441_e.func_175625_s(blockpos);
|
||||
- }
|
||||
-
|
||||
- Block block1 = object instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a((Item)object) : block;
|
||||
- i = block1.func_176222_j(this.field_71441_e, blockpos);
|
||||
- flag1 = ((Item)object).func_77614_k();
|
||||
- flag1 = item.func_77614_k();
|
||||
- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block;
|
||||
- i = block1.func_149643_k(this.field_71441_e, j, k, l);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
@@ -158,11 +187,11 @@
|
||||
-
|
||||
- if (this.field_71476_x.field_72308_g instanceof EntityPainting)
|
||||
- {
|
||||
- object = Items.field_151159_an;
|
||||
- item = Items.field_151159_an;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot)
|
||||
- {
|
||||
- object = Items.field_151058_ca;
|
||||
- item = Items.field_151058_ca;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame)
|
||||
- {
|
||||
@@ -171,11 +200,11 @@
|
||||
-
|
||||
- if (itemstack == null)
|
||||
- {
|
||||
- object = Items.field_151160_bD;
|
||||
- item = Items.field_151160_bD;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- object = itemstack.func_77973_b();
|
||||
- item = itemstack.func_77973_b();
|
||||
- i = itemstack.func_77960_j();
|
||||
- flag1 = true;
|
||||
- }
|
||||
@@ -184,86 +213,72 @@
|
||||
- {
|
||||
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
|
||||
-
|
||||
- switch (Minecraft.SwitchEnumMinecartType.field_178901_b[entityminecart.func_180456_s().ordinal()])
|
||||
- if (entityminecart.func_94087_l() == 2)
|
||||
- {
|
||||
- case 1:
|
||||
- object = Items.field_151109_aJ;
|
||||
- break;
|
||||
- case 2:
|
||||
- object = Items.field_151108_aI;
|
||||
- break;
|
||||
- case 3:
|
||||
- object = Items.field_151142_bV;
|
||||
- break;
|
||||
- case 4:
|
||||
- object = Items.field_151140_bW;
|
||||
- break;
|
||||
- case 5:
|
||||
- object = Items.field_151095_cc;
|
||||
- break;
|
||||
- default:
|
||||
- object = Items.field_151143_au;
|
||||
- item = Items.field_151109_aJ;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 1)
|
||||
- {
|
||||
- item = Items.field_151108_aI;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 3)
|
||||
- {
|
||||
- item = Items.field_151142_bV;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 5)
|
||||
- {
|
||||
- item = Items.field_151140_bW;
|
||||
- }
|
||||
- else if (entityminecart.func_94087_l() == 6)
|
||||
- {
|
||||
- item = Items.field_151095_cc;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- item = Items.field_151143_au;
|
||||
- }
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityBoat)
|
||||
- {
|
||||
- object = Items.field_151124_az;
|
||||
- }
|
||||
- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand)
|
||||
- {
|
||||
- object = Items.field_179565_cj;
|
||||
- item = Items.field_151124_az;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- object = Items.field_151063_bx;
|
||||
- item = Items.field_151063_bx;
|
||||
- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g);
|
||||
- flag1 = true;
|
||||
-
|
||||
- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
|
||||
- if (i <= 0 || !EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
|
||||
|
||||
- if (tileentity == null)
|
||||
- {
|
||||
- inventoryplayer.func_146030_a((Item)object, i, flag1, flag);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
- tileentity.func_145841_b(nbttagcompound1);
|
||||
- ItemStack itemstack1 = new ItemStack((Item)object, 1, i);
|
||||
- itemstack1.func_77983_a("BlockEntityTag", nbttagcompound1);
|
||||
- NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
- NBTTagList nbttaglist = new NBTTagList();
|
||||
- nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
|
||||
- nbttagcompound.func_74782_a("Lore", nbttaglist);
|
||||
- itemstack1.func_77983_a("display", nbttagcompound);
|
||||
- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1);
|
||||
- }
|
||||
- this.field_71439_g.field_71071_by.func_146030_a(item, i, flag1, flag);
|
||||
-
|
||||
+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
|
||||
+ if (!ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
|
||||
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
|
||||
if (flag)
|
||||
{
|
||||
int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c;
|
||||
@@ -2744,8 +2646,11 @@
|
||||
p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
|
||||
j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c;
|
||||
@@ -2513,8 +2445,15 @@
|
||||
p_70001_1_.func_76472_a("gl_max_texture_size", Integer.valueOf(func_71369_N()));
|
||||
}
|
||||
|
||||
+ //Forge: Adds a optimization to the getGLMaximumTextureSize, only calculate it once.
|
||||
+ private static int max_texture_size = -1;
|
||||
public static int func_71369_N()
|
||||
{
|
||||
+ if (max_texture_size != -1) return max_texture_size;
|
||||
+ if (max_texture_size != -1)
|
||||
+ {
|
||||
+ return max_texture_size;
|
||||
+ }
|
||||
+
|
||||
for (int i = 16384; i > 0; i >>= 1)
|
||||
{
|
||||
GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null);
|
||||
@@ -2753,6 +2658,7 @@
|
||||
@@ -2522,6 +2461,7 @@
|
||||
|
||||
if (j != 0)
|
||||
{
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
@@ -36,6 +36,10 @@
|
||||
@@ -35,6 +35,10 @@
|
||||
import paulscode.sound.codecs.CodecJOrbis;
|
||||
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
|
||||
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.*;
|
||||
+import net.minecraftforge.client.event.sound.*;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class SoundManager
|
||||
{
|
||||
@@ -70,6 +74,7 @@
|
||||
@@ -69,6 +73,7 @@
|
||||
{
|
||||
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
|
||||
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
catch (SoundSystemException soundsystemexception)
|
||||
{
|
||||
@@ -81,6 +86,7 @@
|
||||
@@ -80,6 +85,7 @@
|
||||
{
|
||||
this.func_148613_b();
|
||||
this.func_148608_i();
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
private synchronized void func_148608_i()
|
||||
@@ -329,6 +335,9 @@
|
||||
@@ -302,6 +308,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -37,7 +37,7 @@
|
||||
SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b());
|
||||
|
||||
if (soundeventaccessorcomposite == null)
|
||||
@@ -370,10 +379,12 @@
|
||||
@@ -343,10 +352,12 @@
|
||||
if (soundpoolentry.func_148648_d())
|
||||
{
|
||||
this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
|
||||
@@ -129,6 +129,6 @@
|
||||
f *= 1.0F - f1 * 0.15F;
|
||||
}
|
||||
|
||||
- return f;
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
|
||||
@@ -151,7 +151,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- public float func_70047_e()
|
||||
+ @Override
|
||||
+ public float getDefaultEyeHeight()
|
||||
{
|
||||
return 1.82F;
|
||||
}
|
||||
@@ -1,78 +1,85 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
@@ -53,6 +53,9 @@
|
||||
@@ -50,6 +50,9 @@
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Session;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EntityPlayerSP extends AbstractClientPlayer
|
||||
@@ -342,6 +345,15 @@
|
||||
this.field_71159_c.field_71456_v.func_146158_b().func_146227_a(p_146105_1_);
|
||||
@@ -325,7 +328,7 @@
|
||||
f *= 1.0F - f1 * 0.15F;
|
||||
}
|
||||
|
||||
- return f;
|
||||
+ return ForgeHooksClient.getOffsetFOV(this, f);
|
||||
}
|
||||
|
||||
+ private boolean isHeadspaceFree(BlockPos pos, int height)
|
||||
public void func_71053_j()
|
||||
@@ -479,20 +482,45 @@
|
||||
return this.field_70170_p.func_147439_a(p_71153_1_, p_71153_2_, p_71153_3_).func_149721_r();
|
||||
}
|
||||
|
||||
+ private boolean isHeadspaceFree(int x, int y, int z, int height)
|
||||
+ {
|
||||
+ for (int y = 0; y < height; y++)
|
||||
+ for (int i1 = 0; i1 < height; i1++)
|
||||
+ {
|
||||
+ if (func_175162_d(pos.func_177982_a(0, y, 0))) return false;
|
||||
+ if (func_71153_f(x, y + i1, z + 1)) return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
|
||||
{
|
||||
if (this.field_70145_X)
|
||||
@@ -354,30 +366,34 @@
|
||||
double d3 = p_145771_1_ - (double)blockpos.func_177958_n();
|
||||
double d4 = p_145771_5_ - (double)blockpos.func_177952_p();
|
||||
+ if (this.field_70145_X)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
int i = MathHelper.func_76128_c(p_145771_1_);
|
||||
int j = MathHelper.func_76128_c(p_145771_3_);
|
||||
int k = MathHelper.func_76128_c(p_145771_5_);
|
||||
double d3 = p_145771_1_ - (double)i;
|
||||
double d4 = p_145771_5_ - (double)k;
|
||||
|
||||
- if (!this.func_175162_d(blockpos))
|
||||
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
|
||||
- if (this.func_71153_f(i, j, k) || this.func_71153_f(i, j + 1, k))
|
||||
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
|
||||
+
|
||||
+ boolean inTranslucentBlock = this.isHeadspaceFree(blockpos, entHeight);
|
||||
+ boolean inTranslucentBlock = true;
|
||||
+
|
||||
+ if (inTranslucentBlock)
|
||||
{
|
||||
byte b0 = -1;
|
||||
double d5 = 9999.0D;
|
||||
+ for (int i1 = 0; i1 < entHeight; i1++)
|
||||
{
|
||||
- boolean flag = !this.func_71153_f(i - 1, j, k) && !this.func_71153_f(i - 1, j + 1, k);
|
||||
- boolean flag1 = !this.func_71153_f(i + 1, j, k) && !this.func_71153_f(i + 1, j + 1, k);
|
||||
- boolean flag2 = !this.func_71153_f(i, j, k - 1) && !this.func_71153_f(i, j + 1, k - 1);
|
||||
- boolean flag3 = !this.func_71153_f(i, j, k + 1) && !this.func_71153_f(i, j + 1, k + 1);
|
||||
+ if (!this.func_71153_f(i, j + i1, k))
|
||||
+ {
|
||||
+ inTranslucentBlock = false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (inTranslucentBlock)
|
||||
+ {
|
||||
+ boolean flag = !isHeadspaceFree(i - 1, j, k, entHeight);
|
||||
+ boolean flag1 = !isHeadspaceFree(i + 1, j, k, entHeight);
|
||||
+ boolean flag2 = !isHeadspaceFree(i, j, k - 1, entHeight);
|
||||
+ boolean flag3 = !isHeadspaceFree(i, j, k + 1, entHeight);
|
||||
byte b0 = -1;
|
||||
double d5 = 9999.0D;
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177976_e()) && d3 < d5)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d3 < d5)
|
||||
{
|
||||
d5 = d3;
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d3 < d5)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d3 < d5)
|
||||
{
|
||||
d5 = 1.0D - d3;
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177978_c()) && d4 < d5)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d4 < d5)
|
||||
{
|
||||
d5 = d4;
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d4 < d5)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d4 < d5)
|
||||
{
|
||||
d5 = 1.0D - d4;
|
||||
b0 = 5;
|
||||
@@ -445,6 +461,9 @@
|
||||
@@ -576,6 +604,12 @@
|
||||
|
||||
public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_)
|
||||
{
|
||||
+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, p_85030_1_, p_85030_2_, p_85030_3_);
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event)) return;
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ p_85030_1_ = event.name;
|
||||
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
|
||||
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u - (double)this.field_70129_M, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
|
||||
}
|
||||
|
||||
@@ -1,29 +1,53 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
|
||||
@@ -217,13 +217,14 @@
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.client.gui;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
+import com.google.common.collect.ObjectArrays;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.io.File;
|
||||
@@ -24,6 +25,7 @@
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
+import net.minecraftforge.client.ClientCommandHandler;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
@@ -131,6 +133,7 @@
|
||||
public void func_146403_a(String p_146403_1_)
|
||||
{
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_146403_1_);
|
||||
+ if (ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_146403_1_) == 1) return;
|
||||
this.field_146297_k.field_71439_g.func_71165_d(p_146403_1_);
|
||||
}
|
||||
|
||||
@@ -305,13 +308,14 @@
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1);
|
||||
}
|
||||
|
||||
- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++));
|
||||
+ this.field_146415_a.func_146191_b(net.minecraft.util.EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++)));
|
||||
+ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++)));
|
||||
}
|
||||
|
||||
private void func_146405_a(String p_146405_1_, String p_146405_2_)
|
||||
{
|
||||
if (p_146405_1_.length() >= 1)
|
||||
{
|
||||
+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
|
||||
BlockPos blockpos = null;
|
||||
|
||||
if (this.field_146297_k.field_71476_x != null && this.field_146297_k.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
@@ -285,6 +286,13 @@
|
||||
+ ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
|
||||
this.field_146297_k.field_71439_g.field_71174_a.func_147297_a(new C14PacketTabComplete(p_146405_1_));
|
||||
this.field_146414_r = true;
|
||||
}
|
||||
@@ -433,6 +437,13 @@
|
||||
String[] astring1 = p_146406_1_;
|
||||
int i = p_146406_1_.length;
|
||||
|
||||
+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete;
|
||||
+ String[] complete = ClientCommandHandler.instance.latestAutoComplete;
|
||||
+ if (complete != null)
|
||||
+ {
|
||||
+ astring1 = com.google.common.collect.ObjectArrays.concat(complete, astring1, String.class);
|
||||
+ astring1 = ObjectArrays.concat(complete, astring1, String.class);
|
||||
+ i = astring1.length;
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -1,27 +1,20 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -322,14 +322,7 @@
|
||||
@@ -320,7 +320,7 @@
|
||||
}
|
||||
else if (p_146284_1_.field_146127_k == 8)
|
||||
{
|
||||
- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c)
|
||||
- {
|
||||
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.field_146297_k.func_147108_a(new GuiCustomizeWorldScreen(this, this.field_146334_a));
|
||||
- }
|
||||
+ WorldType.field_77139_a[this.field_146331_K].onCustomizeButton(field_146297_k, this);
|
||||
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
|
||||
+ WorldType.field_77139_a[field_146331_K].onCustomizeButton(field_146297_k, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -381,7 +374,7 @@
|
||||
this.field_146326_C.field_146125_m = this.field_146344_y;
|
||||
this.field_146320_D.field_146125_m = this.field_146344_y;
|
||||
this.field_146321_E.field_146125_m = this.field_146344_y;
|
||||
- this.field_146322_F.field_146125_m = this.field_146344_y && (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c || WorldType.field_77139_a[this.field_146331_K] == WorldType.field_180271_f);
|
||||
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
|
||||
}
|
||||
@@ -338,7 +338,7 @@
|
||||
this.field_146326_C.field_146125_m = this.field_146344_y;
|
||||
this.field_146320_D.field_146125_m = this.field_146344_y;
|
||||
this.field_146321_E.field_146125_m = this.field_146344_y;
|
||||
- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c;
|
||||
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
|
||||
|
||||
this.func_146319_h();
|
||||
if (this.field_146344_y)
|
||||
{
|
||||
@@ -1,10 +1,18 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java
|
||||
@@ -511,6 +511,7 @@
|
||||
@@ -30,6 +30,7 @@
|
||||
import net.minecraft.world.demo.DemoWorldServer;
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -614,6 +615,7 @@
|
||||
this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.field_78288_b + 1)), 16777215);
|
||||
}
|
||||
}
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.field_146289_q, this.field_146294_l, this.field_146295_m);
|
||||
+ ForgeHooksClient.renderMainMenu(this, field_146289_q, field_146294_l, field_146295_m);
|
||||
String s1 = "Copyright Mojang AB. Do not distribute!";
|
||||
this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1);
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
|
||||
@@ -37,6 +37,9 @@
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
@@ -17,6 +17,10 @@
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
+import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
|
||||
+import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -146,7 +149,8 @@
|
||||
+
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -111,7 +115,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- this.func_146283_a(list, p_146285_2_, p_146285_3_);
|
||||
+ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_);
|
||||
+ this.drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
|
||||
+ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
|
||||
}
|
||||
|
||||
protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_)
|
||||
@@ -156,6 +160,11 @@
|
||||
@@ -121,6 +126,11 @@
|
||||
|
||||
protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_)
|
||||
{
|
||||
@@ -31,8 +32,8 @@
|
||||
+ {
|
||||
if (!p_146283_1_.isEmpty())
|
||||
{
|
||||
GlStateManager.func_179101_C();
|
||||
@@ -168,7 +177,7 @@
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
@@ -133,7 +143,7 @@
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
String s = (String)iterator.next();
|
||||
@@ -41,24 +42,16 @@
|
||||
|
||||
if (l > k)
|
||||
{
|
||||
@@ -213,7 +222,7 @@
|
||||
@@ -178,7 +188,7 @@
|
||||
for (int i2 = 0; i2 < p_146283_1_.size(); ++i2)
|
||||
{
|
||||
String s1 = (String)p_146283_1_.get(i2);
|
||||
- this.field_146289_q.func_175063_a(s1, (float)j2, (float)k2, -1);
|
||||
+ font.func_175063_a(s1, j2, k2, -1);
|
||||
- this.field_146289_q.func_78261_a(s1, j2, k2, -1);
|
||||
+ font.func_78261_a(s1, j2, k2, -1);
|
||||
|
||||
if (i2 == 0)
|
||||
{
|
||||
@@ -441,6 +450,7 @@
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_);
|
||||
}
|
||||
|
||||
+ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_175281_1_) != 0) return;
|
||||
this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_);
|
||||
}
|
||||
|
||||
@@ -454,9 +464,14 @@
|
||||
@@ -207,9 +217,14 @@
|
||||
|
||||
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
|
||||
{
|
||||
@@ -76,7 +69,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,8 +497,12 @@
|
||||
@@ -234,8 +249,12 @@
|
||||
this.field_146289_q = p_146280_1_.field_71466_p;
|
||||
this.field_146294_l = p_146280_2_;
|
||||
this.field_146295_m = p_146280_3_;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSleepMP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSleepMP.java
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
if (!s.isEmpty())
|
||||
{
|
||||
- this.field_146297_k.field_71439_g.func_71165_d(s);
|
||||
+ this.func_175275_f(s); // Forge: fix vanilla not adding messages to the sent list while sleeping
|
||||
}
|
||||
|
||||
this.field_146415_a.func_146180_a("");
|
||||
@@ -1,40 +1,39 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
|
||||
@@ -185,16 +185,7 @@
|
||||
GlStateManager.func_179106_n();
|
||||
Tessellator tessellator = Tessellator.func_178181_a();
|
||||
WorldRenderer worldrenderer = tessellator.func_178180_c();
|
||||
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
|
||||
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- float f1 = 32.0F;
|
||||
- worldrenderer.func_178970_b();
|
||||
- worldrenderer.func_178991_c(2105376);
|
||||
- worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
- worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
- worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
- worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
- tessellator.func_78381_a();
|
||||
+ this.drawContainerBackground(tessellator);
|
||||
int i1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
|
||||
int j1 = this.field_148153_b + 4 - (int)this.field_148169_q;
|
||||
@@ -294,16 +294,7 @@
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
Tessellator tessellator = Tessellator.field_78398_a;
|
||||
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
|
||||
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- float f1 = 32.0F;
|
||||
- tessellator.func_78382_b();
|
||||
- tessellator.func_78378_d(2105376);
|
||||
- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
- tessellator.func_78381_a();
|
||||
+ drawContainerBackground(tessellator);
|
||||
l1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
|
||||
i2 = this.field_148153_b + 4 - (int)this.field_148169_q;
|
||||
|
||||
@@ -456,4 +447,19 @@
|
||||
@@ -475,4 +466,18 @@
|
||||
{
|
||||
return this.field_148149_f;
|
||||
}
|
||||
+
|
||||
+ protected void drawContainerBackground(Tessellator tessellator)
|
||||
+ {
|
||||
+ WorldRenderer worldrenderer = tessellator.func_178180_c();
|
||||
+ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
|
||||
+ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
+ float f1 = 32.0F;
|
||||
+ worldrenderer.func_178970_b();
|
||||
+ worldrenderer.func_178991_c(2105376);
|
||||
+ worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
+ worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
+ worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
+ worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
+ tessellator.func_78382_b();
|
||||
+ tessellator.func_78378_d(2105376);
|
||||
+ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
+ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
|
||||
+ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
+ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
|
||||
+ tessellator.func_78381_a();
|
||||
+ }
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
|
||||
@@ -24,6 +24,9 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
+import java.util.LinkedList;
|
||||
+import java.util.List;
|
||||
+import net.minecraftforge.common.AchievementPage;
|
||||
@@ -43,7 +43,7 @@
|
||||
+ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
|
||||
}
|
||||
|
||||
protected void func_146284_a(GuiButton p_146284_1_) throws IOException
|
||||
protected void func_146284_a(GuiButton p_146284_1_)
|
||||
@@ -75,6 +91,16 @@
|
||||
{
|
||||
this.field_146297_k.func_147108_a(this.field_146562_a);
|
||||
@@ -56,13 +56,13 @@
|
||||
+ {
|
||||
+ currentPage = -1;
|
||||
+ }
|
||||
+ this.button.field_146126_j = AchievementPage.getTitle(currentPage);
|
||||
+ button.field_146126_j = AchievementPage.getTitle(currentPage);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,11 +367,12 @@
|
||||
int i4;
|
||||
@@ -339,11 +365,12 @@
|
||||
int j4;
|
||||
int l4;
|
||||
|
||||
- for (i3 = 0; i3 < AchievementList.field_76007_e.size(); ++i3)
|
||||
@@ -77,40 +77,15 @@
|
||||
{
|
||||
j3 = achievement1.field_75993_a * 24 - k + 11;
|
||||
k3 = achievement1.field_75991_b * 24 - l + 11;
|
||||
@@ -401,9 +428,9 @@
|
||||
@@ -400,9 +427,9 @@
|
||||
int i5;
|
||||
int j5;
|
||||
|
||||
- for (k3 = 0; k3 < AchievementList.field_76007_e.size(); ++k3)
|
||||
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
|
||||
- for (l4 = 0; l4 < AchievementList.field_76007_e.size(); ++l4)
|
||||
+ for (l4 = 0; l4 < achievementList.size(); ++l4)
|
||||
{
|
||||
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(k3);
|
||||
+ Achievement achievement2 = (Achievement)achievementList.get(k3);
|
||||
l4 = achievement2.field_75993_a * 24 - k;
|
||||
i5 = achievement2.field_75991_b * 24 - l;
|
||||
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(l4);
|
||||
+ Achievement achievement2 = (Achievement)achievementList.get(l4);
|
||||
i5 = achievement2.field_75993_a * 24 - k;
|
||||
j5 = achievement2.field_75991_b * 24 - l;
|
||||
|
||||
@@ -445,6 +472,7 @@
|
||||
|
||||
this.field_146297_k.func_110434_K().func_110577_a(field_146561_C);
|
||||
|
||||
+ GlStateManager.func_179147_l(); // Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it.
|
||||
if (achievement2.func_75984_f())
|
||||
{
|
||||
this.func_73729_b(l4 - 2, i5 - 2, 26, 202, 26, 26);
|
||||
@@ -453,6 +481,7 @@
|
||||
{
|
||||
this.func_73729_b(l4 - 2, i5 - 2, 0, 202, 26, 26);
|
||||
}
|
||||
+ GlStateManager.func_179084_k(); //Forge: Cleanup states we set.
|
||||
|
||||
if (!this.field_146556_E.func_77442_b(achievement2))
|
||||
{
|
||||
@@ -461,7 +490,7 @@
|
||||
this.field_146296_j.func_175039_a(false);
|
||||
}
|
||||
|
||||
- GlStateManager.func_179145_e();
|
||||
+ GlStateManager.func_179140_f(); //Forge: Make sure Lighting is disabled. Fixes MC-33065
|
||||
GlStateManager.func_179089_o();
|
||||
this.field_146296_j.func_180450_b(achievement2.field_75990_d, l4 + 3, i5 + 3);
|
||||
GlStateManager.func_179112_b(770, 771);
|
||||
@@ -1,44 +1,40 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -6,6 +6,7 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
@@ -178,8 +179,11 @@
|
||||
GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F);
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
@@ -112,7 +113,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ //Forge: Force lighting to be disabled as there are some issue where lighting would
|
||||
+ //incorrectly be applied based on items that are in the inventory.
|
||||
+ GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.func_146979_b(p_73863_1_, p_73863_2_);
|
||||
+ GL11.glEnable(GL11.GL_LIGHTING);
|
||||
InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by;
|
||||
ItemStack itemstack = this.field_147012_x == null ? inventoryplayer.func_70445_o() : this.field_147012_x;
|
||||
|
||||
@@ -176,8 +181,11 @@
|
||||
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
|
||||
this.field_73735_i = 200.0F;
|
||||
this.field_146296_j.field_77023_b = 200.0F;
|
||||
field_146296_j.field_77023_b = 200.0F;
|
||||
- field_146296_j.func_82406_b(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_);
|
||||
- field_146296_j.func_94148_a(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
|
||||
+ FontRenderer font = null;
|
||||
+ if (p_146982_1_ != null) font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_);
|
||||
+ if (font == null) font = field_146289_q;
|
||||
this.field_146296_j.func_180450_b(p_146982_1_, p_146982_2_, p_146982_3_);
|
||||
- this.field_146296_j.func_180453_a(this.field_146289_q, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
|
||||
+ this.field_146296_j.func_180453_a(font, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
|
||||
+ field_146296_j.func_82406_b(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_);
|
||||
+ field_146296_j.func_94148_a(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
|
||||
this.field_73735_i = 0.0F;
|
||||
this.field_146296_j.field_77023_b = 0.0F;
|
||||
field_146296_j.field_77023_b = 0.0F;
|
||||
}
|
||||
@@ -240,13 +244,12 @@
|
||||
|
||||
if (itemstack == null)
|
||||
{
|
||||
- String s1 = p_146977_1_.func_178171_c();
|
||||
+ TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite();
|
||||
|
||||
- if (s1 != null)
|
||||
+ if (textureatlassprite != null)
|
||||
{
|
||||
- TextureAtlasSprite textureatlassprite = this.field_146297_k.func_147117_R().func_110572_b(s1);
|
||||
GlStateManager.func_179140_f();
|
||||
- this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110575_b);
|
||||
+ this.field_146297_k.func_110434_K().func_110577_a(p_146977_1_.getBackgroundLocation());
|
||||
this.func_175175_a(i, j, textureatlassprite, 16, 16);
|
||||
GlStateManager.func_179145_e();
|
||||
flag1 = true;
|
||||
@@ -465,6 +468,7 @@
|
||||
@@ -458,6 +466,7 @@
|
||||
|
||||
protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_)
|
||||
{
|
||||
|
||||
+34
-36
@@ -9,7 +9,7 @@
|
||||
|
||||
public GuiContainerCreative(EntityPlayer p_i1088_1_)
|
||||
{
|
||||
@@ -187,7 +189,7 @@
|
||||
@@ -185,7 +187,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,30 +18,30 @@
|
||||
{
|
||||
if (p_146984_3_ == 0)
|
||||
{
|
||||
@@ -262,6 +264,13 @@
|
||||
@@ -260,6 +262,13 @@
|
||||
this.func_147050_b(CreativeTabs.field_78032_a[i]);
|
||||
this.field_147059_E = new CreativeCrafting(this.field_146297_k);
|
||||
this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E);
|
||||
+ int tabCount = CreativeTabs.field_78032_a.length;
|
||||
+ if (tabCount > 12)
|
||||
+ {
|
||||
+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<"));
|
||||
+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<"));
|
||||
+ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">"));
|
||||
+ maxPages = ((tabCount - 12) / 10) + 1;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -283,7 +292,7 @@
|
||||
@@ -281,7 +290,7 @@
|
||||
|
||||
protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException
|
||||
protected void func_73869_a(char p_73869_1_, int p_73869_2_)
|
||||
{
|
||||
- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a())
|
||||
+ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar())
|
||||
{
|
||||
if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D))
|
||||
{
|
||||
@@ -320,6 +329,15 @@
|
||||
@@ -318,6 +327,15 @@
|
||||
{
|
||||
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
|
||||
containercreative.field_148330_a.clear();
|
||||
@@ -57,7 +57,7 @@
|
||||
Iterator iterator = Item.field_150901_e.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
@@ -331,10 +349,17 @@
|
||||
@@ -329,7 +347,13 @@
|
||||
item.func_150895_a(item, (CreativeTabs)null, containercreative.field_148330_a);
|
||||
}
|
||||
}
|
||||
@@ -71,20 +71,25 @@
|
||||
Enchantment[] aenchantment = Enchantment.field_77331_b;
|
||||
int j = aenchantment.length;
|
||||
|
||||
+ if (CreativeTabs.field_78032_a[field_147058_w] != CreativeTabs.field_78027_g) j = 0; //Forge: Don't add enchants to custom tabs.
|
||||
for (int i = 0; i < j; ++i)
|
||||
{
|
||||
Enchantment enchantment = aenchantment[i];
|
||||
@@ -385,7 +410,7 @@
|
||||
@@ -383,7 +407,7 @@
|
||||
{
|
||||
CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w];
|
||||
|
||||
- if (creativetabs.func_78019_g())
|
||||
+ if (creativetabs != null && creativetabs.func_78019_g())
|
||||
{
|
||||
GlStateManager.func_179084_k();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752);
|
||||
@@ -428,7 +453,7 @@
|
||||
@@ -403,7 +427,7 @@
|
||||
{
|
||||
CreativeTabs creativetabs = acreativetabs[k1];
|
||||
|
||||
- if (this.func_147049_a(creativetabs, l, i1))
|
||||
+ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -426,7 +450,7 @@
|
||||
{
|
||||
CreativeTabs creativetabs = acreativetabs[k1];
|
||||
|
||||
@@ -93,7 +98,7 @@
|
||||
{
|
||||
this.func_147050_b(creativetabs);
|
||||
return;
|
||||
@@ -441,11 +466,13 @@
|
||||
@@ -439,11 +463,13 @@
|
||||
|
||||
private boolean func_147055_p()
|
||||
{
|
||||
@@ -107,7 +112,7 @@
|
||||
int i = field_147058_w;
|
||||
field_147058_w = p_147050_1_.func_78021_a();
|
||||
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
|
||||
@@ -514,12 +541,14 @@
|
||||
@@ -512,7 +538,7 @@
|
||||
|
||||
if (this.field_147062_A != null)
|
||||
{
|
||||
@@ -116,14 +121,7 @@
|
||||
{
|
||||
this.field_147062_A.func_146189_e(true);
|
||||
this.field_147062_A.func_146205_d(false);
|
||||
this.field_147062_A.func_146195_b(true);
|
||||
this.field_147062_A.func_146180_a("");
|
||||
+ this.field_147062_A.field_146218_h = p_147050_1_.getSearchbarWidth();
|
||||
+ this.field_147062_A.field_146209_f = this.field_147003_i + (82 /*default left*/ + 89 /*default width*/) - this.field_147062_A.field_146218_h;
|
||||
this.func_147053_i();
|
||||
}
|
||||
else
|
||||
@@ -590,23 +619,45 @@
|
||||
@@ -608,23 +634,45 @@
|
||||
|
||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||
CreativeTabs[] acreativetabs = CreativeTabs.field_78032_a;
|
||||
@@ -160,7 +158,7 @@
|
||||
+ {
|
||||
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
|
||||
+ int width = field_146289_q.func_78256_a(page);
|
||||
+ GlStateManager.func_179140_f();
|
||||
+ GL11.glDisable(GL11.GL_LIGHTING);
|
||||
+ this.field_73735_i = 300.0F;
|
||||
+ field_146296_j.field_77023_b = 300.0F;
|
||||
+ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1);
|
||||
@@ -168,10 +166,10 @@
|
||||
+ field_146296_j.field_77023_b = 0.0F;
|
||||
+ }
|
||||
+
|
||||
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.func_179140_f();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
@@ -675,17 +726,36 @@
|
||||
@@ -693,17 +741,37 @@
|
||||
int k = acreativetabs.length;
|
||||
int l;
|
||||
|
||||
@@ -186,6 +184,7 @@
|
||||
this.field_146297_k.func_110434_K().func_110577_a(field_147061_u);
|
||||
|
||||
+ if (creativetabs1 == null) continue;
|
||||
+
|
||||
if (creativetabs1.func_78021_a() != field_147058_w)
|
||||
{
|
||||
this.func_147051_a(creativetabs1);
|
||||
@@ -209,7 +208,7 @@
|
||||
this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f()));
|
||||
this.func_73729_b(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g);
|
||||
this.field_147062_A.func_146194_f();
|
||||
@@ -700,6 +770,14 @@
|
||||
@@ -718,6 +786,14 @@
|
||||
this.func_73729_b(i1, k + (int)((float)(l - k - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15);
|
||||
}
|
||||
|
||||
@@ -224,7 +223,7 @@
|
||||
this.func_147051_a(creativetabs);
|
||||
|
||||
if (creativetabs == CreativeTabs.field_78036_m)
|
||||
@@ -710,6 +788,15 @@
|
||||
@@ -728,6 +804,15 @@
|
||||
|
||||
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
|
||||
{
|
||||
@@ -240,16 +239,15 @@
|
||||
int k = p_147049_1_.func_78020_k();
|
||||
int l = 28 * k;
|
||||
byte b0 = 0;
|
||||
@@ -810,6 +897,8 @@
|
||||
@@ -828,6 +913,7 @@
|
||||
}
|
||||
|
||||
GlStateManager.func_179140_f();
|
||||
+ GlStateManager.func_179124_c(1F, 1F, 1F); //Forge: Reset color in case Items change it.
|
||||
+ GlStateManager.func_179147_l(); //Forge: Make sure blend is enabled else tabs show a white border.
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
+ GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it.
|
||||
this.func_73729_b(l, i1, j, k, 28, b0);
|
||||
this.field_73735_i = 100.0F;
|
||||
this.field_146296_j.field_77023_b = 100.0F;
|
||||
@@ -836,6 +925,15 @@
|
||||
field_146296_j.field_77023_b = 100.0F;
|
||||
@@ -854,6 +940,15 @@
|
||||
{
|
||||
this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m()));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java
|
||||
@@ -202,7 +202,7 @@
|
||||
GuiScreenCreateOnlineWorld.field_146765_a.error("Couldn\'t create world");
|
||||
this.func_148416_a(unsupportedencodingexception.getLocalizedMessage());
|
||||
}
|
||||
- catch (IOException ioexception)
|
||||
+ catch (@SuppressWarnings("hiding") IOException ioexception)
|
||||
{
|
||||
GuiScreenCreateOnlineWorld.field_146765_a.error("Could not parse response creating world");
|
||||
this.func_148416_a(ioexception.getLocalizedMessage());
|
||||
@@ -1,8 +1,8 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java
|
||||
@@ -10,7 +10,6 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
-@SideOnly(Side.CLIENT)
|
||||
public abstract class ModelBase
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java
|
||||
@@ -4,7 +4,6 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
-@SideOnly(Side.CLIENT)
|
||||
public class ModelBox
|
||||
{
|
||||
private PositionTextureVertex[] field_78253_h;
|
||||
@@ -82,6 +81,7 @@
|
||||
@@ -77,6 +76,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
public void func_178780_a(WorldRenderer p_178780_1_, float p_178780_2_)
|
||||
public void func_78245_a(Tessellator p_78245_1_, float p_78245_2_)
|
||||
{
|
||||
for (int i = 0; i < this.field_78254_i.length; ++i)
|
||||
@@ -1,14 +1,14 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java
|
||||
@@ -10,7 +10,6 @@
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -8,7 +8,6 @@
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
-@SideOnly(Side.CLIENT)
|
||||
public class ModelRenderer
|
||||
{
|
||||
public float field_78801_a;
|
||||
@@ -110,6 +109,7 @@
|
||||
@@ -102,6 +101,7 @@
|
||||
this.field_78798_e = p_78793_3_;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
public void func_78785_a(float p_78785_1_)
|
||||
{
|
||||
if (!this.field_78807_k)
|
||||
@@ -192,6 +192,7 @@
|
||||
@@ -184,6 +184,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
public void func_78791_b(float p_78791_1_)
|
||||
{
|
||||
if (!this.field_78807_k)
|
||||
@@ -227,6 +228,7 @@
|
||||
@@ -219,6 +220,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
public void func_78794_c(float p_78794_1_)
|
||||
{
|
||||
if (!this.field_78807_k)
|
||||
@@ -268,6 +270,7 @@
|
||||
@@ -260,6 +262,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
@@ -1,10 +1,7 @@
|
||||
package net.minecraft.client.model;
|
||||
|
||||
-import cpw.mods.fml.relauncher.Side;
|
||||
-import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.Vec3;
|
||||
-import net.minecraftforge.fml.relauncher.Side;
|
||||
-import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-@SideOnly(Side.CLIENT)
|
||||
public class PositionTextureVertex
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java
|
||||
@@ -3,10 +3,7 @@
|
||||
@@ -1,11 +1,8 @@
|
||||
package net.minecraft.client.model;
|
||||
|
||||
-import cpw.mods.fml.relauncher.Side;
|
||||
-import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.util.Vec3;
|
||||
-import net.minecraftforge.fml.relauncher.Side;
|
||||
-import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-@SideOnly(Side.CLIENT)
|
||||
public class TexturedQuad
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk);
|
||||
this.field_73237_c.add(chunk);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk));
|
||||
chunk.func_177417_c(true);
|
||||
chunk.field_76636_d = true;
|
||||
return chunk;
|
||||
}
|
||||
@@ -1,69 +1,85 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
||||
@@ -113,6 +113,12 @@
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,10 @@
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
|
||||
+import net.minecraftforge.common.ForgeHooks;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class PlayerControllerMP
|
||||
{
|
||||
@@ -88,6 +92,12 @@
|
||||
|
||||
public boolean func_78751_a(int p_78751_1_, int p_78751_2_, int p_78751_3_, int p_78751_4_)
|
||||
{
|
||||
+ ItemStack stack = field_78776_a.field_71439_g.func_71045_bC();
|
||||
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_178888_1_, field_78776_a.field_71439_g))
|
||||
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_78751_1_, p_78751_2_, p_78751_3_, field_78776_a.field_71439_g))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_70694_bm() != null && this.field_78776_a.field_71439_g.func_70694_bm().func_77973_b() instanceof ItemSword)
|
||||
if (this.field_78779_k.func_82752_c() && !this.field_78776_a.field_71439_g.func_82246_f(p_78751_1_, p_78751_2_, p_78751_3_))
|
||||
{
|
||||
return false;
|
||||
@@ -130,7 +136,7 @@
|
||||
else
|
||||
@@ -109,7 +119,7 @@
|
||||
{
|
||||
worldclient.func_175718_b(2001, p_178888_1_, Block.func_176210_f(iblockstate));
|
||||
- boolean flag = worldclient.func_175698_g(p_178888_1_);
|
||||
+ boolean flag = block1.removedByPlayer(worldclient, p_178888_1_, field_78776_a.field_71439_g, false);
|
||||
worldclient.func_72926_e(2001, p_78751_1_, p_78751_2_, p_78751_3_, Block.func_149682_b(block) + (worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_) << 12));
|
||||
int i1 = worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_);
|
||||
- boolean flag = worldclient.func_147468_f(p_78751_1_, p_78751_2_, p_78751_3_);
|
||||
+ boolean flag = block.removedByPlayer(worldclient, field_78776_a.field_71439_g, p_78751_1_, p_78751_2_, p_78751_3_);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
@@ -360,11 +366,19 @@
|
||||
@@ -304,11 +314,18 @@
|
||||
float f2 = (float)p_78760_8_.field_72449_c - (float)p_78760_6_;
|
||||
boolean flag = false;
|
||||
|
||||
- if ((!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null) && p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2))
|
||||
+ if (p_78760_3_ != null &&
|
||||
+ p_78760_3_.func_77973_b() != null &&
|
||||
+ p_78760_3_.func_77973_b().onItemUseFirst(p_78760_3_, p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2))
|
||||
{
|
||||
if (this.field_78779_k != WorldSettings.GameType.SPECTATOR)
|
||||
- flag = true;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
+ if (!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null || p_78760_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_))
|
||||
+ {
|
||||
+ flag = p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2);
|
||||
+ }
|
||||
+
|
||||
if (!flag && p_78760_3_ != null && p_78760_3_.func_77973_b() instanceof ItemBlock)
|
||||
{
|
||||
ItemBlock itemblock = (ItemBlock)p_78760_3_.func_77973_b();
|
||||
@@ -340,7 +357,15 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2);
|
||||
+ if (!p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (p_78760_3_.field_77994_a <= 0)
|
||||
+ {
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78760_1_, p_78760_3_));
|
||||
+ }
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,9 +384,10 @@
|
||||
{
|
||||
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1;
|
||||
|
||||
- if (itemstack1.field_77994_a == 0)
|
||||
+ if (itemstack1.field_77994_a <= 0)
|
||||
{
|
||||
+
|
||||
+ if (p_178890_3_ != null &&
|
||||
+ p_178890_3_.func_77973_b() != null &&
|
||||
+ p_178890_3_.func_77973_b().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
IBlockState iblockstate = p_178890_2_.func_180495_p(p_178890_4_);
|
||||
|
||||
- if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null) && iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2))
|
||||
+ if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null || p_178890_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_)))
|
||||
{
|
||||
- flag = true;
|
||||
+ flag = iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2);
|
||||
}
|
||||
|
||||
if (!flag && p_178890_3_ != null && p_178890_3_.func_77973_b() instanceof ItemBlock)
|
||||
@@ -397,7 +411,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2);
|
||||
+ if (!p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false;
|
||||
+ if (p_178890_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_);
|
||||
+ return true;
|
||||
}
|
||||
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null;
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78769_1_, itemstack1));
|
||||
}
|
||||
else
|
||||
@@ -428,9 +444,10 @@
|
||||
{
|
||||
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1;
|
||||
|
||||
- if (itemstack1.field_77994_a == 0)
|
||||
+ if (itemstack1.field_77994_a <= 0)
|
||||
{
|
||||
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null;
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_78769_1_, itemstack1);
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
@@ -1,12 +1,38 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
||||
@@ -54,8 +54,8 @@
|
||||
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.func_76570_a(p_i45063_3_), p_i45063_5_, true);
|
||||
@@ -34,6 +34,9 @@
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.storage.SaveHandlerMP;
|
||||
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
+import net.minecraftforge.event.world.WorldEvent;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class WorldClient extends World
|
||||
{
|
||||
@@ -51,8 +54,11 @@
|
||||
super(new SaveHandlerMP(), "MpServer", WorldProvider.func_76570_a(p_i45063_3_), p_i45063_2_, p_i45063_5_);
|
||||
this.field_73035_a = p_i45063_1_;
|
||||
this.func_72912_H().func_176144_a(p_i45063_4_);
|
||||
- this.func_175652_B(new BlockPos(8, 64, 8));
|
||||
this.field_73011_w.func_76558_a(this);
|
||||
+ this.func_175652_B(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect.
|
||||
this.field_73020_y = this.func_72970_h();
|
||||
this.field_72988_C = new SaveDataMemoryStorage();
|
||||
this.func_72966_v();
|
||||
this.field_73013_u = p_i45063_4_;
|
||||
- this.func_72950_A(8, 64, 8);
|
||||
this.field_72988_C = p_i45063_1_.field_147305_a;
|
||||
+ this.field_72995_K = true;
|
||||
+ this.finishSetup();
|
||||
+ this.func_72950_A(8, 64, 8);
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this));
|
||||
}
|
||||
|
||||
public void func_72835_b()
|
||||
@@ -261,6 +267,12 @@
|
||||
|
||||
protected void func_72979_l()
|
||||
{
|
||||
+ super.func_72979_l();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void updateWeatherBody()
|
||||
+ {
|
||||
if (!this.field_73011_w.field_76576_e)
|
||||
{
|
||||
;
|
||||
@@ -1,42 +1,35 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
|
||||
@@ -410,7 +410,8 @@
|
||||
public void func_147286_a(S11PacketSpawnExperienceOrb p_147286_1_)
|
||||
{
|
||||
PacketThreadUtil.func_180031_a(p_147286_1_, this, this.field_147299_f);
|
||||
- EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d(), (double)p_147286_1_.func_148983_e(), (double)p_147286_1_.func_148982_f(), p_147286_1_.func_148986_g());
|
||||
+ EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d() / 32.0D, (double)p_147286_1_.func_148983_e() / 32.0D, (double)p_147286_1_.func_148982_f() / 32.0D, p_147286_1_.func_148986_g());
|
||||
+ // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position
|
||||
entityxporb.field_70118_ct = p_147286_1_.func_148984_d();
|
||||
entityxporb.field_70117_cu = p_147286_1_.func_148983_e();
|
||||
entityxporb.field_70116_cv = p_147286_1_.func_148982_f();
|
||||
@@ -754,14 +755,16 @@
|
||||
@@ -190,6 +190,8 @@
|
||||
import net.minecraft.world.storage.ISaveHandler;
|
||||
import net.minecraft.world.storage.MapData;
|
||||
import net.minecraft.world.storage.MapStorage;
|
||||
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -673,7 +675,11 @@
|
||||
|
||||
public void func_147251_a(S02PacketChat p_147251_1_)
|
||||
{
|
||||
PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f);
|
||||
+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c());
|
||||
+ if (message == null) return;
|
||||
|
||||
if (p_147251_1_.func_179841_c() == 2)
|
||||
{
|
||||
- this.field_147299_f.field_71456_v.func_175188_a(p_147251_1_.func_148915_c(), false);
|
||||
+ this.field_147299_f.field_71456_v.func_175188_a(message, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c());
|
||||
+ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(message);
|
||||
}
|
||||
- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c());
|
||||
+ ClientChatReceivedEvent event = new ClientChatReceivedEvent(p_147251_1_.func_148915_c());
|
||||
+ if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null)
|
||||
+ {
|
||||
+ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(event.message);
|
||||
+ }
|
||||
}
|
||||
|
||||
@@ -1137,6 +1140,10 @@
|
||||
{
|
||||
tileentity.func_145839_a(p_147273_1_.func_148857_g());
|
||||
public void func_147279_a(S0BPacketAnimation p_147279_1_)
|
||||
@@ -1113,6 +1119,10 @@
|
||||
{
|
||||
tileentity.func_145839_a(p_147273_1_.func_148857_g());
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
|
||||
+ }
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,74 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
||||
@@ -135,6 +135,7 @@
|
||||
@@ -16,9 +16,11 @@
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
+import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ReportedException;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
+
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public void func_78873_a(EntityFX p_78873_1_)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -70,7 +72,10 @@
|
||||
|
||||
try
|
||||
{
|
||||
- entityfx.func_70071_h_();
|
||||
+ if (entityfx != null)
|
||||
+ {
|
||||
+ entityfx.func_70071_h_();
|
||||
+ }
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -95,7 +100,7 @@
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
|
||||
- if (entityfx.field_70128_L)
|
||||
+ if (entityfx == null || entityfx.field_70128_L)
|
||||
{
|
||||
this.field_78876_b[i].remove(j--);
|
||||
}
|
||||
@@ -144,6 +149,7 @@
|
||||
for (int j = 0; j < this.field_78876_b[i].size(); ++j)
|
||||
{
|
||||
final EntityFX entityfx = (EntityFX)this.field_78876_b[i].get(j);
|
||||
+ if (entityfx == null) continue;
|
||||
tessellator.func_78380_c(entityfx.func_70070_b(p_78874_2_));
|
||||
|
||||
try
|
||||
@@ -200,6 +206,7 @@
|
||||
for (int i = 0; i < list.size(); ++i)
|
||||
{
|
||||
EntityFX entityfx = (EntityFX)list.get(i);
|
||||
+ if (entityfx == null) continue;
|
||||
tessellator.func_78380_c(entityfx.func_70070_b(p_78872_2_));
|
||||
entityfx.func_70539_a(tessellator, p_78872_2_, f2, f6, f3, f4, f5);
|
||||
}
|
||||
@@ -218,7 +225,7 @@
|
||||
|
||||
public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_)
|
||||
{
|
||||
+ if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs.
|
||||
int i = p_78873_1_.func_70537_b();
|
||||
int j = p_78873_1_.func_174838_j() != 1.0F ? 0 : 1;
|
||||
|
||||
@@ -361,7 +362,7 @@
|
||||
|
||||
public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_)
|
||||
{
|
||||
- if (p_180533_2_.func_177230_c().func_149688_o() != Material.field_151579_a)
|
||||
+ if (!p_180533_2_.func_177230_c().isAir(field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this))
|
||||
- if (p_147215_4_.func_149688_o() != Material.field_151579_a)
|
||||
+ if (!p_147215_4_.isAir(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this))
|
||||
{
|
||||
p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_);
|
||||
byte b0 = 4;
|
||||
@@ -467,4 +468,13 @@
|
||||
|
||||
return "" + i;
|
||||
@@ -287,4 +294,13 @@
|
||||
{
|
||||
return "" + (this.field_78876_b[0].size() + this.field_78876_b[1].size() + this.field_78876_b[2].size());
|
||||
}
|
||||
+
|
||||
+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target)
|
||||
+ public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target)
|
||||
+ {
|
||||
+ Block block = field_78878_a.func_180495_p(pos).func_177230_c();
|
||||
+ Block block = field_78878_a.func_147439_a(x, y, z);
|
||||
+ if (block != null && !block.addHitEffects(field_78878_a, target, this))
|
||||
+ {
|
||||
+ func_180532_a(pos, target.field_178784_b);
|
||||
+ func_78867_a(x, y, z, target.field_72310_e);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
|
||||
@@ -12,20 +12,27 @@
|
||||
{
|
||||
private Block field_145784_a;
|
||||
private static final String __OBFID = "CL_00000932";
|
||||
+ private int side;
|
||||
|
||||
public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_)
|
||||
{
|
||||
+ this(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_, p_i1234_14_, p_i1234_15_, p_i1234_1_.field_73012_v.nextInt(6));
|
||||
+ }
|
||||
+
|
||||
+ public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_, int side)
|
||||
+ {
|
||||
super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_);
|
||||
this.field_145784_a = p_i1234_14_;
|
||||
- this.func_110125_a(p_i1234_14_.func_149691_a(0, p_i1234_15_));
|
||||
+ this.func_110125_a(p_i1234_14_.func_149691_a(side, p_i1234_15_));
|
||||
this.field_70545_g = p_i1234_14_.field_149763_I;
|
||||
this.field_70552_h = this.field_70553_i = this.field_70551_j = 0.6F;
|
||||
this.field_70544_f /= 2.0F;
|
||||
+ this.side = side;
|
||||
}
|
||||
|
||||
public EntityDiggingFX func_70596_a(int p_70596_1_, int p_70596_2_, int p_70596_3_)
|
||||
{
|
||||
- if (this.field_145784_a == Blocks.field_150349_c)
|
||||
+ if (this.field_145784_a == Blocks.field_150349_c && this.side != 1)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
|
||||
@@ -129,6 +129,12 @@
|
||||
ibakedmodel = ((WeightedBakedModel)ibakedmodel).func_177564_a(MathHelper.func_180186_a(p_175022_3_));
|
||||
}
|
||||
|
||||
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel)
|
||||
+ {
|
||||
+ IBlockState extendedState = block.getExtendedState(p_175022_1_, p_175022_2_, p_175022_3_);
|
||||
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState);
|
||||
+ }
|
||||
+
|
||||
return ibakedmodel;
|
||||
}
|
||||
|
||||
@@ -1,110 +1,162 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
|
||||
@@ -403,7 +403,7 @@
|
||||
@@ -51,6 +51,12 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GLContext;
|
||||
import org.lwjgl.util.glu.Project;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.IRenderHandler;
|
||||
+import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
+import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
|
||||
+import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
+import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EntityRenderer implements IResourceManagerReloadListener
|
||||
@@ -358,7 +364,7 @@
|
||||
|
||||
if (d3 < d2 || d2 == 0.0D)
|
||||
{
|
||||
- if (entity1 == entity.field_70154_o)
|
||||
+ if (entity1 == entity.field_70154_o && !entity.canRiderInteract())
|
||||
- if (entity == this.field_78531_r.field_71451_h.field_70154_o)
|
||||
+ if (entity == this.field_78531_r.field_71451_h.field_70154_o && !entity.canRiderInteract())
|
||||
{
|
||||
if (d2 == 0.0D)
|
||||
{
|
||||
@@ -556,14 +556,8 @@
|
||||
{
|
||||
BlockPos blockpos = new BlockPos(entity);
|
||||
IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
|
||||
- Block block = iblockstate.func_177230_c();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity);
|
||||
@@ -392,8 +398,15 @@
|
||||
|
||||
private void func_78477_e()
|
||||
{
|
||||
- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h;
|
||||
- this.field_78501_T = entityplayersp.func_71151_f();
|
||||
+ if (field_78531_r.field_71451_h instanceof EntityPlayerSP)
|
||||
+ {
|
||||
+ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h;
|
||||
+ this.field_78501_T = entityplayersp.func_71151_f();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this.field_78501_T = field_78531_r.field_71439_g.func_71151_f();
|
||||
+ }
|
||||
this.field_78506_S = this.field_78507_R;
|
||||
this.field_78507_R += (this.field_78501_T - this.field_78507_R) * 0.5F;
|
||||
|
||||
@@ -416,7 +429,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.field_71451_h;
|
||||
+ EntityLivingBase entityplayer = (EntityLivingBase)this.field_78531_r.field_71451_h;
|
||||
float f1 = 70.0F;
|
||||
|
||||
if (p_78481_2_)
|
||||
@@ -497,15 +510,7 @@
|
||||
|
||||
if (!this.field_78531_r.field_71474_y.field_74325_U)
|
||||
{
|
||||
- Block block = this.field_78531_r.field_71441_e.func_147439_a(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v));
|
||||
-
|
||||
- if (block == Blocks.field_150324_C)
|
||||
- {
|
||||
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b();
|
||||
- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
|
||||
- int i = this.field_78531_r.field_71441_e.func_72805_g(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v));
|
||||
- int j = i & 3;
|
||||
- GL11.glRotatef((float)(j * 90), 0.0F, 1.0F, 0.0F);
|
||||
- }
|
||||
-
|
||||
GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
|
||||
+ ForgeHooksClient.orientBedCamera(field_78531_r, entitylivingbase);
|
||||
GL11.glRotatef(entitylivingbase.field_70126_B + (entitylivingbase.field_70177_z - entitylivingbase.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glRotatef(entitylivingbase.field_70127_C + (entitylivingbase.field_70125_A - entitylivingbase.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
@@ -1081,7 +1075,7 @@
|
||||
@@ -1052,7 +1057,9 @@
|
||||
|
||||
try
|
||||
{
|
||||
- this.field_78531_r.field_71462_r.func_73863_a(l, i1, p_78480_1_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, l, i1, p_78480_1_);
|
||||
- this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_);
|
||||
+ if (!MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Pre(this.field_78531_r.field_71462_r, k, l, p_78480_1_)))
|
||||
+ this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_);
|
||||
+ MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Post(this.field_78531_r.field_71462_r, k, l, p_78480_1_));
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -1145,7 +1139,7 @@
|
||||
|
||||
if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR)
|
||||
{
|
||||
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
|
||||
+ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1296,7 +1290,9 @@
|
||||
GlStateManager.func_179094_E();
|
||||
RenderHelper.func_74519_b();
|
||||
this.field_78531_r.field_71424_I.func_76318_c("entities");
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
|
||||
renderglobal.func_180446_a(entity, frustum, p_175068_2_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
|
||||
RenderHelper.func_74518_a();
|
||||
this.func_175072_h();
|
||||
GlStateManager.func_179128_n(5888);
|
||||
@@ -1308,6 +1304,7 @@
|
||||
entityplayer = (EntityPlayer)entity;
|
||||
GlStateManager.func_179118_c();
|
||||
this.field_78531_r.field_71424_I.func_76318_c("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
|
||||
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
|
||||
GlStateManager.func_179141_d();
|
||||
@@ -1203,7 +1210,10 @@
|
||||
GL11.glPushMatrix();
|
||||
RenderHelper.func_74519_b();
|
||||
this.field_78531_r.field_71424_I.func_76318_c("entities");
|
||||
+ ForgeHooksClient.setRenderPass(0);
|
||||
renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_);
|
||||
+ ForgeHooksClient.setRenderPass(0);
|
||||
+ // ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water}
|
||||
this.func_78463_b((double)p_78471_1_);
|
||||
this.field_78531_r.field_71424_I.func_76318_c("litParticles");
|
||||
effectrenderer.func_78872_b(entitylivingbase, p_78471_1_);
|
||||
@@ -1221,7 +1231,10 @@
|
||||
entityplayer = (EntityPlayer)entitylivingbase;
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
this.field_78531_r.field_71424_I.func_76318_c("outline");
|
||||
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_))
|
||||
+ {
|
||||
+ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
|
||||
+ }
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
}
|
||||
@@ -1234,14 +1247,17 @@
|
||||
entityplayer = (EntityPlayer)entitylivingbase;
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
this.field_78531_r.field_71424_I.func_76318_c("outline");
|
||||
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_))
|
||||
+ {
|
||||
+ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
|
||||
+ }
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
@@ -1321,6 +1318,7 @@
|
||||
entityplayer = (EntityPlayer)entity;
|
||||
GlStateManager.func_179118_c();
|
||||
this.field_78531_r.field_71424_I.func_76318_c("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
|
||||
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
|
||||
GlStateManager.func_179141_d();
|
||||
}
|
||||
@@ -1373,6 +1371,16 @@
|
||||
renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
|
||||
}
|
||||
|
||||
+ if (!this.field_175078_W) //Only render if render pass 0 happens as well.
|
||||
+ {
|
||||
+ RenderHelper.func_74519_b();
|
||||
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
|
||||
+ renderglobal.func_180446_a(entity, frustum, p_175068_2_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
|
||||
+ RenderHelper.func_74518_a();
|
||||
+ }
|
||||
this.field_78531_r.field_71424_I.func_76318_c("destroyProgress");
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.func_148821_a(770, 1, 1, 0);
|
||||
- renderglobal.func_72717_a(Tessellator.field_78398_a, (EntityPlayer)entitylivingbase, p_78471_1_);
|
||||
+ renderglobal.drawBlockDamageTexture(Tessellator.field_78398_a, entitylivingbase, p_78471_1_);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
@@ -1296,6 +1312,16 @@
|
||||
renderglobal.func_72719_a(entitylivingbase, 1, (double)p_78471_1_);
|
||||
}
|
||||
|
||||
+ if (this.field_78532_q == 0) //Only render if render pass 0 happens as well.
|
||||
+ {
|
||||
+ RenderHelper.func_74519_b();
|
||||
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
|
||||
+ ForgeHooksClient.setRenderPass(1);
|
||||
+ renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_);
|
||||
+ ForgeHooksClient.setRenderPass(-1);
|
||||
+ RenderHelper.func_74518_a();
|
||||
+ }
|
||||
+
|
||||
GlStateManager.func_179103_j(7424);
|
||||
GlStateManager.func_179132_a(true);
|
||||
GlStateManager.func_179089_o();
|
||||
@@ -1385,8 +1393,12 @@
|
||||
this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_);
|
||||
}
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@@ -1307,9 +1333,12 @@
|
||||
this.func_82829_a(renderglobal, p_78471_1_);
|
||||
}
|
||||
|
||||
+ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last");
|
||||
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_);
|
||||
+ this.field_78531_r.field_71424_I.func_76318_c("FRenderLast");
|
||||
+ ForgeHooksClient.dispatchRenderLast(renderglobal, p_78471_1_);
|
||||
+
|
||||
this.field_78531_r.field_71424_I.func_76318_c("hand");
|
||||
this.field_78531_r.field_71424_I.func_76318_c("hand");
|
||||
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_))
|
||||
if (this.field_175074_C)
|
||||
{
|
||||
GlStateManager.func_179086_m(256);
|
||||
@@ -1498,6 +1510,13 @@
|
||||
- if (this.field_78503_V == 1.0D)
|
||||
+ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, p_78471_1_, j) && this.field_78503_V == 1.0D)
|
||||
{
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
this.func_78476_b(p_78471_1_, j);
|
||||
@@ -1425,6 +1454,13 @@
|
||||
|
||||
protected void func_78474_d(float p_78474_1_)
|
||||
{
|
||||
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer();
|
||||
+ if (renderer != null)
|
||||
+ IRenderHandler renderer = null;
|
||||
+ if ((renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer()) != null)
|
||||
+ {
|
||||
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
|
||||
+ return;
|
||||
@@ -113,36 +165,31 @@
|
||||
float f1 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
|
||||
|
||||
if (f1 > 0.0F)
|
||||
@@ -1835,6 +1854,13 @@
|
||||
this.field_175081_S = f8;
|
||||
@@ -1774,6 +1810,13 @@
|
||||
this.field_78533_p = f7;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entitylivingbase, block, p_78466_1_, this.field_78518_n, this.field_78519_o, this.field_78533_p);
|
||||
+ MinecraftForge.EVENT_BUS.post(event);
|
||||
+
|
||||
+ this.field_78518_n = event.red;
|
||||
+ this.field_78533_p = event.blue;
|
||||
+ this.field_78519_o = event.green;
|
||||
+
|
||||
+ this.field_175080_Q = event.red;
|
||||
+ this.field_175082_R = event.green;
|
||||
+ this.field_175081_S = event.blue;
|
||||
+
|
||||
GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
|
||||
GL11.glClearColor(this.field_78518_n, this.field_78519_o, this.field_78533_p, 0.0F);
|
||||
}
|
||||
|
||||
@@ -1854,6 +1880,10 @@
|
||||
Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
|
||||
float f1;
|
||||
@@ -1809,6 +1852,13 @@
|
||||
Block block = ActiveRenderInfo.func_151460_a(this.field_78531_r.field_71441_e, entitylivingbase, p_78468_2_);
|
||||
float f1;
|
||||
|
||||
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F);
|
||||
+ if (hook >= 0)
|
||||
+ GlStateManager.func_179095_a(hook);
|
||||
+ else
|
||||
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q))
|
||||
{
|
||||
f1 = 5.0F;
|
||||
@@ -1931,6 +1961,7 @@
|
||||
GlStateManager.func_179102_b(f1 * 0.05F);
|
||||
GlStateManager.func_179153_c(Math.min(f1, 192.0F) * 0.5F);
|
||||
}
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f1);
|
||||
}
|
||||
|
||||
GlStateManager.func_179142_g();
|
||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, 0.1F, p_78468_2_);
|
||||
+
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ GL11.glFogf(GL11.GL_FOG_DENSITY, event.density);
|
||||
+ }
|
||||
+ else
|
||||
if (entitylivingbase.func_70644_a(Potion.field_76440_q))
|
||||
{
|
||||
f1 = 5.0F;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
||||
@@ -83,6 +83,8 @@
|
||||
this.func_73729_b(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18);
|
||||
}
|
||||
|
||||
+ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k);
|
||||
+ if (!potion.shouldRenderInvText(potioneffect)) continue;
|
||||
String s1 = I18n.func_135052_a(potion.func_76393_a(), new Object[0]);
|
||||
|
||||
if (potioneffect.func_76458_c() == 1)
|
||||
@@ -1,14 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
|
||||
@@ -52,6 +52,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartItemModel)
|
||||
+ {
|
||||
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartItemModel)ibakedmodel).handleItemState(p_178089_1_);
|
||||
+ }
|
||||
+
|
||||
if (ibakedmodel == null)
|
||||
{
|
||||
ibakedmodel = this.field_178090_d.func_174951_a();
|
||||
@@ -0,0 +1,122 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
||||
@@ -20,6 +20,7 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemCloth;
|
||||
+import net.minecraft.item.ItemMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -28,6 +29,13 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.IItemRenderer;
|
||||
+import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
+import net.minecraftforge.client.MinecraftForgeClient;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ItemRenderer
|
||||
{
|
||||
@@ -49,13 +57,24 @@
|
||||
|
||||
public void func_78443_a(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_)
|
||||
{
|
||||
+ this.renderItem(p_78443_1_, p_78443_2_, p_78443_3_, EQUIPPED);
|
||||
+ }
|
||||
+
|
||||
+ public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type)
|
||||
+ {
|
||||
GL11.glPushMatrix();
|
||||
TextureManager texturemanager = this.field_78455_a.func_110434_K();
|
||||
Item item = p_78443_2_.func_77973_b();
|
||||
Block block = Block.func_149634_a(item);
|
||||
|
||||
- if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type);
|
||||
+ if (customRenderer != null)
|
||||
{
|
||||
+ texturemanager.func_110577_a(texturemanager.func_130087_a(p_78443_2_.func_94608_d()));
|
||||
+ ForgeHooksClient.renderEquippedItem(type, customRenderer, field_147720_h, p_78443_1_, p_78443_2_);
|
||||
+ }
|
||||
+ else if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b()))
|
||||
+ {
|
||||
texturemanager.func_110577_a(texturemanager.func_130087_a(0));
|
||||
|
||||
if (p_78443_2_ != null && p_78443_2_.func_77973_b() instanceof ItemCloth)
|
||||
@@ -100,7 +119,7 @@
|
||||
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
|
||||
func_78439_a(tessellator, f1, f2, f, f3, iicon.func_94211_a(), iicon.func_94216_b(), 0.0625F);
|
||||
|
||||
- if (p_78443_2_.func_77962_s() && p_78443_3_ == 0)
|
||||
+ if (p_78443_2_.hasEffect(p_78443_3_))
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
@@ -273,7 +292,7 @@
|
||||
Render render;
|
||||
RenderPlayer renderplayer;
|
||||
|
||||
- if (itemstack != null && itemstack.func_77973_b() == Items.field_151098_aY)
|
||||
+ if (itemstack != null && itemstack.func_77973_b() instanceof ItemMap)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
f13 = 0.8F;
|
||||
@@ -340,12 +359,21 @@
|
||||
tessellator.func_78374_a((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D);
|
||||
tessellator.func_78374_a((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D);
|
||||
tessellator.func_78381_a();
|
||||
- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, this.field_78455_a.field_71441_e);
|
||||
|
||||
- if (mapdata != null)
|
||||
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
|
||||
+ MapData mapdata = ((ItemMap)itemstack.func_77973_b()).func_77873_a(itemstack, this.field_78455_a.field_71441_e);
|
||||
+
|
||||
+ if (custom == null)
|
||||
{
|
||||
- this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
|
||||
+ if (mapdata != null)
|
||||
+ {
|
||||
+ this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
|
||||
+ }
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, field_78455_a.field_71439_g, field_78455_a.func_110434_K(), mapdata);
|
||||
+ }
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -446,17 +474,20 @@
|
||||
|
||||
if (itemstack.func_77973_b().func_77623_v())
|
||||
{
|
||||
- this.func_78443_a(entityclientplayermp, itemstack, 0);
|
||||
- int k1 = itemstack.func_77973_b().func_82790_a(itemstack, 1);
|
||||
- f10 = (float)(k1 >> 16 & 255) / 255.0F;
|
||||
- f11 = (float)(k1 >> 8 & 255) / 255.0F;
|
||||
- f12 = (float)(k1 & 255) / 255.0F;
|
||||
- GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F);
|
||||
- this.func_78443_a(entityclientplayermp, itemstack, 1);
|
||||
+ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON);
|
||||
+ for (int x = 1; x < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); x++)
|
||||
+ {
|
||||
+ int k1 = itemstack.func_77973_b().func_82790_a(itemstack, 1);
|
||||
+ f10 = (float)(k1 >> 16 & 255) / 255.0F;
|
||||
+ f11 = (float)(k1 >> 8 & 255) / 255.0F;
|
||||
+ f12 = (float)(k1 & 255) / 255.0F;
|
||||
+ GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F);
|
||||
+ this.renderItem(entityclientplayermp, itemstack, x, EQUIPPED_FIRST_PERSON);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
- this.func_78443_a(entityclientplayermp, itemstack, 0);
|
||||
+ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
|
||||
@@ -78,6 +78,10 @@
|
||||
public static int field_148826_e;
|
||||
@@ -24,6 +24,10 @@
|
||||
public static boolean field_148824_g;
|
||||
private static final String __OBFID = "CL_00001179";
|
||||
|
||||
+ /* Stores the last values sent into setLightmapTextureCoords */
|
||||
@@ -10,8 +10,8 @@
|
||||
+
|
||||
public static void func_77474_a()
|
||||
{
|
||||
ContextCapabilities contextcapabilities = GLContext.getCapabilities();
|
||||
@@ -813,6 +817,12 @@
|
||||
field_77477_c = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13;
|
||||
@@ -82,6 +86,12 @@
|
||||
{
|
||||
GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java
|
||||
@@ -52,6 +52,8 @@
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
+import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBlocks
|
||||
{
|
||||
@@ -336,9 +338,9 @@
|
||||
public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.field_78398_a;
|
||||
- int l = this.field_147845_a.func_72805_g(p_147773_2_, p_147773_3_, p_147773_4_);
|
||||
- int i1 = BlockBed.func_149895_l(l);
|
||||
- boolean flag = BlockBed.func_149975_b(l);
|
||||
+ Block bed = this.field_147845_a.func_147439_a(p_147773_2_, p_147773_3_, p_147773_4_);
|
||||
+ int i1 = bed.getBedDirection(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_);
|
||||
+ boolean flag = bed.isBedFoot(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_);
|
||||
float f = 0.5F;
|
||||
float f1 = 1.0F;
|
||||
float f2 = 0.8F;
|
||||
@@ -347,6 +349,7 @@
|
||||
tessellator.func_78380_c(j1);
|
||||
tessellator.func_78386_a(f, f, f);
|
||||
IIcon iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0);
|
||||
+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside
|
||||
double d0 = (double)iicon.func_94209_e();
|
||||
double d1 = (double)iicon.func_94212_f();
|
||||
double d2 = (double)iicon.func_94206_g();
|
||||
@@ -363,6 +366,7 @@
|
||||
tessellator.func_78380_c(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_));
|
||||
tessellator.func_78386_a(f1, f1, f1);
|
||||
iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1);
|
||||
+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside
|
||||
d0 = (double)iicon.func_94209_e();
|
||||
d1 = (double)iicon.func_94212_f();
|
||||
d2 = (double)iicon.func_94206_g();
|
||||
@@ -2037,7 +2041,7 @@
|
||||
double d10;
|
||||
double d11;
|
||||
|
||||
- if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_))
|
||||
+ if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP))
|
||||
{
|
||||
float f2 = 0.2F;
|
||||
float f1 = 0.0625F;
|
||||
@@ -2057,7 +2061,7 @@
|
||||
d0 = d5;
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST))
|
||||
{
|
||||
tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1);
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3);
|
||||
@@ -2069,7 +2073,7 @@
|
||||
tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1);
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST))
|
||||
{
|
||||
tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1);
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3);
|
||||
@@ -2081,7 +2085,7 @@
|
||||
tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1);
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH))
|
||||
{
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1);
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3);
|
||||
@@ -2093,7 +2097,7 @@
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1);
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH))
|
||||
{
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1);
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3);
|
||||
@@ -2105,7 +2109,7 @@
|
||||
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1);
|
||||
}
|
||||
|
||||
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_))
|
||||
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN))
|
||||
{
|
||||
d5 = (double)p_147801_2_ + 0.5D + 0.5D;
|
||||
d6 = (double)p_147801_2_ + 0.5D - 0.5D;
|
||||
@@ -3118,10 +3122,10 @@
|
||||
double d16 = (double)p_147767_2_ + 0.5D + 0.0625D;
|
||||
double d17 = (double)p_147767_4_ + 0.5D - 0.0625D;
|
||||
double d18 = (double)p_147767_4_ + 0.5D + 0.0625D;
|
||||
- boolean flag = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1));
|
||||
- boolean flag1 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1));
|
||||
- boolean flag2 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_));
|
||||
- boolean flag3 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_));
|
||||
+ boolean flag = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH);
|
||||
+ boolean flag1 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH);
|
||||
+ boolean flag2 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST );
|
||||
+ boolean flag3 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST );
|
||||
boolean flag4 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1);
|
||||
boolean flag5 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0);
|
||||
double d19 = 0.01D;
|
||||
@@ -8218,4 +8222,18 @@
|
||||
|
||||
return (IIcon)p_147758_1_;
|
||||
}
|
||||
+
|
||||
+ /*==================================== FORGE START ===========================================*/
|
||||
+ private static RenderBlocks instance;
|
||||
+ /**
|
||||
+ * Returns a single lazy loaded instance of RenderBlocks, for use in mods who
|
||||
+ * don't care about the interaction of other objects on the current state of the RenderBlocks they are using.
|
||||
+ * @return A global instance of RenderBlocks
|
||||
+ */
|
||||
+ public static RenderBlocks getInstance()
|
||||
+ {
|
||||
+ if (instance == null) instance = new RenderBlocks();
|
||||
+ return instance;
|
||||
+ }
|
||||
+ /*==================================== FORGE END =============================================*/
|
||||
}
|
||||
@@ -1,134 +1,130 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
|
||||
@@ -517,8 +517,10 @@
|
||||
@@ -79,6 +79,9 @@
|
||||
import org.lwjgl.opengl.ARBOcclusionQuery;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_)
|
||||
+import net.minecraftforge.client.IRenderHandler;
|
||||
+import net.minecraftforge.client.MinecraftForgeClient;
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderGlobal implements IWorldAccess
|
||||
{
|
||||
@@ -375,8 +378,10 @@
|
||||
|
||||
public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_)
|
||||
{
|
||||
+ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass();
|
||||
+ int pass = MinecraftForgeClient.getRenderPass();
|
||||
if (this.field_72740_G > 0)
|
||||
{
|
||||
+ if (pass > 0) return;
|
||||
--this.field_72740_G;
|
||||
}
|
||||
else
|
||||
@@ -529,9 +531,12 @@
|
||||
@@ -387,9 +392,12 @@
|
||||
this.field_72769_h.field_72984_F.func_76320_a("prepare");
|
||||
TileEntityRendererDispatcher.field_147556_a.func_178470_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), p_180446_3_);
|
||||
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
|
||||
TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, p_147589_3_);
|
||||
RenderManager.field_78727_a.func_147938_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_147589_3_);
|
||||
+ if (pass == 0) // no indentation to shrink patch
|
||||
+ {
|
||||
this.field_72748_H = 0;
|
||||
this.field_72749_I = 0;
|
||||
this.field_72750_J = 0;
|
||||
+ }
|
||||
Entity entity1 = this.field_72777_q.func_175606_aa();
|
||||
double d3 = entity1.field_70142_S + (entity1.field_70165_t - entity1.field_70142_S) * (double)p_180446_3_;
|
||||
double d4 = entity1.field_70137_T + (entity1.field_70163_u - entity1.field_70137_T) * (double)p_180446_3_;
|
||||
@@ -543,13 +548,17 @@
|
||||
this.field_72777_q.field_71460_t.func_180436_i();
|
||||
EntityLivingBase entitylivingbase1 = this.field_72777_q.field_71451_h;
|
||||
double d3 = entitylivingbase1.field_70142_S + (entitylivingbase1.field_70165_t - entitylivingbase1.field_70142_S) * (double)p_147589_3_;
|
||||
double d4 = entitylivingbase1.field_70137_T + (entitylivingbase1.field_70163_u - entitylivingbase1.field_70137_T) * (double)p_147589_3_;
|
||||
@@ -418,13 +426,17 @@
|
||||
this.field_72777_q.field_71460_t.func_78463_b((double)p_147589_3_);
|
||||
this.field_72769_h.field_72984_F.func_76318_c("global");
|
||||
List list = this.field_72769_h.func_72910_y();
|
||||
+ if (pass == 0) // no indentation to shrink patch
|
||||
+ if (pass == 0) // no indentation for smaller patch size
|
||||
+ {
|
||||
this.field_72748_H = list.size();
|
||||
+ }
|
||||
int i;
|
||||
Entity entity2;
|
||||
Entity entity;
|
||||
|
||||
for (i = 0; i < this.field_72769_h.field_73007_j.size(); ++i)
|
||||
{
|
||||
entity2 = (Entity)this.field_72769_h.field_73007_j.get(i);
|
||||
+ if (!entity2.shouldRenderInPass(pass)) continue;
|
||||
entity = (Entity)this.field_72769_h.field_73007_j.get(i);
|
||||
+ if (!entity.shouldRenderInPass(pass)) continue;
|
||||
++this.field_72749_I;
|
||||
|
||||
if (entity2.func_145770_h(d0, d1, d2))
|
||||
@@ -571,6 +580,7 @@
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
{
|
||||
entity2 = (Entity)list.get(i);
|
||||
+ if (!entity2.shouldRenderInPass(pass)) continue;
|
||||
boolean flag = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn();
|
||||
boolean flag1 = entity2.func_145770_h(d0, d1, d2) && (entity2.field_70158_ak || p_180446_2_.func_78546_a(entity2.func_174813_aQ()) || entity2.field_70153_n == this.field_72777_q.field_71439_g) && entity2 instanceof EntityPlayer;
|
||||
if (entity.func_145770_h(d0, d1, d2))
|
||||
@@ -438,6 +450,7 @@
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
{
|
||||
entity = (Entity)list.get(i);
|
||||
+ if (!entity.shouldRenderInPass(pass)) continue;
|
||||
boolean flag = entity.func_145770_h(d0, d1, d2) && (entity.field_70158_ak || p_147589_2_.func_78546_a(entity.field_70121_D) || entity.field_70153_n == this.field_72777_q.field_71439_g);
|
||||
|
||||
@@ -605,6 +615,7 @@
|
||||
while (iterator2.hasNext())
|
||||
{
|
||||
Entity entity3 = (Entity)iterator2.next();
|
||||
+ if (!entity3.shouldRenderInPass(pass)) continue;
|
||||
boolean flag2 = this.field_175010_j.func_178635_a(entity3, p_180446_2_, d0, d1, d2) || entity3.field_70153_n == this.field_72777_q.field_71439_g;
|
||||
if (!flag && entity instanceof EntityLiving)
|
||||
@@ -463,7 +476,11 @@
|
||||
|
||||
if (flag2)
|
||||
@@ -640,6 +651,7 @@
|
||||
while (iterator1.hasNext())
|
||||
{
|
||||
tileentity = (TileEntity)iterator1.next();
|
||||
+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
|
||||
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
|
||||
}
|
||||
for (i = 0; i < this.field_147598_a.size(); ++i)
|
||||
{
|
||||
- TileEntityRendererDispatcher.field_147556_a.func_147544_a((TileEntity)this.field_147598_a.get(i), p_147589_3_);
|
||||
+ TileEntity tile = (TileEntity)this.field_147598_a.get(i);
|
||||
+ if (tile.shouldRenderInPass(pass) && p_147589_2_.func_78546_a(tile.getRenderBoundingBox()))
|
||||
+ {
|
||||
+ TileEntityRendererDispatcher.field_147556_a.func_147544_a(tile, p_147589_3_);
|
||||
+ }
|
||||
}
|
||||
@@ -671,7 +683,7 @@
|
||||
|
||||
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
|
||||
this.field_72777_q.field_71460_t.func_78483_a((double)p_147589_3_);
|
||||
@@ -933,6 +950,12 @@
|
||||
|
||||
- if (tileentity != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull))
|
||||
+ if (tileentity != null && tileentity.shouldRenderInPass(pass) && tileentity.canRenderBreaking() && p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox()))
|
||||
{
|
||||
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, destroyblockprogress.func_73106_e());
|
||||
}
|
||||
@@ -1151,6 +1163,12 @@
|
||||
|
||||
public void func_174976_a(float p_174976_1_, int p_174976_2_)
|
||||
public void func_72714_a(float p_72714_1_)
|
||||
{
|
||||
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer();
|
||||
+ if (renderer != null)
|
||||
+ IRenderHandler skyProvider = null;
|
||||
+ if ((skyProvider = this.field_72777_q.field_71441_e.field_73011_w.getSkyRenderer()) != null)
|
||||
+ {
|
||||
+ renderer.render(p_174976_1_, field_72769_h, field_72777_q);
|
||||
+ skyProvider.render(p_72714_1_, this.field_72769_h, field_72777_q);
|
||||
+ return;
|
||||
+ }
|
||||
if (this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1)
|
||||
if (this.field_72777_q.field_71441_e.field_73011_w.field_76574_g == 1)
|
||||
{
|
||||
this.func_180448_r();
|
||||
@@ -1381,6 +1399,12 @@
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
@@ -1171,6 +1194,12 @@
|
||||
|
||||
public void func_180447_b(float p_180447_1_, int p_180447_2_)
|
||||
public void func_72718_b(float p_72718_1_)
|
||||
{
|
||||
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72777_q.field_71441_e.field_73011_w.getCloudRenderer();
|
||||
+ if (renderer != null)
|
||||
+ IRenderHandler renderer = null;
|
||||
+ if ((renderer = field_72769_h.field_73011_w.getCloudRenderer()) != null)
|
||||
+ {
|
||||
+ renderer.render(p_180447_1_, this.field_72777_q.field_71441_e, field_72777_q);
|
||||
+ renderer.render(p_72718_1_, field_72769_h, field_72777_q);
|
||||
+ return;
|
||||
+ }
|
||||
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d())
|
||||
{
|
||||
if (this.field_72777_q.field_71474_y.field_74347_j)
|
||||
@@ -1805,8 +1829,11 @@
|
||||
double d4 = (double)blockpos.func_177956_o() - d1;
|
||||
double d5 = (double)blockpos.func_177952_p() - d2;
|
||||
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
|
||||
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
|
||||
+ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
|
||||
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
|
||||
@@ -1571,6 +1600,11 @@
|
||||
|
||||
- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull))
|
||||
+ if (!hasBreak)
|
||||
{
|
||||
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
|
||||
{
|
||||
@@ -1949,13 +1976,16 @@
|
||||
if (p_174961_1_ != null)
|
||||
public void func_72717_a(Tessellator p_72717_1_, EntityPlayer p_72717_2_, float p_72717_3_)
|
||||
{
|
||||
+ drawBlockDamageTexture(p_72717_1_, (EntityLivingBase)p_72717_2_, p_72717_3_);
|
||||
+ }
|
||||
+
|
||||
+ public void drawBlockDamageTexture(Tessellator p_72717_1_, EntityLivingBase p_72717_2_, float p_72717_3_)
|
||||
+ {
|
||||
double d0 = p_72717_2_.field_70142_S + (p_72717_2_.field_70165_t - p_72717_2_.field_70142_S) * (double)p_72717_3_;
|
||||
double d1 = p_72717_2_.field_70137_T + (p_72717_2_.field_70163_u - p_72717_2_.field_70137_T) * (double)p_72717_3_;
|
||||
double d2 = p_72717_2_.field_70136_U + (p_72717_2_.field_70161_v - p_72717_2_.field_70136_U) * (double)p_72717_3_;
|
||||
@@ -1789,12 +1823,15 @@
|
||||
{
|
||||
ItemRecord itemrecord = ItemRecord.func_150926_b(p_174961_1_);
|
||||
+ ResourceLocation resource = null;
|
||||
ItemRecord itemrecord = ItemRecord.func_150926_b(p_72702_1_);
|
||||
|
||||
+ ResourceLocation resource = null;
|
||||
if (itemrecord != null)
|
||||
{
|
||||
this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i());
|
||||
+ resource = itemrecord.getRecordResource(p_174961_1_);
|
||||
+ resource = itemrecord.getRecordResource(p_72702_1_);
|
||||
}
|
||||
|
||||
- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_174961_1_), (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p());
|
||||
+ if (resource == null) resource = new ResourceLocation(p_174961_1_);
|
||||
+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p());
|
||||
this.field_147593_P.put(p_174961_2_, positionedsoundrecord);
|
||||
- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_72702_1_), (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
|
||||
+ if (resource == null) resource = new ResourceLocation(p_72702_1_);
|
||||
+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
|
||||
this.field_147593_P.put(chunkcoordinates, positionedsoundrecord);
|
||||
this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord);
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/Tessellator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/Tessellator.java
|
||||
@@ -7,6 +7,7 @@
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
+import java.util.Arrays;
|
||||
import java.util.PriorityQueue;
|
||||
import net.minecraft.client.shader.TesselatorVertexState;
|
||||
import net.minecraft.client.util.QuadComparator;
|
||||
@@ -15,10 +16,17 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class Tessellator
|
||||
{
|
||||
- private ByteBuffer field_78394_d;
|
||||
- private IntBuffer field_147568_c;
|
||||
- private FloatBuffer field_147566_d;
|
||||
- private ShortBuffer field_147567_e;
|
||||
+ private static int nativeBufferSize = 0x200000;
|
||||
+ private static int trivertsInBuffer = (nativeBufferSize / 48) * 6;
|
||||
+ public static boolean renderingWorldRenderer = false;
|
||||
+ public boolean defaultTexture = false;
|
||||
+ private int rawBufferSize = 0;
|
||||
+ public int textureID = 0;
|
||||
+
|
||||
+ private static ByteBuffer field_78394_d = GLAllocation.func_74524_c(nativeBufferSize * 4);
|
||||
+ private static IntBuffer field_147568_c = field_78394_d.asIntBuffer();
|
||||
+ private static FloatBuffer field_147566_d = field_78394_d.asFloatBuffer();
|
||||
+ private static ShortBuffer field_147567_e = field_78394_d.asShortBuffer();
|
||||
private int[] field_78405_h;
|
||||
private int field_78406_i;
|
||||
private double field_78403_j;
|
||||
@@ -44,14 +52,17 @@
|
||||
|
||||
private Tessellator(int p_i1250_1_)
|
||||
{
|
||||
- this.field_78388_E = p_i1250_1_;
|
||||
- this.field_78394_d = GLAllocation.func_74524_c(p_i1250_1_ * 4);
|
||||
- this.field_147568_c = this.field_78394_d.asIntBuffer();
|
||||
- this.field_147566_d = this.field_78394_d.asFloatBuffer();
|
||||
- this.field_147567_e = this.field_78394_d.asShortBuffer();
|
||||
- this.field_78405_h = new int[p_i1250_1_];
|
||||
}
|
||||
|
||||
+ public Tessellator()
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ static
|
||||
+ {
|
||||
+ field_78398_a.defaultTexture = true;
|
||||
+ }
|
||||
+
|
||||
public int func_78381_a()
|
||||
{
|
||||
if (!this.field_78415_z)
|
||||
@@ -62,12 +73,15 @@
|
||||
{
|
||||
this.field_78415_z = false;
|
||||
|
||||
- if (this.field_78406_i > 0)
|
||||
+ int offs = 0;
|
||||
+ while (offs < field_78406_i)
|
||||
{
|
||||
+ int vtc = Math.min(field_78406_i - offs, nativeBufferSize >> 5);
|
||||
this.field_147568_c.clear();
|
||||
- this.field_147568_c.put(this.field_78405_h, 0, this.field_147569_p);
|
||||
+ this.field_147568_c.put(this.field_78405_h, offs * 8, vtc * 8);
|
||||
this.field_78394_d.position(0);
|
||||
- this.field_78394_d.limit(this.field_147569_p * 4);
|
||||
+ this.field_78394_d.limit(vtc * 32);
|
||||
+ offs += vtc;
|
||||
|
||||
if (this.field_78400_o)
|
||||
{
|
||||
@@ -102,7 +116,7 @@
|
||||
this.field_147566_d.position(0);
|
||||
GL11.glVertexPointer(3, 32, this.field_147566_d);
|
||||
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
- GL11.glDrawArrays(this.field_78409_u, 0, this.field_78406_i);
|
||||
+ GL11.glDrawArrays(this.field_78409_u, 0, vtc);
|
||||
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
|
||||
if (this.field_78400_o)
|
||||
@@ -128,6 +142,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (rawBufferSize > 0x20000 && field_147569_p < (rawBufferSize << 3))
|
||||
+ {
|
||||
+ rawBufferSize = 0x10000;
|
||||
+ field_78405_h = new int[rawBufferSize];
|
||||
+ }
|
||||
+
|
||||
int i = this.field_147569_p * 4;
|
||||
this.func_78379_d();
|
||||
return i;
|
||||
@@ -162,6 +182,14 @@
|
||||
|
||||
public void func_147565_a(TesselatorVertexState p_147565_1_)
|
||||
{
|
||||
+ while (p_147565_1_.func_147572_a().length > rawBufferSize && rawBufferSize > 0)
|
||||
+ {
|
||||
+ rawBufferSize <<= 1;
|
||||
+ }
|
||||
+ if (rawBufferSize > field_78405_h.length)
|
||||
+ {
|
||||
+ field_78405_h = new int[rawBufferSize];
|
||||
+ }
|
||||
System.arraycopy(p_147565_1_.func_147572_a(), 0, this.field_78405_h, 0, p_147565_1_.func_147572_a().length);
|
||||
this.field_147569_p = p_147565_1_.func_147576_b();
|
||||
this.field_78406_i = p_147565_1_.func_147575_c();
|
||||
@@ -296,6 +324,19 @@
|
||||
|
||||
public void func_78377_a(double p_78377_1_, double p_78377_3_, double p_78377_5_)
|
||||
{
|
||||
+ if (field_147569_p >= rawBufferSize - 32)
|
||||
+ {
|
||||
+ if (rawBufferSize == 0)
|
||||
+ {
|
||||
+ rawBufferSize = 0x10000;
|
||||
+ field_78405_h = new int[rawBufferSize];
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ rawBufferSize *= 2;
|
||||
+ field_78405_h = Arrays.copyOf(field_78405_h, rawBufferSize);
|
||||
+ }
|
||||
+ }
|
||||
++this.field_78411_s;
|
||||
|
||||
if (this.field_78400_o)
|
||||
@@ -324,12 +365,6 @@
|
||||
this.field_78405_h[this.field_147569_p + 2] = Float.floatToRawIntBits((float)(p_78377_5_ + this.field_78417_x));
|
||||
this.field_147569_p += 8;
|
||||
++this.field_78406_i;
|
||||
-
|
||||
- if (this.field_78406_i % 4 == 0 && this.field_147569_p >= this.field_78388_E - 32)
|
||||
- {
|
||||
- this.func_78381_a();
|
||||
- this.field_78415_z = true;
|
||||
- }
|
||||
}
|
||||
|
||||
public void func_78378_d(int p_78378_1_)
|
||||
@@ -0,0 +1,85 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
||||
@@ -28,7 +28,7 @@
|
||||
private TesselatorVertexState field_147894_y;
|
||||
public World field_78924_a;
|
||||
private int field_78942_y = -1;
|
||||
- private static Tessellator field_78941_z = Tessellator.field_78398_a;
|
||||
+ //private static Tessellator tessellator = Tessellator.instance;
|
||||
public static int field_78922_b;
|
||||
public int field_78923_c;
|
||||
public int field_78920_d;
|
||||
@@ -132,6 +132,7 @@
|
||||
{
|
||||
++field_78922_b;
|
||||
RenderBlocks renderblocks = new RenderBlocks(chunkcache);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(renderblocks);
|
||||
this.field_78917_C = 0;
|
||||
this.field_147894_y = null;
|
||||
|
||||
@@ -157,7 +158,7 @@
|
||||
this.func_147890_b(k2);
|
||||
}
|
||||
|
||||
- if (k2 == 0 && block.func_149716_u())
|
||||
+ if (k2 == 0 && block.hasTileEntity(chunkcache.func_72805_g(j3, l2, i3)))
|
||||
{
|
||||
TileEntity tileentity = chunkcache.func_147438_o(j3, l2, i3);
|
||||
|
||||
@@ -173,7 +174,9 @@
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- else if (k3 == k2)
|
||||
+
|
||||
+ if (!block.canRenderInPass(k2)) continue;
|
||||
+
|
||||
{
|
||||
flag1 |= renderblocks.func_147805_b(block, j3, l2, i3);
|
||||
|
||||
@@ -210,6 +213,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(null);
|
||||
}
|
||||
|
||||
HashSet hashset1 = new HashSet();
|
||||
@@ -232,21 +236,23 @@
|
||||
GL11.glTranslatef(-8.0F, -8.0F, -8.0F);
|
||||
GL11.glScalef(f, f, f);
|
||||
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
|
||||
- field_78941_z.func_78382_b();
|
||||
- field_78941_z.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e));
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onPreRenderWorld(this, p_147890_1_);
|
||||
+ Tessellator.field_78398_a.func_78382_b();
|
||||
+ Tessellator.field_78398_a.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e));
|
||||
}
|
||||
|
||||
private void func_147891_a(int p_147891_1_, EntityLivingBase p_147891_2_)
|
||||
{
|
||||
if (p_147891_1_ == 1 && !this.field_78928_m[p_147891_1_])
|
||||
{
|
||||
- this.field_147894_y = field_78941_z.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v);
|
||||
+ this.field_147894_y = Tessellator.field_78398_a.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v);
|
||||
}
|
||||
|
||||
- this.field_78917_C += field_78941_z.func_78381_a();
|
||||
+ this.field_78917_C += Tessellator.field_78398_a.func_78381_a();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onPostRenderWorld(this, p_147891_1_);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEndList();
|
||||
- field_78941_z.func_78373_b(0.0D, 0.0D, 0.0D);
|
||||
+ Tessellator.field_78398_a.func_78373_b(0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
public void func_147889_b(EntityLivingBase p_147889_1_)
|
||||
@@ -254,7 +260,7 @@
|
||||
if (this.field_147894_y != null && !this.field_78928_m[1])
|
||||
{
|
||||
this.func_147890_b(1);
|
||||
- field_78941_z.func_147565_a(this.field_147894_y);
|
||||
+ Tessellator.field_78398_a.func_147565_a(this.field_147894_y);
|
||||
this.func_147891_a(1, p_147889_1_);
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
|
||||
@@ -29,35 +29,9 @@
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
+ // moved to VertexFormatElement.preDraw
|
||||
vertexformatelement = (VertexFormatElement)iterator.next();
|
||||
- enumusage = vertexformatelement.func_177375_c();
|
||||
- k = vertexformatelement.func_177367_b().func_177397_c();
|
||||
- int l = vertexformatelement.func_177369_e();
|
||||
-
|
||||
- switch (WorldVertexBufferUploader.SwitchEnumUsage.field_178958_a[enumusage.ordinal()])
|
||||
- {
|
||||
- case 1:
|
||||
- bytebuffer.position(vertexformatelement.func_177373_a());
|
||||
- GL11.glVertexPointer(vertexformatelement.func_177370_d(), k, j, bytebuffer);
|
||||
- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
- break;
|
||||
- case 2:
|
||||
- bytebuffer.position(vertexformatelement.func_177373_a());
|
||||
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l);
|
||||
- GL11.glTexCoordPointer(vertexformatelement.func_177370_d(), k, j, bytebuffer);
|
||||
- GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
||||
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
|
||||
- break;
|
||||
- case 3:
|
||||
- bytebuffer.position(vertexformatelement.func_177373_a());
|
||||
- GL11.glColorPointer(vertexformatelement.func_177370_d(), k, j, bytebuffer);
|
||||
- GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
|
||||
- break;
|
||||
- case 4:
|
||||
- bytebuffer.position(vertexformatelement.func_177373_a());
|
||||
- GL11.glNormalPointer(k, j, bytebuffer);
|
||||
- GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
|
||||
- }
|
||||
+ vertexformatelement.func_177375_c().preDraw(vertexformatelement, j, bytebuffer);
|
||||
}
|
||||
|
||||
GL11.glDrawArrays(p_178177_1_.func_178979_i(), 0, p_178177_1_.func_178989_h());
|
||||
@@ -65,27 +39,9 @@
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
+ // moved to VertexFormatElement.postDraw
|
||||
vertexformatelement = (VertexFormatElement)iterator.next();
|
||||
- enumusage = vertexformatelement.func_177375_c();
|
||||
- k = vertexformatelement.func_177369_e();
|
||||
-
|
||||
- switch (WorldVertexBufferUploader.SwitchEnumUsage.field_178958_a[enumusage.ordinal()])
|
||||
- {
|
||||
- case 1:
|
||||
- GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
- break;
|
||||
- case 2:
|
||||
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k);
|
||||
- GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
||||
- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
|
||||
- break;
|
||||
- case 3:
|
||||
- GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
|
||||
- GlStateManager.func_179117_G();
|
||||
- break;
|
||||
- case 4:
|
||||
- GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
|
||||
- }
|
||||
+ vertexformatelement.func_177375_c().postDraw(vertexformatelement, j, bytebuffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java
|
||||
@@ -22,7 +22,12 @@
|
||||
|
||||
public BakedQuad func_178414_a(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, ModelRotation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_)
|
||||
{
|
||||
- int[] aint = this.func_178405_a(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
|
||||
+ return makeBakedQuad(p_178414_1_, p_178414_2_, p_178414_3_, p_178414_4_, p_178414_5_, (net.minecraftforge.client.model.ITransformation)p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
|
||||
+ }
|
||||
+
|
||||
+ public BakedQuad makeBakedQuad(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, net.minecraftforge.client.model.ITransformation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_)
|
||||
+ {
|
||||
+ int[] aint = this.makeQuadVertexData(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_);
|
||||
EnumFacing enumfacing1 = func_178410_a(aint);
|
||||
|
||||
if (p_178414_8_)
|
||||
@@ -40,11 +45,16 @@
|
||||
|
||||
private int[] func_178405_a(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, ModelRotation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_)
|
||||
{
|
||||
+ return makeQuadVertexData(p_178405_1_, p_178405_2_, p_178405_3_, p_178405_4_, (net.minecraftforge.client.model.ITransformation)p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_);
|
||||
+ }
|
||||
+
|
||||
+ private int[] makeQuadVertexData(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_)
|
||||
+ {
|
||||
int[] aint = new int[28];
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
- this.func_178402_a(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_);
|
||||
+ this.fillVertexData(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_);
|
||||
}
|
||||
|
||||
return aint;
|
||||
@@ -90,12 +100,17 @@
|
||||
|
||||
private void func_178402_a(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, ModelRotation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_)
|
||||
{
|
||||
- EnumFacing enumfacing1 = p_178402_7_.func_177523_a(p_178402_3_);
|
||||
+ fillVertexData(p_178402_1_, p_178402_2_, p_178402_3_, p_178402_4_, p_178402_5_, p_178402_6_, (net.minecraftforge.client.model.ITransformation)p_178402_7_, p_178402_8_, p_178402_9_, p_178402_10_);
|
||||
+ }
|
||||
+
|
||||
+ private void fillVertexData(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, net.minecraftforge.client.model.ITransformation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_)
|
||||
+ {
|
||||
+ EnumFacing enumfacing1 = p_178402_7_.rotate(p_178402_3_);
|
||||
int j = p_178402_10_ ? this.func_178413_a(enumfacing1) : -1;
|
||||
EnumFaceDirection.VertexInformation vertexinformation = EnumFaceDirection.func_179027_a(p_178402_3_).func_179025_a(p_178402_2_);
|
||||
Vector3d vector3d = new Vector3d((double)p_178402_5_[vertexinformation.field_179184_a], (double)p_178402_5_[vertexinformation.field_179182_b], (double)p_178402_5_[vertexinformation.field_179183_c]);
|
||||
this.func_178407_a(vector3d, p_178402_8_);
|
||||
- int k = this.func_178415_a(vector3d, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_);
|
||||
+ int k = this.rotateVertex(vector3d, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_);
|
||||
this.func_178404_a(p_178402_1_, k, p_178402_2_, vector3d, j, p_178402_6_, p_178402_4_.field_178243_e);
|
||||
}
|
||||
|
||||
@@ -156,14 +171,19 @@
|
||||
|
||||
public int func_178415_a(Vector3d p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, ModelRotation p_178415_4_, boolean p_178415_5_)
|
||||
{
|
||||
+ return rotateVertex(p_178415_1_, p_178415_2_, p_178415_3_, (net.minecraftforge.client.model.ITransformation)p_178415_4_, p_178415_5_);
|
||||
+ }
|
||||
+
|
||||
+ public int rotateVertex(Vector3d p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, net.minecraftforge.client.model.ITransformation p_178415_4_, boolean p_178415_5_)
|
||||
+ {
|
||||
if (p_178415_4_ == ModelRotation.X0_Y0)
|
||||
{
|
||||
return p_178415_3_;
|
||||
}
|
||||
else
|
||||
{
|
||||
- this.func_178406_a(p_178415_1_, new Vector3d(0.5D, 0.5D, 0.5D), p_178415_4_.func_177525_a(), new Vector3d(1.0D, 1.0D, 1.0D));
|
||||
- return p_178415_4_.func_177520_a(p_178415_2_, p_178415_3_);
|
||||
+ this.func_178406_a(p_178415_1_, new Vector3d(0.5D, 0.5D, 0.5D), new Matrix4d(p_178415_4_.getMatrix()), new Vector3d(1.0D, 1.0D, 1.0D));
|
||||
+ return p_178415_4_.rotate(p_178415_2_, p_178415_3_);
|
||||
}
|
||||
}
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java
|
||||
@@ -8,7 +8,11 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
+/*
|
||||
+ * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead
|
||||
+ */
|
||||
@SideOnly(Side.CLIENT)
|
||||
+@Deprecated
|
||||
public class ItemCameraTransforms
|
||||
{
|
||||
public static final ItemCameraTransforms field_178357_a = new ItemCameraTransforms(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a);
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java
|
||||
@@ -13,9 +13,14 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
+/*
|
||||
+ * @deprecated use {@link net.minecraftforge.client.model.IModelState} and {@link net.minecraftforge.client.model.TRSRTransformation}
|
||||
+ */
|
||||
@SideOnly(Side.CLIENT)
|
||||
-public class ItemTransformVec3f
|
||||
+@Deprecated
|
||||
+public class ItemTransformVec3f implements net.minecraftforge.client.model.IModelState
|
||||
{
|
||||
+ public net.minecraftforge.client.model.TRSRTransformation apply(net.minecraftforge.client.model.IModelPart part) { return new net.minecraftforge.client.model.TRSRTransformation(this); }
|
||||
public static final ItemTransformVec3f field_178366_a = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F));
|
||||
public final Vector3f field_178364_b;
|
||||
public final Vector3f field_178365_c;
|
||||
@@ -1,30 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
|
||||
@@ -150,7 +150,7 @@
|
||||
visgraph.func_178606_a(mutableblockpos);
|
||||
}
|
||||
|
||||
- if (block.func_149716_u())
|
||||
+ if (block.hasTileEntity(iblockstate))
|
||||
{
|
||||
TileEntity tileentity = regionrendercache.func_175625_s(new BlockPos(mutableblockpos));
|
||||
|
||||
@@ -160,7 +160,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- EnumWorldBlockLayer enumworldblocklayer1 = block.func_180664_k();
|
||||
+ for(EnumWorldBlockLayer enumworldblocklayer1 : EnumWorldBlockLayer.values()) {
|
||||
+ if(!block.canRenderInLayer(enumworldblocklayer1)) continue;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1);
|
||||
int i = enumworldblocklayer1.ordinal();
|
||||
|
||||
if (block.func_149645_b() != -1)
|
||||
@@ -178,6 +180,7 @@
|
||||
compiledchunk.func_178486_a(enumworldblocklayer1);
|
||||
}
|
||||
}
|
||||
+ }
|
||||
}
|
||||
|
||||
EnumWorldBlockLayer[] aenumworldblocklayer = EnumWorldBlockLayer.values();
|
||||
@@ -0,0 +1,138 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
|
||||
@@ -15,9 +15,15 @@
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
+import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
|
||||
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
|
||||
+import net.minecraftforge.client.ForgeHooksClient;
|
||||
+import net.minecraftforge.client.IItemRenderer;
|
||||
+import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBiped extends RenderLiving
|
||||
@@ -49,11 +55,13 @@
|
||||
this.field_82425_h = new ModelBiped(0.5F);
|
||||
}
|
||||
|
||||
+ @Deprecated //Use the more sensitive version getArmorResource below
|
||||
public static ResourceLocation func_110857_a(ItemArmor p_110857_0_, int p_110857_1_)
|
||||
{
|
||||
return func_110858_a(p_110857_0_, p_110857_1_, (String)null);
|
||||
}
|
||||
|
||||
+ @Deprecated //Use the more sensitive version getArmorResource below
|
||||
public static ResourceLocation func_110858_a(ItemArmor p_110858_0_, int p_110858_1_, String p_110858_2_)
|
||||
{
|
||||
String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {field_82424_k[p_110858_0_.field_77880_c], Integer.valueOf(p_110858_1_ == 2 ? 2 : 1), p_110858_2_ == null ? "" : String.format("_%s", new Object[]{p_110858_2_})});
|
||||
@@ -79,7 +87,7 @@
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.func_110776_a(func_110857_a(itemarmor, p_130006_2_));
|
||||
+ this.func_110776_a(getArmorResource(p_130006_1_, itemstack, p_130006_2_, null));
|
||||
ModelBiped modelbiped = p_130006_2_ == 2 ? this.field_82425_h : this.field_82423_g;
|
||||
modelbiped.field_78116_c.field_78806_j = p_130006_2_ == 0;
|
||||
modelbiped.field_78114_d.field_78806_j = p_130006_2_ == 0;
|
||||
@@ -88,14 +96,16 @@
|
||||
modelbiped.field_78113_g.field_78806_j = p_130006_2_ == 1;
|
||||
modelbiped.field_78123_h.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3;
|
||||
modelbiped.field_78124_i.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3;
|
||||
+ modelbiped = ForgeHooksClient.getArmorModel(p_130006_1_, itemstack, p_130006_2_, modelbiped);
|
||||
this.func_77042_a(modelbiped);
|
||||
modelbiped.field_78095_p = this.field_77045_g.field_78095_p;
|
||||
modelbiped.field_78093_q = this.field_77045_g.field_78093_q;
|
||||
modelbiped.field_78091_s = this.field_77045_g.field_78091_s;
|
||||
|
||||
- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH)
|
||||
+ //Move out of if to allow for more then just CLOTH to have color
|
||||
+ int j = itemarmor.func_82814_b(itemstack);
|
||||
+ if (j != -1)
|
||||
{
|
||||
- int j = itemarmor.func_82814_b(itemstack);
|
||||
float f1 = (float)(j >> 16 & 255) / 255.0F;
|
||||
float f2 = (float)(j >> 8 & 255) / 255.0F;
|
||||
float f3 = (float)(j & 255) / 255.0F;
|
||||
@@ -133,7 +143,7 @@
|
||||
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
- this.func_110776_a(func_110858_a((ItemArmor)item, p_82408_2_, "overlay"));
|
||||
+ this.func_110776_a(getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay"));
|
||||
float f1 = 1.0F;
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -184,9 +194,12 @@
|
||||
this.field_77071_a.field_78116_c.func_78794_c(0.0625F);
|
||||
item = itemstack1.func_77973_b();
|
||||
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
|
||||
+
|
||||
if (item instanceof ItemBlock)
|
||||
{
|
||||
- if (RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
|
||||
+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
|
||||
{
|
||||
f1 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
|
||||
@@ -229,7 +242,10 @@
|
||||
this.field_77071_a.field_78112_f.func_78794_c(0.0625F);
|
||||
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
|
||||
|
||||
- if (item instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (item instanceof ItemBlock && (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())))
|
||||
{
|
||||
f1 = 0.5F;
|
||||
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
|
||||
@@ -278,7 +294,7 @@
|
||||
|
||||
if (itemstack.func_77973_b().func_77623_v())
|
||||
{
|
||||
- for (i = 0; i <= 1; ++i)
|
||||
+ for (i = 0; i < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++i)
|
||||
{
|
||||
int j = itemstack.func_77973_b().func_82790_a(itemstack, i);
|
||||
f2 = (float)(j >> 16 & 255) / 255.0F;
|
||||
@@ -336,4 +352,33 @@
|
||||
{
|
||||
this.func_76986_a((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
}
|
||||
+
|
||||
+ /*=================================== FORGE START =========================================*/
|
||||
+ /**
|
||||
+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide.
|
||||
+ *
|
||||
+ * @param entity Entity wearing the armor
|
||||
+ * @param stack ItemStack for the armor
|
||||
+ * @param slot Slot ID that the item is in
|
||||
+ * @param type Subtype, can be null or "overlay"
|
||||
+ * @return ResourceLocation pointing at the armor's texture
|
||||
+ */
|
||||
+ public static ResourceLocation getArmorResource(Entity entity, ItemStack stack, int slot, String type)
|
||||
+ {
|
||||
+ ItemArmor item = (ItemArmor)stack.func_77973_b();
|
||||
+ String s1 = String.format("textures/models/armor/%s_layer_%d%s.png",
|
||||
+ field_82424_k[item.field_77880_c], (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type));
|
||||
+
|
||||
+ s1 = ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type);
|
||||
+ ResourceLocation resourcelocation = (ResourceLocation)field_110859_k.get(s1);
|
||||
+
|
||||
+ if (resourcelocation == null)
|
||||
+ {
|
||||
+ resourcelocation = new ResourceLocation(s1);
|
||||
+ field_110859_k.put(s1, resourcelocation);
|
||||
+ }
|
||||
+
|
||||
+ return resourcelocation;
|
||||
+ }
|
||||
+ /*=================================== FORGE END ===========================================*/
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
|
||||
@@ -42,7 +42,7 @@
|
||||
boolean flag = p_177077_9_.func_177556_c();
|
||||
int i = this.func_177078_a(itemstack);
|
||||
float f1 = 0.25F;
|
||||
- float f2 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F;
|
||||
+ float f2 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0.0F;
|
||||
GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f2 + 0.25F, (float)p_177077_6_);
|
||||
float f3;
|
||||
|
||||
@@ -109,6 +109,9 @@
|
||||
IBakedModel ibakedmodel = this.field_177080_a.func_175037_a().func_178089_a(itemstack);
|
||||
int i = this.func_177077_a(p_177075_1_, p_177075_2_, p_177075_4_, p_177075_6_, p_177075_9_, ibakedmodel);
|
||||
|
||||
+ // Forge: Call to IItemRenderer, For now Its disabled.
|
||||
+ //i = net.minecraftforge.client.ForgeHooksClient.renderEntityItem(p_177075_1_, itemstack, this.field_177079_e, this.renderManager.renderEngine, i);
|
||||
+
|
||||
for (int j = 0; j < i; ++j)
|
||||
{
|
||||
if (ibakedmodel.func_177556_c())
|
||||
@@ -129,8 +132,19 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ GlStateManager.func_179094_E();
|
||||
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
+ if (j > 0 && shouldSpreadItems())
|
||||
+ {
|
||||
+ float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
|
||||
+ float f3 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
|
||||
+ float f4 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
|
||||
+ GlStateManager.func_179109_b(f2, f3, 0.046875F);
|
||||
+ }
|
||||
this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
|
||||
+ if (!shouldSpreadItems())
|
||||
GlStateManager.func_179109_b(0.0F, 0.0F, 0.046875F);
|
||||
+ GlStateManager.func_179121_F();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,4 +175,25 @@
|
||||
{
|
||||
this.func_177075_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
}
|
||||
+
|
||||
+ /*==================================== FORGE START ===========================================*/
|
||||
+
|
||||
+ /**
|
||||
+ * Items should spread out when rendered in 3d?
|
||||
+ * @return
|
||||
+ */
|
||||
+ public boolean shouldSpreadItems()
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Items should have a bob effect
|
||||
+ * @return
|
||||
+ */
|
||||
+ public boolean shouldBob()
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ /*==================================== FORGE END =============================================*/
|
||||
}
|
||||
Loaded 100 of 470 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user