summaryrefslogtreecommitdiff
path: root/src/main/java/jp/plusplus/fbs/world/biome
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/jp/plusplus/fbs/world/biome')
-rw-r--r--src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.classbin0 -> 3451 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.java115
-rw-r--r--src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.classbin0 -> 466 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.java13
-rw-r--r--src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.classbin0 -> 2899 bytes
-rw-r--r--src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.java122
6 files changed, 250 insertions, 0 deletions
diff --git a/src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.class b/src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.class
new file mode 100644
index 0000000..5fc0aea
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.java b/src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.java
new file mode 100644
index 0000000..b975f60
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/world/biome/BiomeAutumn.java
@@ -0,0 +1,115 @@
+package jp.plusplus.fbs.world.biome;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import jp.plusplus.fbs.block.BlockCore;
+import jp.plusplus.fbs.entity.EntityButterfly;
+import net.minecraft.block.BlockFlower;
+import net.minecraft.entity.passive.EntityWolf;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.biome.BiomeGenForest;
+import net.minecraft.world.gen.feature.WorldGenAbstractTree;
+import net.minecraft.world.gen.feature.WorldGenBigMushroom;
+
+import java.util.Random;
+
+/**
+ * Created by plusplus_F on 2015/08/20.
+ * 「魔力の秋」バイオーム
+ */
+public class BiomeAutumn extends BiomeGenBase {
+ private int biomeType;
+ protected final WorldGenDirtyOak genOak = new WorldGenDirtyOak(false, false);
+ protected final WorldGenDirtyOak genOakBig = new WorldGenDirtyOak(false, true);
+ protected final WorldGenDirtyOak genBirch = new WorldGenDirtyBirch(false);
+
+ public BiomeAutumn(int id) {
+ super(id);
+ this.biomeType = 0;
+ this.theBiomeDecorator.treesPerChunk = 10;
+ this.theBiomeDecorator.grassPerChunk = 4;
+ setBiomeName("Magical Autumn");
+
+ //表面のブロックは落ち葉
+ this.topBlock= BlockCore.fallenLeaves;
+ this.field_150604_aj=0;
+
+ //地中は土
+ this.fillerBlock=Blocks.dirt;
+ this.field_76754_C=0;
+
+ //知らん
+ this.func_76733_a(5159473);
+ this.setTemperatureRainfall(0.7F, 0.8F);
+
+ //狼と蝶がスポーン
+ this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4));
+ //this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityButterfly.class, 8, 4, 4));
+ }
+
+ @Override
+ public WorldGenAbstractTree func_150567_a(Random p_150567_1_) {
+ int r=p_150567_1_.nextInt(100);
+
+ if(r<10) return genOakBig;
+ else if(r<10+15) return genBirch;
+ return genOak;
+ }
+
+ @Override
+ public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) {
+ int k;
+ int l;
+ int i1;
+ int j1;
+ int k1;
+
+ k = p_76728_2_.nextInt(5) - 3;
+
+ l = 0;
+
+ while (l < k) {
+ i1 = p_76728_2_.nextInt(3);
+
+ if (i1 == 0) {
+ genTallFlowers.func_150548_a(1);
+ } else if (i1 == 1) {
+ genTallFlowers.func_150548_a(4);
+ } else if (i1 == 2) {
+ genTallFlowers.func_150548_a(5);
+ }
+
+ j1 = 0;
+
+ while (true) {
+ if (j1 < 5) {
+ k1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8;
+ int i2 = p_76728_4_ + p_76728_2_.nextInt(16) + 8;
+ int l1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(k1, i2) + 32);
+
+ if (!genTallFlowers.generate(p_76728_1_, p_76728_2_, k1, l1, i2)) {
+ ++j1;
+ continue;
+ }
+ }
+
+ ++l;
+ break;
+ }
+ }
+
+ super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_);
+ }
+
+ /**
+ * Provides the basic grass color based on the biome temperature and rainfall
+ */
+ @SideOnly(Side.CLIENT)
+ public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) {
+ int l = super.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_3_);
+ return (l & 0x00f000)+0xff0f00;
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.class b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.class
new file mode 100644
index 0000000..070c08f
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.java b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.java
new file mode 100644
index 0000000..93a3e60
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.java
@@ -0,0 +1,13 @@
+package jp.plusplus.fbs.world.biome;
+
+/**
+ * Created by plusplus_F on 2015/08/20.
+ * 紅葉した白樺
+ */
+public class WorldGenDirtyBirch extends WorldGenDirtyOak {
+ public WorldGenDirtyBirch(boolean notify) {
+ super(notify, false);
+ woodMeta=2;
+ leaveMeta=1;
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.class b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.class
new file mode 100644
index 0000000..6b88474
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.class
Binary files differ
diff --git a/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.java b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.java
new file mode 100644
index 0000000..3559b62
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyOak.java
@@ -0,0 +1,122 @@
+package jp.plusplus.fbs.world.biome;
+
+import jp.plusplus.fbs.block.BlockCore;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockSapling;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.gen.feature.WorldGenAbstractTree;
+import net.minecraft.world.gen.feature.WorldGenTrees;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.Random;
+
+/**
+ * Created by plusplus_F on 2015/08/20.
+ * 「魔力の秋」に生成される紅葉した樫の木
+ */
+public class WorldGenDirtyOak extends WorldGenAbstractTree {
+ private boolean bigger;
+ protected Block wood;
+ protected int woodMeta;
+ protected Block leave;
+ protected int leaveMeta=2;
+
+ public WorldGenDirtyOak(boolean notify, boolean isBig) {
+ super(notify);
+ this.bigger = isBig;
+ wood= Blocks.log;
+ woodMeta=0;
+ leave=BlockCore.leaves;
+ leaveMeta=0;
+ }
+
+ public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) {
+ int l = p_76484_2_.nextInt(3) + 5;
+
+ if (this.bigger) {
+ l += p_76484_2_.nextInt(7);
+ }
+
+ boolean flag = true;
+
+ if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) {
+ int j1;
+ int k1;
+
+ for (int i1 = p_76484_4_; i1 <= p_76484_4_ + 1 + l; ++i1) {
+ byte b0 = 1;
+
+ if (i1 == p_76484_4_) {
+ b0 = 0;
+ }
+
+ if (i1 >= p_76484_4_ + 1 + l - 2) {
+ b0 = 2;
+ }
+
+ for (j1 = p_76484_3_ - b0; j1 <= p_76484_3_ + b0 && flag; ++j1) {
+ for (k1 = p_76484_5_ - b0; k1 <= p_76484_5_ + b0 && flag; ++k1) {
+ if (i1 >= 0 && i1 < 256) {
+ Block block = p_76484_1_.getBlock(j1, i1, k1);
+
+ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) {
+ flag = false;
+ }
+ } else {
+ flag = false;
+ }
+ }
+ }
+ }
+
+ if (!flag) {
+ return false;
+ } else {
+ Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_);
+
+ //boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
+ boolean isSoil=(block2==BlockCore.fallenLeaves);
+ if (isSoil && p_76484_4_ < 256 - l - 1) {
+ block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_);
+ int k2;
+
+ for (k2 = p_76484_4_ - 3 + l; k2 <= p_76484_4_ + l; ++k2) {
+ j1 = k2 - (p_76484_4_ + l);
+ k1 = 1 - j1 / 2;
+
+ for (int l2 = p_76484_3_ - k1; l2 <= p_76484_3_ + k1; ++l2) {
+ int l1 = l2 - p_76484_3_;
+
+ for (int i2 = p_76484_5_ - k1; i2 <= p_76484_5_ + k1; ++i2) {
+ int j2 = i2 - p_76484_5_;
+
+ if (Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) {
+ Block block1 = p_76484_1_.getBlock(l2, k2, i2);
+
+ if (block1.isAir(p_76484_1_, l2, k2, i2) || block1.isLeaves(p_76484_1_, l2, k2, i2)) {
+ this.setBlockAndNotifyAdequately(p_76484_1_, l2, k2, i2, leave, leaveMeta);
+ }
+ }
+ }
+ }
+ }
+
+ for (k2 = 0; k2 < l; ++k2) {
+ Block block3 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + k2, p_76484_5_);
+
+ if (block3.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block3.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) {
+ this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, wood, woodMeta);
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+}