From 04210cce5ade5d59182efbe340fa89a9e7ff678d Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Tue, 27 Feb 2018 01:47:11 +1000 Subject: $ PMD Cleanup. --- .../core/world/darkworld/Dimension_DarkWorld.java | 8 +- .../world/darkworld/biome/GenLayerDarkWorld.java | 2 +- .../darkworld/block/BlockDarkWorldGround.java | 23 ++ .../block/BlockDarkWorldPollutedDirt.java | 72 ++++ .../darkworld/block/BlockDarkWorldPortal.java | 372 ++++++++++++++++++++ .../darkworld/block/BlockDarkWorldPortalFrame.java | 28 ++ .../darkworld/block/BlockDarkWorldSludgeFluid.java | 98 ++++++ .../darkworld/block/DarkWorldContentLoader.java | 18 +- .../darkworld/block/blockDarkWorldGround.java | 23 -- .../block/blockDarkWorldPollutedDirt.java | 72 ---- .../darkworld/block/blockDarkWorldPortal.java | 373 --------------------- .../darkworld/block/blockDarkWorldPortalFrame.java | 28 -- .../darkworld/block/blockDarkWorldSludgeFluid.java | 98 ------ .../darkworld/item/ItemDarkWorldPortalTrigger.java | 98 ++++++ .../darkworld/item/itemDarkWorldPortalTrigger.java | 98 ------ 15 files changed, 705 insertions(+), 706 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldGround.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortal.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortalFrame.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/item/ItemDarkWorldPortalTrigger.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/item/itemDarkWorldPortalTrigger.java (limited to 'src/Java/gtPlusPlus/core/world') diff --git a/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java index 6ad9a60a5a..33881c1e21 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java @@ -1,8 +1,8 @@ package gtPlusPlus.core.world.darkworld; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.world.darkworld.block.blockDarkWorldPortal; -import gtPlusPlus.core.world.darkworld.item.itemDarkWorldPortalTrigger; +import gtPlusPlus.core.world.darkworld.block.BlockDarkWorldPortal; +import gtPlusPlus.core.world.darkworld.item.ItemDarkWorldPortalTrigger; import gtPlusPlus.core.world.darkworld.world.WorldProviderMod; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -12,8 +12,8 @@ public class Dimension_DarkWorld { public Object instance; public static int DIMID = CORE.DARKWORLD_ID; - public static blockDarkWorldPortal portalBlock; - public static itemDarkWorldPortalTrigger portalItem; + public static BlockDarkWorldPortal portalBlock; + public static ItemDarkWorldPortalTrigger portalItem; public static Block blockTopLayer; public static Block blockSecondLayer; public static Block blockMainFiller = Blocks.stone; diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java index 481b16c6ee..1b7ab242e8 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java @@ -25,6 +25,6 @@ public class GenLayerDarkWorld extends GenLayer { @Override public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { - return null; + return new int[] {}; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java new file mode 100644 index 0000000000..a16836bce0 --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java @@ -0,0 +1,23 @@ +package gtPlusPlus.core.world.darkworld.block; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.creative.AddToCreativeTab; +import net.minecraft.block.BlockGrass; + +public class BlockDarkWorldGround extends BlockGrass implements ITileTooltip{ + + public BlockDarkWorldGround() { + this.setCreativeTab(AddToCreativeTab.tabBOP); + this.setBlockName("blockDarkWorldGround"); + this.setHardness(1.0F); + this.setBlockTextureName("minecraft" + ":" + "grass"); + LanguageRegistry.addName(this, "Unstable Earth"); + } + + @Override + public int getTooltipID() { + return 2; + } + +} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java new file mode 100644 index 0000000000..d8a05e9612 --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java @@ -0,0 +1,72 @@ +package gtPlusPlus.core.world.darkworld.block; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.creative.AddToCreativeTab; +import net.minecraft.block.BlockDirt; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; + +public class BlockDarkWorldPollutedDirt extends BlockDirt implements ITileTooltip{ + + public BlockDarkWorldPollutedDirt() { + this.setCreativeTab(AddToCreativeTab.tabBOP); + this.setBlockName("blockDarkWorldGround2"); + this.setHardness(0.5F); + this.setBlockTextureName("minecraft" + ":" + "dirt"); + LanguageRegistry.addName(this, "Polluted Soil"); + } + + @Override + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + double d0 = 0.5D; + double d1 = 1.0D; + return ColorizerGrass.getGrassColor(d0, d1); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @Override + @SideOnly(Side.CLIENT) + public int getRenderColor(int p_149741_1_) + { + return this.getBlockColor(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) + { + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = -1; k1 <= 1; ++k1) + { + for (int l1 = -1; l1 <= 1; ++l1) + { + int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1); + l += (i2 & 16711680) >> 16; + i1 += (i2 & 65280) >> 8; + j1 += i2 & 255; + } + } + + return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; + } + + @Override + public int getTooltipID() { + return 3; + } + +} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java new file mode 100644 index 0000000000..74bf034cf7 --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java @@ -0,0 +1,372 @@ +package gtPlusPlus.core.world.darkworld.block; + +import java.util.Random; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; +import gtPlusPlus.core.world.darkworld.world.TeleporterDimensionMod; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBreakable; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDarkWorldPortal extends BlockBreakable implements ITileTooltip{ + IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null; + + public BlockDarkWorldPortal() { + super("portal", Material.portal, false); + this.setTickRandomly(true); + this.setHardness(-1.0F); + this.setLightLevel(0.75F); + this.setCreativeTab(CreativeTabs.tabBlock); + this.setBlockName("blockDarkWorldPortal"); + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int i, int par2) { + + if (i == 0) + return gor; + + else if (i == 1) + return dol; + + else if (i == 2) + return st1; + + else if (i == 3) + return st2; + + else if (i == 4) + return st4; + + else if (i == 5) + return st3; + + else + return gor; + + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister reg) { + this.gor = reg.registerIcon("portal"); + this.dol = reg.registerIcon("portal"); + this.st1 = reg.registerIcon("portal"); + this.st2 = reg.registerIcon("portal"); + this.st3 = reg.registerIcon("portal"); + this.st4 = reg.registerIcon("portal"); + } + + /** + * Ticks the block if it's been scheduled + */ + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { + super.updateTick(par1World, par2, par3, par4, par5Random); + /*if (par1World.provider.isSurfaceWorld()) { + int l; + for (l = par3; !World.doesBlockHaveSolidTopSurface(par1World, par2, l, par4) && l > 0; --l) { + ; + } + if (l > 0 && !par1World.isBlockNormalCubeDefault(par2, l + 1, par4, true)) { + Entity entity = ItemMonsterPlacer.spawnCreature(par1World, 65, par2 + 0.5D, l + 1.1D, par4 + 0.5D); + if (entity != null && globalDarkWorldPortalSpawnTimer >= 100000) { + globalDarkWorldPortalSpawnTimer = 0; + if (MathUtils.randInt(0, 100)>=95){ + entity.timeUntilPortal = entity.getPortalCooldown(); + } + } + } + } + globalDarkWorldPortalSpawnTimer++;*/ + } + + /** + * 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 par1World, int par2, int par3, int par4) { + return null; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, + * y, z + */ + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + float f; + float f1; + if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) { + f = 0.125F; + f1 = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); + } else { + f = 0.5F; + f1 = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); + } + } + + /** + * 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; + } + + /** + * Checks to see if this location is valid to create a portal and will + * return True if it does. Args: world, x, y, z + */ + public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) { + byte b0 = 0; + byte b1 = 0; + if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_DarkWorld.blockPortalFrame + || par1World.getBlock(par2 + 1, par3, par4) == Dimension_DarkWorld.blockPortalFrame) { + b0 = 1; + } + if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_DarkWorld.blockPortalFrame + || par1World.getBlock(par2, par3, par4 + 1) == Dimension_DarkWorld.blockPortalFrame) { + b1 = 1; + } + if (b0 == b1) { + return false; + } else { + if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) { + par2 -= b0; + par4 -= b1; + } + int l; + int i1; + for (l = -1; l <= 2; ++l) { + for (i1 = -1; i1 <= 3; ++i1) { + boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3; + if (l != -1 && l != 2 || i1 != -1 && i1 != 3) { + Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l); + if (flag) { + if (j1 != Dimension_DarkWorld.blockPortalFrame) { + return false; + } + } + /* + * else if (j1 != 0 && j1 != + * Main.TutorialFire.blockID) { return false; } + */ + } + } + } + for (l = 0; l < 2; ++l) { + for (i1 = 0; i1 < 3; ++i1) { + par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2); + } + } + return true; + } + } + + /** + * 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 blockID + */ + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { + byte b0 = 0; + byte b1 = 1; + if (par1World.getBlock(par2 - 1, par3, par4) == this || par1World.getBlock(par2 + 1, par3, par4) == this) { + b0 = 1; + b1 = 0; + } + int i1; + for (i1 = par3; par1World.getBlock(par2, i1 - 1, par4) == this; --i1) { + ; + } + if (par1World.getBlock(par2, i1 - 1, par4) != Dimension_DarkWorld.blockPortalFrame) { + par1World.setBlockToAir(par2, par3, par4); + } else { + int j1; + for (j1 = 1; j1 < 4 && par1World.getBlock(par2, i1 + j1, par4) == this; ++j1) { + ; + } + if (j1 == 3 && par1World.getBlock(par2, i1 + j1, par4) == Dimension_DarkWorld.blockPortalFrame) { + boolean flag = par1World.getBlock(par2 - 1, par3, par4) == this || par1World.getBlock(par2 + 1, par3, par4) == this; + boolean flag1 = par1World.getBlock(par2, par3, par4 - 1) == this || par1World.getBlock(par2, par3, par4 + 1) == this; + if (flag && flag1) { + par1World.setBlockToAir(par2, par3, par4); + } else { + if ((par1World.getBlock(par2 + b0, par3, par4 + b1) != Dimension_DarkWorld.blockPortalFrame || par1World + .getBlock(par2 - b0, par3, par4 - b1) != this) + && (par1World.getBlock(par2 - b0, par3, par4 - b1) != Dimension_DarkWorld.blockPortalFrame || par1World.getBlock(par2 + b0, par3, + par4 + b1) != this)) { + par1World.setBlockToAir(par2, par3, par4); + } + } + } else { + par1World.setBlockToAir(par2, par3, par4); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + /** + * 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 + */ + public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + if (par1IBlockAccess.getBlock(par2, par3, par4) == this) { + return false; + } else { + boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this; + boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this; + boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this; + boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this; + boolean flag4 = flag || flag1; + boolean flag5 = flag2 || flag3; + return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3)); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + @Override + public int quantityDropped(Random par1Random) { + 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 par1World, int par2, int par3, int par4, Entity par5Entity) { + if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && ((par5Entity instanceof EntityPlayerMP))) { + EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity; + if (thePlayer.timeUntilPortal > 0) { + thePlayer.timeUntilPortal = 100; + } else if (thePlayer.dimension != Dimension_DarkWorld.DIMID) { + thePlayer.timeUntilPortal = 100; + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, Dimension_DarkWorld.DIMID, + new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(Dimension_DarkWorld.DIMID))); + } else { + thePlayer.timeUntilPortal = 100; + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, + new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0))); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 1; + } + + @Override + @SideOnly(Side.CLIENT) + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { + if (CORE.RANDOM.nextInt(100) == 0) { + par1World.playSound(par2 + 0.5D, par3 + 0.5D, par4 + 0.5D, "portal.portal", 0.5F, + CORE.RANDOM.nextFloat() * 0.4F + 0.8F, false); + } + for (int l = 0; l < 4; ++l) { + double d0 = par2 + CORE.RANDOM.nextFloat(); + double d1 = par3 + CORE.RANDOM.nextFloat(); + double d2 = par4 + CORE.RANDOM.nextFloat(); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + int i1 = CORE.RANDOM.nextInt(2) * 2 - 1; + d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; + d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; + d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; + if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) { + d0 = par2 + 0.5D + 0.25D * i1; + d3 = CORE.RANDOM.nextFloat() * 2.0F * i1; + } else { + d2 = par4 + 0.5D + 0.25D * i1; + d5 = CORE.RANDOM.nextFloat() * 2.0F * i1; + } + par1World.spawnParticle("reddust", d0+0.1D, d1, d2, d3, d4, d5); + par1World.spawnParticle("smoke", d0, d1+0.1D, d2, 0, 0, 0); + + Random R = new Random(); + + if (R.nextInt(10) == 0){ + par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0+0.2D, 0); + } + else if (R.nextInt(5)==1){ + par1World.spawnParticle("flame", d0, d1, d2, 0, 0+0.1D, 0); + } + } + } + + @SideOnly(Side.CLIENT) + /** + * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) + */ + public int idPicked(World par1World, int par2, int par3, int par4) { + return 0; + } + + @Override + public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){ + return Utils.rgbtoHexValue(0, 255, 0); + } + + @Override + public int getRenderColor(final int aMeta) { + return Utils.rgbtoHexValue(0, 255, 0); + } + + @Override + public String getLocalizedName() { + return EnumChatFormatting.OBFUSCATED+super.getLocalizedName(); + } + + @Override + public int getTooltipID() { + return 1; + } +} + + diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java new file mode 100644 index 0000000000..1ab195d1aa --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java @@ -0,0 +1,28 @@ +package gtPlusPlus.core.world.darkworld.block; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip{ + + public BlockDarkWorldPortalFrame() { + super(Material.iron); + this.setCreativeTab(AddToCreativeTab.tabBOP); + this.setBlockName("blockDarkWorldPortalFrame"); + this.setHardness(3.0F); + this.setLightLevel(0.5F); + this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A"); + LanguageRegistry.addName(this, "Containment Frame"); + + } + + @Override + public int getTooltipID() { + return 0; + } + +} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java new file mode 100644 index 0000000000..9f8ed377bc --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java @@ -0,0 +1,98 @@ +package gtPlusPlus.core.world.darkworld.block; + +import net.minecraft.block.material.*; +import net.minecraftforge.fluids.Fluid; + +public class BlockDarkWorldSludgeFluid extends Fluid { + + + public static final Material SLUDGE = new MaterialLiquid(MapColor.dirtColor); + + protected static int mapColor = 0xFFFFFFFF; + protected static float overlayAlpha = 0.2F; + //protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY; + //protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL; + protected static Material material = SLUDGE; + + + public BlockDarkWorldSludgeFluid(String fluidName, int rgbColour) { + this(fluidName, rgbColour, null); + } + + public BlockDarkWorldSludgeFluid(String fluidName, int rgbColour, Float overlayAlpha) { + super(fluidName); + setColor(rgbColour); + if (overlayAlpha != null){ + setAlpha(overlayAlpha.floatValue()); + } + else { + setAlpha(0); + } + } + + @Override + public int getColor() + { + return mapColor; + } + + public BlockDarkWorldSludgeFluid setColor(int parColor) + { + mapColor = parColor; + return this; + } + + public float getAlpha() + { + return overlayAlpha; + } + + public BlockDarkWorldSludgeFluid setAlpha(float parOverlayAlpha) + { + overlayAlpha = parOverlayAlpha; + return this; + } + + /*public blockDarkWorldSludgeFluid setEmptySound(SoundEvent parSound) + { + emptySound = parSound; + return this; + } + + public SoundEvent getEmptySound() + { + return emptySound; + } + + @Override + public blockDarkWorldSludgeFluid setFillSound(SoundEvent parSound) + { + fillSound = parSound; + return this; + } + + @Override + public SoundEvent getFillSound() + { + return fillSound; + }*/ + + public BlockDarkWorldSludgeFluid setMaterial(Material parMaterial) + { + material = parMaterial; + return this; + } + + public Material getMaterial() + { + return material; + } + + /*@Override + public boolean doesVaporize(FluidStack fluidStack) + { + if (block == null) + return false; + return block.getDefaultState().getMaterial() == getMaterial(); + }*/ +} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java b/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java index 1908eeb11e..94e35a97ed 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java @@ -7,14 +7,14 @@ import gtPlusPlus.core.block.base.BlockBaseFluid; import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTooltip; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.world.darkworld.item.ItemBlockToxicEverglades; -import gtPlusPlus.core.world.darkworld.item.itemDarkWorldPortalTrigger; +import gtPlusPlus.core.world.darkworld.item.ItemDarkWorldPortalTrigger; import net.minecraft.init.Blocks; import net.minecraftforge.fluids.FluidRegistry; public class DarkWorldContentLoader { //Static Vars - public static blockDarkWorldSludgeFluid SLUDGE; + public static BlockDarkWorldSludgeFluid SLUDGE; public synchronized static void run() { @@ -26,7 +26,7 @@ public class DarkWorldContentLoader { public synchronized static boolean initMisc(){ //Fluids - SLUDGE = (blockDarkWorldSludgeFluid) new blockDarkWorldSludgeFluid( + SLUDGE = (BlockDarkWorldSludgeFluid) new BlockDarkWorldSludgeFluid( "sludge", Utils.rgbtoHexValue(30, 130, 30)) .setDensity(1800) @@ -40,7 +40,7 @@ public class DarkWorldContentLoader { } public synchronized static boolean initItems(){ - portalItem = (itemDarkWorldPortalTrigger) (new itemDarkWorldPortalTrigger().setUnlocalizedName("everglades.trigger")); + portalItem = (ItemDarkWorldPortalTrigger) (new ItemDarkWorldPortalTrigger().setUnlocalizedName("everglades.trigger")); GameRegistry.registerItem(portalItem, "everglades.trigger"); return true; } @@ -48,11 +48,11 @@ public class DarkWorldContentLoader { public synchronized static boolean initBlocks(){ //Create Block Instances - blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, blockDarkWorldSludgeFluid.SLUDGE).setLightLevel(2f).setLightOpacity(1).setBlockName("fluidSludge"); - portalBlock = new blockDarkWorldPortal(); - blockTopLayer = new blockDarkWorldGround(); - blockSecondLayer = new blockDarkWorldPollutedDirt(); - blockPortalFrame = new blockDarkWorldPortalFrame(); + blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, BlockDarkWorldSludgeFluid.SLUDGE).setLightLevel(2f).setLightOpacity(1).setBlockName("fluidSludge"); + portalBlock = new BlockDarkWorldPortal(); + blockTopLayer = new BlockDarkWorldGround(); + blockSecondLayer = new BlockDarkWorldPollutedDirt(); + blockPortalFrame = new BlockDarkWorldPortalFrame(); //Registry GameRegistry.registerBlock(portalBlock, ItemBlockToxicEverglades.class, "dimensionDarkWorld_portal"); diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldGround.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldGround.java deleted file mode 100644 index ccfb1b0595..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldGround.java +++ /dev/null @@ -1,23 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import cpw.mods.fml.common.registry.LanguageRegistry; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import net.minecraft.block.BlockGrass; - -public class blockDarkWorldGround extends BlockGrass implements ITileTooltip{ - - public blockDarkWorldGround() { - this.setCreativeTab(AddToCreativeTab.tabBOP); - this.setBlockName("blockDarkWorldGround"); - this.setHardness(1.0F); - this.setBlockTextureName("minecraft" + ":" + "grass"); - LanguageRegistry.addName(this, "Unstable Earth"); - } - - @Override - public int getTooltipID() { - return 2; - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java deleted file mode 100644 index ee5a106bd3..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java +++ /dev/null @@ -1,72 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import net.minecraft.block.BlockDirt; -import net.minecraft.world.ColorizerGrass; -import net.minecraft.world.IBlockAccess; - -public class blockDarkWorldPollutedDirt extends BlockDirt implements ITileTooltip{ - - public blockDarkWorldPollutedDirt() { - this.setCreativeTab(AddToCreativeTab.tabBOP); - this.setBlockName("blockDarkWorldGround2"); - this.setHardness(0.5F); - this.setBlockTextureName("minecraft" + ":" + "dirt"); - LanguageRegistry.addName(this, "Polluted Soil"); - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() - { - double d0 = 0.5D; - double d1 = 1.0D; - return ColorizerGrass.getGrassColor(d0, d1); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int p_149741_1_) - { - return this.getBlockColor(); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) - { - int l = 0; - int i1 = 0; - int j1 = 0; - - for (int k1 = -1; k1 <= 1; ++k1) - { - for (int l1 = -1; l1 <= 1; ++l1) - { - int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1); - l += (i2 & 16711680) >> 16; - i1 += (i2 & 65280) >> 8; - j1 += i2 & 255; - } - } - - return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; - } - - @Override - public int getTooltipID() { - return 3; - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortal.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortal.java deleted file mode 100644 index eab52a4183..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortal.java +++ /dev/null @@ -1,373 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import java.util.Random; - -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; -import gtPlusPlus.core.world.darkworld.world.TeleporterDimensionMod; -import net.minecraft.block.Block; -import net.minecraft.block.BlockBreakable; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public class blockDarkWorldPortal extends BlockBreakable implements ITileTooltip{ - IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null; - - public blockDarkWorldPortal() { - super("portal", Material.portal, false); - this.setTickRandomly(true); - this.setHardness(-1.0F); - this.setLightLevel(0.75F); - this.setCreativeTab(CreativeTabs.tabBlock); - this.setBlockName("blockDarkWorldPortal"); - LanguageRegistry.addName(this, "A Glimpse of the Toxic Everglades"); - - } - - @SideOnly(Side.CLIENT) - @Override - public IIcon getIcon(int i, int par2) { - - if (i == 0) - return gor; - - else if (i == 1) - return dol; - - else if (i == 2) - return st1; - - else if (i == 3) - return st2; - - else if (i == 4) - return st4; - - else if (i == 5) - return st3; - - else - return gor; - - } - - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister reg) { - this.gor = reg.registerIcon("portal"); - this.dol = reg.registerIcon("portal"); - this.st1 = reg.registerIcon("portal"); - this.st2 = reg.registerIcon("portal"); - this.st3 = reg.registerIcon("portal"); - this.st4 = reg.registerIcon("portal"); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - super.updateTick(par1World, par2, par3, par4, par5Random); - /*if (par1World.provider.isSurfaceWorld()) { - int l; - for (l = par3; !World.doesBlockHaveSolidTopSurface(par1World, par2, l, par4) && l > 0; --l) { - ; - } - if (l > 0 && !par1World.isBlockNormalCubeDefault(par2, l + 1, par4, true)) { - Entity entity = ItemMonsterPlacer.spawnCreature(par1World, 65, par2 + 0.5D, l + 1.1D, par4 + 0.5D); - if (entity != null && globalDarkWorldPortalSpawnTimer >= 100000) { - globalDarkWorldPortalSpawnTimer = 0; - if (MathUtils.randInt(0, 100)>=95){ - entity.timeUntilPortal = entity.getPortalCooldown(); - } - } - } - } - globalDarkWorldPortalSpawnTimer++;*/ - } - - /** - * 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 par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, - * y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - float f; - float f1; - if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) { - f = 0.125F; - f1 = 0.5F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); - } else { - f = 0.5F; - f1 = 0.125F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); - } - } - - /** - * 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; - } - - /** - * Checks to see if this location is valid to create a portal and will - * return True if it does. Args: world, x, y, z - */ - public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) { - byte b0 = 0; - byte b1 = 0; - if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_DarkWorld.blockPortalFrame - || par1World.getBlock(par2 + 1, par3, par4) == Dimension_DarkWorld.blockPortalFrame) { - b0 = 1; - } - if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_DarkWorld.blockPortalFrame - || par1World.getBlock(par2, par3, par4 + 1) == Dimension_DarkWorld.blockPortalFrame) { - b1 = 1; - } - if (b0 == b1) { - return false; - } else { - if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) { - par2 -= b0; - par4 -= b1; - } - int l; - int i1; - for (l = -1; l <= 2; ++l) { - for (i1 = -1; i1 <= 3; ++i1) { - boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3; - if (l != -1 && l != 2 || i1 != -1 && i1 != 3) { - Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l); - if (flag) { - if (j1 != Dimension_DarkWorld.blockPortalFrame) { - return false; - } - } - /* - * else if (j1 != 0 && j1 != - * Main.TutorialFire.blockID) { return false; } - */ - } - } - } - for (l = 0; l < 2; ++l) { - for (i1 = 0; i1 < 3; ++i1) { - par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2); - } - } - return true; - } - } - - /** - * 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 blockID - */ - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { - byte b0 = 0; - byte b1 = 1; - if (par1World.getBlock(par2 - 1, par3, par4) == this || par1World.getBlock(par2 + 1, par3, par4) == this) { - b0 = 1; - b1 = 0; - } - int i1; - for (i1 = par3; par1World.getBlock(par2, i1 - 1, par4) == this; --i1) { - ; - } - if (par1World.getBlock(par2, i1 - 1, par4) != Dimension_DarkWorld.blockPortalFrame) { - par1World.setBlockToAir(par2, par3, par4); - } else { - int j1; - for (j1 = 1; j1 < 4 && par1World.getBlock(par2, i1 + j1, par4) == this; ++j1) { - ; - } - if (j1 == 3 && par1World.getBlock(par2, i1 + j1, par4) == Dimension_DarkWorld.blockPortalFrame) { - boolean flag = par1World.getBlock(par2 - 1, par3, par4) == this || par1World.getBlock(par2 + 1, par3, par4) == this; - boolean flag1 = par1World.getBlock(par2, par3, par4 - 1) == this || par1World.getBlock(par2, par3, par4 + 1) == this; - if (flag && flag1) { - par1World.setBlockToAir(par2, par3, par4); - } else { - if ((par1World.getBlock(par2 + b0, par3, par4 + b1) != Dimension_DarkWorld.blockPortalFrame || par1World - .getBlock(par2 - b0, par3, par4 - b1) != this) - && (par1World.getBlock(par2 - b0, par3, par4 - b1) != Dimension_DarkWorld.blockPortalFrame || par1World.getBlock(par2 + b0, par3, - par4 + b1) != this)) { - par1World.setBlockToAir(par2, par3, par4); - } - } - } else { - par1World.setBlockToAir(par2, par3, par4); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * 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 - */ - public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - if (par1IBlockAccess.getBlock(par2, par3, par4) == this) { - return false; - } else { - boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this; - boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this; - boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this; - boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this; - boolean flag4 = flag || flag1; - boolean flag5 = flag2 || flag3; - return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3)); - } - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - 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 par1World, int par2, int par3, int par4, Entity par5Entity) { - if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && ((par5Entity instanceof EntityPlayerMP))) { - EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity; - if (thePlayer.timeUntilPortal > 0) { - thePlayer.timeUntilPortal = 100; - } else if (thePlayer.dimension != Dimension_DarkWorld.DIMID) { - thePlayer.timeUntilPortal = 100; - thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, Dimension_DarkWorld.DIMID, - new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(Dimension_DarkWorld.DIMID))); - } else { - thePlayer.timeUntilPortal = 100; - thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, - new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0))); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - public int getRenderBlockPass() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * A randomly called display update to be able to add particles or other items for display - */ - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (CORE.RANDOM.nextInt(100) == 0) { - par1World.playSound(par2 + 0.5D, par3 + 0.5D, par4 + 0.5D, "portal.portal", 0.5F, - CORE.RANDOM.nextFloat() * 0.4F + 0.8F, false); - } - for (int l = 0; l < 4; ++l) { - double d0 = par2 + CORE.RANDOM.nextFloat(); - double d1 = par3 + CORE.RANDOM.nextFloat(); - double d2 = par4 + CORE.RANDOM.nextFloat(); - double d3 = 0.0D; - double d4 = 0.0D; - double d5 = 0.0D; - int i1 = CORE.RANDOM.nextInt(2) * 2 - 1; - d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; - d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; - d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; - if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) { - d0 = par2 + 0.5D + 0.25D * i1; - d3 = CORE.RANDOM.nextFloat() * 2.0F * i1; - } else { - d2 = par4 + 0.5D + 0.25D * i1; - d5 = CORE.RANDOM.nextFloat() * 2.0F * i1; - } - par1World.spawnParticle("reddust", d0+0.1D, d1, d2, d3, d4, d5); - par1World.spawnParticle("smoke", d0, d1+0.1D, d2, 0, 0, 0); - - Random R = new Random(); - - if (R.nextInt(10) == 0){ - par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0+0.2D, 0); - } - else if (R.nextInt(5)==1){ - par1World.spawnParticle("flame", d0, d1, d2, 0, 0+0.1D, 0); - } - } - } - - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - - @Override - public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){ - return Utils.rgbtoHexValue(0, 255, 0); - } - - @Override - public int getRenderColor(final int aMeta) { - return Utils.rgbtoHexValue(0, 255, 0); - } - - @Override - public String getLocalizedName() { - return EnumChatFormatting.OBFUSCATED+super.getLocalizedName(); - } - - @Override - public int getTooltipID() { - return 1; - } -} - - diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortalFrame.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortalFrame.java deleted file mode 100644 index ef6f2b0c7d..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPortalFrame.java +++ /dev/null @@ -1,28 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import cpw.mods.fml.common.registry.LanguageRegistry; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; - -public class blockDarkWorldPortalFrame extends Block implements ITileTooltip{ - - public blockDarkWorldPortalFrame() { - super(Material.iron); - this.setCreativeTab(AddToCreativeTab.tabBOP); - this.setBlockName("blockDarkWorldPortalFrame"); - this.setHardness(3.0F); - this.setLightLevel(0.5F); - this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A"); - LanguageRegistry.addName(this, "Containment Frame"); - - } - - @Override - public int getTooltipID() { - return 0; - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java deleted file mode 100644 index c3c9beddc8..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java +++ /dev/null @@ -1,98 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import net.minecraft.block.material.*; -import net.minecraftforge.fluids.Fluid; - -public class blockDarkWorldSludgeFluid extends Fluid { - - - public static final Material SLUDGE = new MaterialLiquid(MapColor.dirtColor); - - protected static int mapColor = 0xFFFFFFFF; - protected static float overlayAlpha = 0.2F; - //protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY; - //protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL; - protected static Material material = SLUDGE; - - - public blockDarkWorldSludgeFluid(String fluidName, int rgbColour) { - this(fluidName, rgbColour, null); - } - - public blockDarkWorldSludgeFluid(String fluidName, int rgbColour, Float overlayAlpha) { - super(fluidName); - setColor(rgbColour); - if (overlayAlpha != null){ - setAlpha(overlayAlpha.floatValue()); - } - else { - setAlpha(0); - } - } - - @Override - public int getColor() - { - return mapColor; - } - - public blockDarkWorldSludgeFluid setColor(int parColor) - { - mapColor = parColor; - return this; - } - - public float getAlpha() - { - return overlayAlpha; - } - - public blockDarkWorldSludgeFluid setAlpha(float parOverlayAlpha) - { - overlayAlpha = parOverlayAlpha; - return this; - } - - /*public blockDarkWorldSludgeFluid setEmptySound(SoundEvent parSound) - { - emptySound = parSound; - return this; - } - - public SoundEvent getEmptySound() - { - return emptySound; - } - - @Override - public blockDarkWorldSludgeFluid setFillSound(SoundEvent parSound) - { - fillSound = parSound; - return this; - } - - @Override - public SoundEvent getFillSound() - { - return fillSound; - }*/ - - public blockDarkWorldSludgeFluid setMaterial(Material parMaterial) - { - material = parMaterial; - return this; - } - - public Material getMaterial() - { - return material; - } - - /*@Override - public boolean doesVaporize(FluidStack fluidStack) - { - if (block == null) - return false; - return block.getDefaultState().getMaterial() == getMaterial(); - }*/ -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/item/ItemDarkWorldPortalTrigger.java b/src/Java/gtPlusPlus/core/world/darkworld/item/ItemDarkWorldPortalTrigger.java new file mode 100644 index 0000000000..f3fd499ce4 --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/item/ItemDarkWorldPortalTrigger.java @@ -0,0 +1,98 @@ +package gtPlusPlus.core.world.darkworld.item; + +import java.util.List; + +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.*; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class ItemDarkWorldPortalTrigger extends Item { + public ItemDarkWorldPortalTrigger() { + super(); + this.maxStackSize = 1; + setMaxDamage(64); + setCreativeTab(CreativeTabs.tabTools); + this.setTextureName(CORE.MODID + ":" + "itemAlkalusDisk"); + } + + @Override + public Item setMaxStackSize(int int1) { + return super.setMaxStackSize(1); + } + + @Override + public EnumRarity getRarity(ItemStack thisItem) { + return EnumRarity.epic; + } + + @Override + public boolean hasEffect(ItemStack par1ItemStack, int pass) { + return true; + } + + @Override + public String getItemStackDisplayName(final ItemStack p_77653_1_) { + return EnumChatFormatting.GOLD+"Alkalus Disk ["+EnumChatFormatting.RED+"Activated"+EnumChatFormatting.GOLD+"]"; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + list.add(EnumChatFormatting.GREEN+"Shines the way, towards the far away Everglades."); + list.add(EnumChatFormatting.GREEN+"This item produces such a temperature, that you'd hate to use it incorrectly."); + super.addInformation(stack, aPlayer, list, bool); + } + + @Override + public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) { + return Utils.rgbtoHexValue(255, 128, 0); + } + + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, + float par8, float par9, float par10) { + if (par7 == 0) { + par5--; + } + if (par7 == 1) { + par5++; + } + if (par7 == 2) { + par6--; + } + if (par7 == 3) { + par6++; + } + if (par7 == 4) { + par4--; + } + if (par7 == 5) { + par4++; + } + if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } + Block i1 = par3World.getBlock(par4, par5, par6); + if (i1 == Blocks.air) { + par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + if (Dimension_DarkWorld.portalBlock.tryToCreatePortal(par3World, par4, par5, par6)){ + //Make a Portal + } + else { + if (!par3World.isRemote){ + par3World.setBlock(par4, par5, par6, ModBlocks.blockHellfire, 0, 3); + } + } + } + par1ItemStack.damageItem(1, par2EntityPlayer); + return true; + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/world/darkworld/item/itemDarkWorldPortalTrigger.java b/src/Java/gtPlusPlus/core/world/darkworld/item/itemDarkWorldPortalTrigger.java deleted file mode 100644 index fa85cbe4a3..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/item/itemDarkWorldPortalTrigger.java +++ /dev/null @@ -1,98 +0,0 @@ -package gtPlusPlus.core.world.darkworld.item; - -import java.util.List; - -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.*; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -public class itemDarkWorldPortalTrigger extends Item { - public itemDarkWorldPortalTrigger() { - super(); - this.maxStackSize = 1; - setMaxDamage(64); - setCreativeTab(CreativeTabs.tabTools); - this.setTextureName(CORE.MODID + ":" + "itemAlkalusDisk"); - } - - @Override - public Item setMaxStackSize(int int1) { - return super.setMaxStackSize(1); - } - - @Override - public EnumRarity getRarity(ItemStack thisItem) { - return EnumRarity.epic; - } - - @Override - public boolean hasEffect(ItemStack par1ItemStack, int pass) { - return true; - } - - @Override - public String getItemStackDisplayName(final ItemStack p_77653_1_) { - return EnumChatFormatting.GOLD+"Alkalus Disk ["+EnumChatFormatting.RED+"Activated"+EnumChatFormatting.GOLD+"]"; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(EnumChatFormatting.GREEN+"Shines the way, towards the far away Everglades."); - list.add(EnumChatFormatting.GREEN+"This item produces such a temperature, that you'd hate to use it incorrectly."); - super.addInformation(stack, aPlayer, list, bool); - } - - @Override - public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) { - return Utils.rgbtoHexValue(255, 128, 0); - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, - float par8, float par9, float par10) { - if (par7 == 0) { - par5--; - } - if (par7 == 1) { - par5++; - } - if (par7 == 2) { - par6--; - } - if (par7 == 3) { - par6++; - } - if (par7 == 4) { - par4--; - } - if (par7 == 5) { - par4++; - } - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } - Block i1 = par3World.getBlock(par4, par5, par6); - if (i1 == Blocks.air) { - par3World.playSoundEffect(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - if (Dimension_DarkWorld.portalBlock.tryToCreatePortal(par3World, par4, par5, par6)){ - //Make a Portal - } - else { - if (!par3World.isRemote){ - par3World.setBlock(par4, par5, par6, ModBlocks.blockHellfire, 0, 3); - } - } - } - par1ItemStack.damageItem(1, par2EntityPlayer); - return true; - } -} \ No newline at end of file -- cgit