aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-04-30 21:40:30 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-04-30 21:40:30 +1000
commit0ce12b7874ff31d6fabc6c6f7402e00f7b0f34c1 (patch)
tree04bd6b3b661e0e91e85d65fd89b79c54684b06a6 /src
parent13155dc73e27b92fb0f091e0fb133b07a35248eb (diff)
downloadGT5-Unofficial-0ce12b7874ff31d6fabc6c6f7402e00f7b0f34c1.tar.gz
GT5-Unofficial-0ce12b7874ff31d6fabc6c6f7402e00f7b0f34c1.tar.bz2
GT5-Unofficial-0ce12b7874ff31d6fabc6c6f7402e00f7b0f34c1.zip
+ Added the base work for a new dimension.
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java11
-rw-r--r--src/Java/gtPlusPlus/core/block/ModBlocks.java9
-rw-r--r--src/Java/gtPlusPlus/core/world/DimensionIDs.java7
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModBush.java156
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModPortal.java455
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/particle/EntityTreeFX.java103
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/util/Dimension_A_Teleporter.java531
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/util/Names.java10
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/util/ReadFile.java91
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/ChunkProviderForest.java489
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/Dimension.java22
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/WorldChunkManagerForest.java288
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/WorldProviderForest.java217
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/WorldTypesTutorial.java59
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeDarkForest.java35
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeIDs.java8
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeLightForest.java47
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/ModBiomes.java165
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorHelper.java105
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorMod.java73
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/gen/WorldGenEffectTree.java212
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/gen/WorldGenForestAbstractTree.java33
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/gen/WorldGenForestBigTree.java526
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/gen/WorldGenForestGrass.java51
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/gen/WorldGenForestTrees.java252
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/gen/WorldGenModMinable.java109
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/genlayer/LightForestGenLayer.java30
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/genlayer/LightForestGenLayerBiomes.java33
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/renderers/CloudRenderer.java13
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/renderers/SkyRenderer.java201
-rw-r--r--src/Java/gtPlusPlus/core/world/dimensionA/world/renderers/WeatherRenderer.java227
-rw-r--r--src/resources/assets/miscutils/textures/enviroment/moon_phases.pngbin0 -> 1736 bytes
-rw-r--r--src/resources/assets/miscutils/textures/enviroment/snow.pngbin0 -> 1177 bytes
-rw-r--r--src/resources/assets/miscutils/textures/enviroment/sun.pngbin0 -> 804 bytes
34 files changed, 4567 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index c874e679ae..62b2e6ee23 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -26,6 +26,9 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.core.world.dimensionA.world.Dimension;
+import gtPlusPlus.core.world.dimensionA.world.WorldTypesTutorial;
+import gtPlusPlus.core.world.dimensionA.world.biomes.ModBiomes;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
@@ -190,6 +193,14 @@ implements ActionListener
proxy.registerRenderThings();
proxy.registerNetworkStuff();
+
+ //Register Dimension A
+ ModBiomes.registerWithBiomeDictionary();
+ Dimension.registerWorldProvider();
+ Dimension.registerDimensions();
+ WorldTypesTutorial.addCustomWorldTypes();
+
+
}
//Post-Init
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java
index 230747d479..370690c1be 100644
--- a/src/Java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java
@@ -8,6 +8,7 @@ import gtPlusPlus.core.block.machine.*;
import gtPlusPlus.core.fluids.FluidRegistryHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.world.dimensionA.block.BlockModPortal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
@@ -42,6 +43,8 @@ public final class ModBlocks {
public static Block blockHellfire;
+ //TODO
+ public static BlockModPortal lightPortal;
public static void init() {
@@ -68,8 +71,12 @@ public final class ModBlocks {
blockOreFluorite = new BlockBaseOre("oreFluorite", "Fluorite", Material.rock, BlockTypes.ORE, Utils.rgbtoHexValue(120, 120, 30), 3);
blockMiningExplosive = new MiningExplosives();
blockHellfire = new HellFire();
-
+
+ //TODO
+ lightPortal = new BlockModPortal("dimensionPortalA");
+ GameRegistry.registerBlock(lightPortal, "dimensionPortalA");
}
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/world/DimensionIDs.java b/src/Java/gtPlusPlus/core/world/DimensionIDs.java
new file mode 100644
index 0000000000..52ed10ccef
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/world/DimensionIDs.java
@@ -0,0 +1,7 @@
+package gtPlusPlus.core.world;
+
+public class DimensionIDs {
+
+ public static final int Dimension_A = 210;
+
+}
diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModBush.java b/src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModBush.java
new file mode 100644
index 0000000000..6b467322c8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModBush.java
@@ -0,0 +1,156 @@
+package gtPlusPlus.core.world.dimensionA.block;
+
+import static net.minecraftforge.common.EnumPlantType.*;
+
+import java.util.Random;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.IPlantable;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class BlockModBush extends Block implements IPlantable {
+ protected BlockModBush(Material p_i45395_1_)
+ {
+ super(p_i45395_1_);
+ this.setTickRandomly(true);
+ float f = 0.2F;
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f);
+ this.setCreativeTab(CreativeTabs.tabDecorations);
+ GameRegistry.registerBlock(this, "modBush");
+ }
+
+ protected BlockModBush()
+ {
+ this(Material.plants);
+ }
+
+ /**
+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
+ */
+ @Override
+ public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
+ {
+ return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_);
+ }
+
+ /**
+ * is the block grass, dirt or farmland
+ */
+ protected boolean canPlaceBlockOn(Block p_149854_1_)
+ {
+ return p_149854_1_ == Blocks.grass || p_149854_1_ == Blocks.dirt;
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
+ * their own) Args: x, y, z, neighbor Block
+ */
+ @Override
+ public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
+ {
+ super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_);
+ this.checkAndDropBlock(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_);
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
+ {
+ this.checkAndDropBlock(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_);
+ }
+
+ /**
+ * checks if the block can stay, if not drop as item
+ */
+ protected void checkAndDropBlock(World p_149855_1_, int p_149855_2_, int p_149855_3_, int p_149855_4_)
+ {
+ if (!this.canBlockStay(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_))
+ {
+ this.dropBlockAsItem(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_, p_149855_1_.getBlockMetadata(p_149855_2_, p_149855_3_, p_149855_4_), 0);
+ p_149855_1_.setBlock(p_149855_2_, p_149855_3_, p_149855_4_, getBlockById(0), 0, 2);
+ }
+ }
+
+ /**
+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
+ */
+ @Override
+ public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
+ {
+ return p_149718_1_.getBlock(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);
+ }
+
+ /**
+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
+ * cleared to be reused)
+ */
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
+ {
+ return null;
+ }
+
+ /**
+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * The type of render function that is called for this block
+ */
+ @Override
+ public int getRenderType()
+ {
+ return 1;
+ }
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ {
+ if (this == Blocks.wheat) return Crop;
+ if (this == Blocks.carrots) return Crop;
+ if (this == Blocks.potatoes) return Crop;
+ if (this == Blocks.melon_stem) return Crop;
+ if (this == Blocks.pumpkin_stem) return Crop;
+ if (this == Blocks.waterlily) return Water;
+ if (this == Blocks.nether_wart) return Nether;
+ if (this == Blocks.sapling) return Plains;
+ return Plains;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return world.getBlockMetadata(x, y, z);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModPortal.java b/src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModPortal.java
new file mode 100644
index 0000000000..5fa45a5b41
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/world/dimensionA/block/BlockModPortal.java
@@ -0,0 +1,455 @@
+package gtPlusPlus.core.world.dimensionA.block;
+
+import java.util.Random;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.world.DimensionIDs;
+import gtPlusPlus.core.world.dimensionA.util.Dimension_A_Teleporter;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockBreakable;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemMonsterPlacer;
+import net.minecraft.util.*;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+public class BlockModPortal extends BlockBreakable
+{
+ public static final int[][] field_150001_a = new int[][] {new int[0], {3, 1}, {2, 0}};
+ @SuppressWarnings("unused")
+ private static final String __OBFID = "CL_00000284";
+
+ public BlockModPortal(String name)
+ {
+ super("portal", Material.portal, false);
+ this.setTickRandomly(true);
+ this.setBlockName(name);
+ this.setBlockTextureName("tutorial:" + name);
+ this.setCreativeTab(CreativeTabs.tabBlock);
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(World world, int x, int y, int z, Random random) {
+ super.updateTick(world, x, y, z, random);
+ if (world.provider.isSurfaceWorld() && world.getGameRules().getGameRuleBooleanValue("doMobSpawning") && random.nextInt(2000) < world.difficultySetting.getDifficultyId()) {
+ int l;
+ for (l = y; !World.doesBlockHaveSolidTopSurface(world, x, l, z) && l > 0; --l) {
+ ;
+ }
+ if (l > 0 && !world.getBlock(x, l + 1, z).isNormalCube()) {
+ Entity entity = ItemMonsterPlacer.spawnCreature(world, 57, x + 0.5D, l + 1.1D, z + 0.5D);
+ if (entity != null) {
+ entity.timeUntilPortal = entity.getPortalCooldown();
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
+ * cleared to be reused)
+ */
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
+ return null;
+ }
+
+ /**
+ * Updates the blocks bounds based on its current state. Args: world, x, y, z
+ */
+ @Override
+ public void setBlockBoundsBasedOnState(IBlockAccess blockaccess, int x, int y, int z) {
+ int l = func_149999_b(blockaccess.getBlockMetadata(x, y, z));
+ if (l == 0) {
+ if (blockaccess.getBlock(x - 1, y, z) != this && blockaccess.getBlock(x + 1, y, z) != this) {
+ l = 2;
+ } else {
+ l = 1;
+ }
+ if (blockaccess instanceof World && !((World)blockaccess).isRemote) {
+ ((World)blockaccess).setBlockMetadataWithNotify(x, y, z, l, 2);
+ }
+ }
+ float f = 0.125F;
+ float f1 = 0.125F;
+ if (l == 1) {
+ f = 0.5F;
+ }
+ if (l == 2) {
+ f1 = 0.5F;
+ }
+ this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
+ }
+
+ /**
+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
+ */
+ @Override
+ public boolean renderAsNormalBlock(){
+ return false;
+ }
+
+ public boolean getPortalSize(World world, int x, int y, int z) {
+ BlockModPortal.Size size = new BlockModPortal.Size(world, x, y, z, 1);
+ BlockModPortal.Size size1 = new BlockModPortal.Size(world, x, y, z, 2);
+ if (size.func_150860_b() && size.field_150864_e == 0) {
+ size.func_150859_c();
+ return true;
+ }
+ else if (size1.func_150860_b() && size1.field_150864_e == 0) {
+ size1.func_150859_c();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
+ * their own) Args: x, y, z, neighbor Block
+ */
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block){
+ int l = func_149999_b(world.getBlockMetadata(x, y, z));
+ BlockModPortal.Size size = new BlockModPortal.Size(world, x, y, z, 1);
+ BlockModPortal.Size size1 = new BlockModPortal.Size(world, x, y, z, 2);
+ if (l == 1 && (!size.func_150860_b() || size.field_150864_e < size.field_150868_h * size.field_150862_g))
+ {
+ world.setBlock(x, y, z, Blocks.air);
+ }
+ else if (l == 2 && (!size1.func_150860_b() || size1.field_150864_e < size1.field_150868_h * size1.field_150862_g))
+ {
+ world.setBlock(x, y, z, Blocks.air);
+ }
+ else if (l == 0 && !size.func_150860_b() && !size1.func_150860_b())
+ {
+ world.setBlock(x, y, z, Blocks.air);
+ }
+ }
+
+ /**
+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
+ * coordinates. Args: blockAccess, x, y, z, side
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
+ {
+ int i1 = 0;
+
+ if (p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_) == this)
+ {
+ i1 = func_149999_b(p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_));
+
+ if (i1 == 0)
+ {
+ return false;
+ }
+
+ if (i1 == 2 && p_149646_5_ != 5 && p_149646_5_ != 4)
+ {
+ return false;
+ }
+
+ if (i1 == 1 && p_149646_5_ != 3 && p_149646_5_ != 2)
+ {
+ return false;
+ }
+ }
+
+ boolean flag = p_149646_1_.getBlock(p_149646_2_ - 1, p_149646_3_, p_149646_4_) == this && p_149646_1_.getBlock(p_149646_2_ - 2, p_149646_3_, p_149646_4_) != this;
+ boolean flag1 = p_149646_1_.getBlock(p_149646_2_ + 1, p_149646_3_, p_149646_4_) == this && p_149646_1_.getBlock(p_149646_2_ + 2, p_149646_3_, p_149646_4_) != this;
+ boolean flag2 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ - 1) == this && p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ - 2) != this;
+ boolean flag3 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ + 1) == this && p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ + 2) != this;
+ boolean flag4 = flag || flag1 || i1 == 1;
+ boolean flag5 = flag2 || flag3 || i1 == 2;
+ return flag4 && p_149646_5_ == 4 ? true : (flag4 && p_149646_5_ == 5 ? true : (flag5 && p_149646_5_ == 2 ? true : flag5 && p_149646_5_ == 3));
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(Random p_149745_1_)
+ {
+ return 0;
+ }
+
+ /**
+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
+ */
+ @Override
+ public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
+ if ((entity.ridingEntity == null) && (entity.riddenByEntity == null) && ((entity instanceof EntityPlayerMP))) {
+ EntityPlayerMP thePlayer = (EntityPlayerMP)entity;
+ if (thePlayer.timeUntilPortal > 0) {
+ thePlayer.timeUntilPortal = 10;
+ } else if (thePlayer.dimension != DimensionIDs.Dimension_A) {
+ thePlayer.timeUntilPortal = 10;
+ thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, DimensionIDs.Dimension_A, new Dimension_A_Teleporter(thePlayer.mcServer.worldServerForDimension(DimensionIDs.Dimension_A)));
+ } else {
+ thePlayer.timeUntilPortal = 10;
+ thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new Dimension_A_Teleporter(thePlayer.mcServer.worldServerForDimension(0)));
+ }
+ }
+ }
+
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World world, int x, int y, int z, Random random){
+ if (random.nextInt(100) == 0) {
+ world.playSound(x + 0.5D, y + 0.5D, z + 0.5D, "portal.portal", 0.5F, random.nextFloat() * 0.4F + 0.8F, false);
+ }
+ for (int l = 0; l < 4; ++l) {
+ double d0 = x + random.nextFloat();
+ double d1 = y + random.nextFloat();
+ double d2 = z + random.nextFloat();
+ double d3 = 0.0D;
+ double d4 = 0.0D;
+ double d5 = 0.0D;
+ int i1 = random.nextInt(2) * 2 - 1;
+ d3 = (random.nextFloat() - 0.5D) * 0.5D;
+ d4 = (random.nextFloat() - 0.5D) * 0.5D;
+ d5 = (random.nextFloat() - 0.5D) * 0.5D;
+ if (world.getBlock(x - 1, y, z) != this && world.getBlock(x + 1, y, z) != this) {
+ d0 = x + 0.5D + 0.25D * i1;
+ d3 = random.nextFloat() * 2.0F * i1;
+ } else {
+ d2 = z + 0.5D + 0.25D * i1;
+ d5 = random.nextFloat() * 2.0F * i1;
+ }
+ world.spawnParticle("portal", d0, d1, d2, d3, d4, d5);
+ }
+ }
+
+ public static int func_149999_b(int p_149999_0_)
+ {
+ return p_149999_0_ & 3;
+ }
+
+ /**
+ * Gets an item for the block being called on. Args: world, x, y, z
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
+ return Item.getItemById(0);
+ }
+
+ public static class Size
+ {
+ private final World worldObj;
+ private final int field_150865_b;
+ private final int field_150866_c;
+ private final int field_150863_d;
+ private int field_150864_e = 0;
+ private ChunkCoordinates field_150861_f;
+ private int field_150862_g;
+ private int field_150868_h;
+ @SuppressWarnings("unused")
+ private static final String __OBFID = "CL_00000285";
+
+ public Size(World p_i45415_1_, int p_i45415_2_, int p_i45415_3_, int p_i45415_4_, int p_i45415_5_)
+ {
+ this.worldObj = p_i45415_1_;
+ this.field_150865_b = p_i45415_5_;
+ this.field_150863_d = BlockModPortal.field_150001_a[p_i45415_5_][0];
+ this.field_150866_c = BlockModPortal.field_150001_a[p_i45415_5_][1];
+
+ for (int i1 = p_i45415_3_; p_i45415_3_ > i1 - 21 && p_i45415_3_ > 0 && this.getBlockMaterial(p_i45415_1_.getBlock(p_i45415_2_, p_i45415_3_ - 1, p_i45415_4_)); --p_i45415_3_)
+ {
+ ;
+ }
+
+ int j1 = this.func_150853_a(p_i45415_2_, p_i45415_3_, p_i45415_4_, this.field_150863_d) - 1;
+
+ if (j1 >= 0)
+ {
+ this.field_150861_f = new ChunkCoordinates(p_i45415_2_ + j1 * Direction.offsetX[this.field_150863_d], p_i45415_3_, p_i45415_4_ + j1 * Direction.offsetZ[this.field_150863_d]);
+ this.field_150868_h = this.func_150853_a(this.field_150861_f.posX, this.field_150861_f.posY, this.field_150861_f.posZ, this.field_150866_c);
+
+ if (this.field_150868_h < 2 || this.field_150868_h > 21)
+ {
+ this.field_150861_f = null;
+ this.field_150868_h = 0;
+ }
+ }
+
+ if (this.field_150861_f != null)
+ {
+ this.field_150862_g = this.func_150858_a();
+ }
+ }
+
+ protected int func_150853_a(int x, int y, int z, int p_150853_4_)
+ {
+ int j1 = Direction.offsetX[p_150853_4_];
+ int k1 = Direction.offsetZ[p_150853_4_];
+ int i1;
+ Block block;
+
+ for (i1 = 0; i1 < 22; ++i1)
+ {
+ block = this.worldObj.getBlock(x + j1 * i1, y, z + k1 * i1);
+
+ if (!this.getBlockMaterial(block))
+ {
+ break;
+ }
+
+ Block block1 = this.worldObj.getBlock(x + j1 * i1, y - 1, z + k1 * i1);
+
+ if (block1 != Blocks.stone)
+ {
+ break;
+ }
+ }
+
+ block = this.worldObj.getBlock(x + j1 * i1, y, z + k1 * i1);
+ return block == Blocks.stone ? i1 : 0;
+ }
+
+ protected int func_150858_a()
+ {
+ int i;
+ int j;
+ int k;
+ int l;
+ label56:
+
+ for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g)
+ {
+ i = this.field_150861_f.posY + this.field_150862_g;
+
+ for (j = 0; j < this.field_150868_h; ++j)
+ {
+ k = this.field_150861_f.posX + j * Direction.offsetX[BlockModPortal.field_150001_a[this.field_150865_b][1]];
+ l = this.field_150861_f.posZ + j * Direction.offsetZ[BlockModPortal.field_150001_a[this.field_150865_b][1]];
+ Block block = this.worldObj.getBlock(k, i, l);
+
+ if (!this.getBlockMaterial(block))
+ {
+ break label56;
+ }
+
+ if (block == ModBlocks.lightPortal)
+ {
+ ++this.field_150864_e;
+ }
+
+ if (j == 0)
+ {
+ block = this.worldObj.getBlock(k + Direction.offsetX[BlockModPortal.field_150001_a[this.field_150865_b][0]], i, l + Direction.offsetZ[BlockModPortal.field_150001_a[this.field_150865_b][0]]);
+
+ if (block != Blocks.stone)
+ {
+ break label56;
+ }
+ }
+ else if (j == this.field_150868_h - 1)
+ {
+ block = this.worldObj.getBlock(k + Direction.offsetX[BlockModPortal.field_150001_a[this.field_150865_b][1]], i, l + Direction.offsetZ[BlockModPortal.field_150001_a[this.field_150865_b][1]]);
+
+ if (block != Blocks.stone)
+ {
+ break label56;
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < this.field_150868_h; ++i)
+ {
+ j = this.field_150861_f.posX + i * Direction.offsetX[BlockModPortal.field_150001_a[this.field_150865_b][1]];
+ k = this.field_150861_f.posY + this.field_150862_g;
+ l = this.field_150861_f.posZ + i * Direction.offsetZ[BlockModPortal.field_150001_a[this.field_150865_b][1]];
+
+ if (this.worldObj.getBlock(j, k, l) != Blocks.stone)
+ {
+ this.field_150862_g = 0;
+ break;
+ }
+ }
+
+ if (this.field_150862_g <= 21 && this.field_150862_g >= 3)
+ {
+ return this.field_150862_g;
+ }
+ else
+ {
+ this.field_150861_f = null;
+ this.field_150868_h = 0;
+ this.field_150862_g = 0;
+ return 0;
+ }
+ }
+
+ protected boolean getBlockMaterial(Block block){
+ return block.getMaterial() == Material.air || block == ModBlocks.blockHellfire || block == ModBlocks.lightPortal;
+ }
+
+ public boolean func_150860_b()
+ {
+ return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 && this.field_150862_g >= 3 && this.field_150862_g <= 21;
+ }
+
+ public void func_150859_c()
+ {
+ for (int i = 0; i < this.field_150868_h; ++i)
+ {
+ int j = this.field_150861_f.posX + Direction.offsetX[this.field_150866_c] * i;
+ int k = this.field_150861_f.posZ + Direction.offsetZ[this.field_150866_c] * i;
+
+ for (int l = 0; l < this.field_150862_g; ++l)
+ {
+ int i1 = this.field_150861_f.posY + l;
+ this.worldObj.setBlock(j, i1, k, ModBlocks.lightPortal, this.field_150865_b, 2);
+ }
+ }
+ }
+ }
+
+ int blockColour = Utils.rgbtoHexValue(200, 50, 50);
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){
+
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.blockColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return this.blockColour;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/particle/EntityTreeFX.java b/src/Java/gtPlusPlus/core/world/dimensionA/particle/EntityTreeFX.java
new file mode 100644
index 0000000000..f9b471f0d4
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/world/dimensionA/particle/EntityTreeFX.java
@@ -0,0 +1,103 @@
+package gtPlusPlus.core.world.dimensionA.particle;
+
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.world.World;
+
+public class EntityTreeFX extends EntityFX{
+
+ //TODO: add abailty to change particle color in constructor.
+
+ private float portalParticleScale;
+ private double portalPosX;
+ private double portalPosY;
+ private double portalPosZ;
+
+ @SuppressWarnings("unused")
+ private static final String __OBFID = "CL_000003921";
+
+ public EntityTreeFX(World wor