diff --git a/build.gradle b/build.gradle index 71be6dec..5b6e76f7 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-v0.9.3-Beta-Pre3" +version = "1.7.10-v0.9.3-Beta-Pre4" group= "com.brandon3055.draconicevolution" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Draconic-Evolution" diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java index 92176596..cc0d3566 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/EnergyPylon.java @@ -15,10 +15,13 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; /** * Created by Brandon on 28/07/2014. @@ -110,6 +113,10 @@ public class EnergyPylon extends DraconicEvolutionBlock { int meta = world.getBlockMetadata(x, y, z); if (meta == 0) return false; TileEnergyPylon thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y, z) : null; + if (player.getHeldItem() != null && player.getHeldItem().isItemEqual(new ItemStack(Items.stick)) && thisTile != null && world.isRemote) + { + LogHelper.info(thisTile.getEnergyStored(ForgeDirection.UP)); + } if (thisTile != null) { thisTile.onActivated(); return true; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java index 66b94c75..c6df7c97 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/InvisibleMultiblock.java @@ -133,7 +133,7 @@ public class InvisibleMultiblock extends DraconicEvolutionBlock { revert(world, x, y, z); return; } - if (master.isOnline()) master.isStructureStillValid(false); + if (master.isOnline()) master.isStructureStillValid(thisTile.getMaster().getTier() == 1); if (!master.isOnline()) revert(world, x, y, z); }else if (meta == 2) { if (world.getBlock(x, y + 1, z) != ModBlocks.energyPylon && world.getBlock(x, y - 1, z) != ModBlocks.energyPylon) world.setBlock(x, y, z, Blocks.glass); @@ -156,7 +156,7 @@ public class InvisibleMultiblock extends DraconicEvolutionBlock { { world.setBlockMetadataWithNotify(x, y, z, 0, 2); - thisTile.getMaster().isStructureStillValid(true); + thisTile.getMaster().isStructureStillValid(thisTile.getMaster().getTier() == 1); } super.breakBlock(world, x, y, z, p_149749_5_, meta); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java index 586d9c0c..c67c6bd0 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyPylon.java @@ -83,7 +83,8 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler { int maxRecived = (int)Math.min(storage.getMaxEnergyStored() - storage.getEnergyStored(), getMaster().getEnergyStored()); storage.modifyEnergyStored(maxRecived); getMaster().extractEnergy(maxRecived, false); - if (particleRate < 10) particleRate++; + particleRate = maxRecived / 40; + if (particleRate > 100) particleRate = 100; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); }else { if (particleRate > 0) particleRate--; @@ -109,8 +110,8 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler { int maxSent = (int)Math.min(getMaster().getMaxEnergyStored() - getMaster().getEnergyStored(), storage.getEnergyStored()); storage.modifyEnergyStored(-maxSent); getMaster().receiveEnergy(maxSent, false); - - if (particleRate < 10) particleRate++; + particleRate = maxSent / 40; + if (particleRate > 100) particleRate = 100; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); }else { if (particleRate > 0) particleRate--; @@ -155,6 +156,7 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler { double targetX; double targetY; double targetZ; + if (particleRate > 100) particleRate = 100; if (input){ spawnX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); spawnY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); @@ -167,11 +169,18 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler { ParticleHandler.spawnCustomParticle(passiveParticle, 50); } if (particleRate > 0){ - if (particleRate > 10) particleRate = 10; - for (int i = 0; i <= particleRate; i++){ - spawnX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); - spawnY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); - spawnZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + if (particleRate > 10) { + for (int i = 0; i <= particleRate/10; i++) { + spawnX = x + 0.5 - disMod + (rand.nextFloat() * (disMod * 2)); + spawnY = y + 0.5 - disMod + (rand.nextFloat() * (disMod * 2)); + spawnZ = z + 0.5 - disMod + (rand.nextFloat() * (disMod * 2)); + Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, false); + ParticleHandler.spawnCustomParticle(passiveParticle, 50); + } + }else if (rand.nextInt(Math.max(1, 10 - particleRate)) == 0){ + spawnX = x + 0.5 - disMod + (rand.nextFloat() * (disMod * 2)); + spawnY = y + 0.5 - disMod + (rand.nextFloat() * (disMod * 2)); + spawnZ = z + 0.5 - disMod + (rand.nextFloat() * (disMod * 2)); Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, false); ParticleHandler.spawnCustomParticle(passiveParticle, 50); } @@ -188,9 +197,17 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler { Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, true); ParticleHandler.spawnCustomParticle(passiveParticle, 50); } + if (particleRate > 0){ - if (particleRate > 10) particleRate = 10; - for (int i = 0; i <= particleRate; i++){ + if (particleRate > 10) { + for (int i = 0; i <= particleRate/10; i++) { + targetX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + targetZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2)); + Particles.EnergyTransferParticle passiveParticle = new Particles.EnergyTransferParticle(worldObj, spawnX, spawnY, spawnZ, targetX, targetY, targetZ, false); + ParticleHandler.spawnCustomParticle(passiveParticle, 50); + } + }else if (rand.nextInt(Math.max(1, 10 - particleRate)) == 0){ targetX = x+0.5 - disMod + (rand.nextFloat() * (disMod*2)); targetY = y+0.5 - disMod + (rand.nextFloat() * (disMod*2)); targetZ = z+0.5 - disMod + (rand.nextFloat() * (disMod*2));