mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Major things to note: Class renames: https://gist.github.com/LexManos/44dd211f90f498ad4015279b103dff86 Tile Entities are now packed in the ChunkData packet. Forge intends to work around this to better support large moded worlds, but for the time being modders should implement the new function carefully and only send what data they need to! Minecraft's codebase now has annotations, these are directly from Mojang and should be adheared to! Added support for package-info.java's containing @Nullable information for all MC code base.
70 lines
3.9 KiB
Diff
70 lines
3.9 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
|
@@ -15,7 +15,7 @@
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
-public class BlockBush extends Block
|
|
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
|
|
{
|
|
protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
|
|
|
|
@@ -38,7 +38,8 @@
|
|
|
|
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
|
|
{
|
|
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()));
|
|
+ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
|
|
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
|
}
|
|
|
|
protected boolean func_185514_i(IBlockState p_185514_1_)
|
|
@@ -68,6 +69,11 @@
|
|
|
|
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) //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.
|
|
+ {
|
|
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
|
|
+ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
|
|
+ }
|
|
return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
|
|
}
|
|
|
|
@@ -92,6 +98,35 @@
|
|
return false;
|
|
}
|
|
|
|
+ @Override
|
|
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
|
+ {
|
|
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
|
|
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
|
|
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
|
|
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
|
|
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
|
|
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
+ return net.minecraftforge.common.EnumPlantType.Plains;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
|
+ {
|
|
+ IBlockState state = world.func_180495_p(pos);
|
|
+ if (state.func_177230_c() != this) return func_176223_P();
|
|
+ return state;
|
|
+ }
|
|
+
|
|
@SideOnly(Side.CLIENT)
|
|
public BlockRenderLayer func_180664_k()
|
|
{
|