3
0
KCauldronX/patches/net/minecraft/block/BlockSapling.java.patch

110 lines
4.9 KiB
Diff
Raw Permalink Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
2017-07-04 06:29:35 +00:00
@@ -1,9 +1,13 @@
package net.minecraft.block;
2015-03-22 17:38:04 +00:00
2017-07-04 06:29:35 +00:00
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
+
2015-03-22 17:38:04 +00:00
+import org.bukkit.TreeType;
+
2017-07-04 06:29:35 +00:00
+import cc.capture.type.CaptureTree;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
@@ -26,6 +30,7 @@
2015-03-22 17:38:04 +00:00
{
public static final String[] field_149882_a = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "roofed_oak"};
private static final IIcon[] field_149881_b = new IIcon[field_149882_a.length];
+ public static TreeType treeType; // CraftBukkit
private static final String __OBFID = "CL_00000305";
protected BlockSapling()
2017-07-04 06:29:35 +00:00
@@ -41,9 +46,13 @@
2015-03-22 17:38:04 +00:00
{
super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_);
- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9 && p_149674_5_.nextInt(7) == 0)
+ if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9 && (p_149674_5_.nextInt(Math.max(2, (int)((p_149674_1_.growthOdds / p_149674_1_.getSpigotConfig().saplingModifier * 7) + 0.5F))) == 0)) // Spigot // Cauldron
{
+ // Cauldron start
2017-07-04 06:29:35 +00:00
+ CaptureTree tCapture=p_149674_1_.mCapture.startTreeGenCapture(null,p_149674_2_,p_149674_3_,p_149674_4_);
2015-03-22 17:38:04 +00:00
this.func_149879_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_);
2017-07-04 06:29:35 +00:00
+ tCapture.endCapture();
2015-03-25 05:24:42 +00:00
+ // Cauldron end
2015-03-22 17:38:04 +00:00
}
}
}
2017-07-04 06:29:35 +00:00
@@ -73,7 +82,20 @@
2015-03-22 17:38:04 +00:00
{
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_.getBlockMetadata(p_149878_2_, p_149878_3_, p_149878_4_) & 7;
- Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
+ // CraftBukkit start
+ Object object = null;
+ if (p_149878_5_.nextInt(10) == 0)
+ {
+ treeType = TreeType.BIG_TREE; // CraftBukkit
+ object = new WorldGenBigTree(true);
+ }
+ else
+ {
+ treeType = TreeType.TREE; // CraftBukkit
+ object = new WorldGenTrees(true);
+ }
+ // CraftBukkit end
+
int i1 = 0;
int j1 = 0;
boolean flag = false;
2017-07-04 06:29:35 +00:00
@@ -84,6 +106,7 @@
2015-03-22 17:38:04 +00:00
default:
break;
case 1:
+ treeType = TreeType.REDWOOD; // CraftBukkit
label78:
for (i1 = 0; i1 >= -1; --i1)
2017-07-04 06:29:35 +00:00
@@ -108,6 +131,7 @@
2015-03-22 17:38:04 +00:00
break;
case 2:
+ treeType = TreeType.BIRCH; // CraftBukkit
object = new WorldGenForest(true, false);
break;
case 3:
2017-07-04 06:29:35 +00:00
@@ -119,6 +143,7 @@
2015-03-22 17:38:04 +00:00
{
if (this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, 3))
{
+ treeType = TreeType.JUNGLE; // CraftBukkit
object = new WorldGenMegaJungle(true, 10, 20, 3, 3);
flag = true;
break label93;
2017-07-04 06:29:35 +00:00
@@ -130,11 +155,13 @@
2015-03-22 17:38:04 +00:00
{
j1 = 0;
i1 = 0;
+ treeType = TreeType.SMALL_JUNGLE; // CraftBukkit
object = new WorldGenTrees(true, 4 + p_149878_5_.nextInt(7), 3, 3, false);
}
break;
case 4:
+ treeType = TreeType.ACACIA; // CraftBukkit
object = new WorldGenSavannaTree(true);
break;
case 5:
2017-07-04 06:29:35 +00:00
@@ -147,6 +174,7 @@
2015-03-22 17:38:04 +00:00
if (this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, 5))
{
object = new WorldGenCanopyTree(true);
+ treeType = TreeType.DARK_OAK; // CraftBukkit
flag = true;
break label108;
}