aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/bop/blocks/pine
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
committerRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
commit6d1b2216464d4dad449ac6fcfec476832224a55e (patch)
tree526a0c15f7056313c80e6c0386e025e9b3f61781 /src/main/java/gtPlusPlus/xmod/bop/blocks/pine
parentb5d35f40afa606ed1b07061dad82e0521a59c186 (diff)
downloadGT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.gz
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.bz2
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.zip
Merge addon sources
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/bop/blocks/pine')
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java41
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java52
3 files changed, 114 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java
new file mode 100644
index 0000000000..93f7e59a1e
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LeavesPineTree.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.xmod.bop.blocks.pine;
+
+import java.util.Random;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.item.chemistry.AgriculturalChem;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator;
+import gtPlusPlus.xmod.bop.blocks.base.LeavesBase;
+
+public class LeavesPineTree extends LeavesBase {
+
+ public LeavesPineTree() {
+ super("Pine", "pine", new ItemStack[] {});
+ this.treeType = new String[] { "pine" };
+ this.leafType = new String[][] { { "pine" }, { "pine_opaque" } };
+ }
+
+ @Override
+ public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
+ return Item.getItemFromBlock(BOP_Block_Registrator.sapling_Pine);
+ }
+
+ @Override // Drops when Leaf is broken
+ protected void func_150124_c(World world, int x, int y, int z, int meta, int randomChance) {
+ Logger.INFO("Dropping Bonus Drops");
+ if (MathUtils.randInt(0, 10) >= 9) {
+ this.dropBlockAsItem(
+ world,
+ x,
+ y,
+ z,
+ ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, MathUtils.randInt(1, 4)));
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java
new file mode 100644
index 0000000000..98e384cd3f
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/LogPineTree.java
@@ -0,0 +1,21 @@
+package gtPlusPlus.xmod.bop.blocks.pine;
+
+import gtPlusPlus.xmod.bop.blocks.base.LogBase;
+
+public class LogPineTree extends LogBase {
+
+ public LogPineTree() {
+ super("Pine Log", "pine", new String[] { "pine" });
+ this.treeType = new String[] { "pine" };
+ }
+
+ /*
+ * @Override
+ * @SideOnly(Side.CLIENT) protected IIcon getSideIcon(int metaID){ return this.textureSide[metaID %
+ * this.textureSide.length]; }
+ * @Override
+ * @SideOnly(Side.CLIENT) protected IIcon getTopIcon(int metaID){ return this.textureTop[metaID %
+ * this.textureTop.length]; }
+ */
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java
new file mode 100644
index 0000000000..2c2bb38af6
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/pine/SaplingPineTree.java
@@ -0,0 +1,52 @@
+package gtPlusPlus.xmod.bop.blocks.pine;
+
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.gen.feature.WorldGenBigTree;
+import net.minecraft.world.gen.feature.WorldGenTrees;
+import net.minecraft.world.gen.feature.WorldGenerator;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.bop.blocks.base.SaplingBase;
+import gtPlusPlus.xmod.bop.world.features.trees.WorldGenPineTree;
+
+public class SaplingPineTree extends SaplingBase {
+
+ public SaplingPineTree() {
+ super("Pine Sapling", "pine", new String[] { "pine" });
+ }
+
+ @Override
+ public void func_149878_d(World world, int x, int y, int z, Random rand) {
+ Logger.WARNING("func_149878_d - 1");
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
+ rand.nextInt(10);
+ new WorldGenBigTree(true);
+ new WorldGenTrees(true);
+ int i1 = 0;
+ int j1 = 0;
+ boolean flag = false;
+
+ Block block = Blocks.air;
+
+ if (flag) {
+ world.setBlock(x + i1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4);
+ world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4);
+ world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4);
+ } else {
+ world.setBlock(x, y, z, block, 0, 4);
+ }
+ Object obj = new WorldGenPineTree();
+ if (obj != null) {
+ world.setBlockToAir(x, y, z);
+ if (!((WorldGenerator) obj).generate(world, CORE.RANDOM, x, y, z)) {
+ world.setBlock(x, y, z, this, 0, 2);
+ }
+ }
+ }
+}