mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-21 12:42:15 +00:00
This Is A Commit Message!!!!
This commit is contained in:
1 parent
6ea2f6904a
commit
8f5e981789
4 files changed
+37
-13
No files matched your search
+7
@@ -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;
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
+27
-10
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user