aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines/basic
diff options
context:
space:
mode:
authorJohn <Techlone@users.noreply.github.com>2017-04-16 02:18:17 +0500
committerGitHub <noreply@github.com>2017-04-16 02:18:17 +0500
commitbd1ca056d63fe0ac2c3a8478c78183eafea92096 (patch)
tree9c75a11959a6479e27ebc4a6e5818dcc48218e1d /src/main/java/gregtech/common/tileentities/machines/basic
parent88128f31146c9f3fa1f5159fbc1252cb2d79f915 (diff)
parent2ee3b7e712413604549af3097fda93cbb22a262e (diff)
downloadGT5-Unofficial-bd1ca056d63fe0ac2c3a8478c78183eafea92096.tar.gz
GT5-Unofficial-bd1ca056d63fe0ac2c3a8478c78183eafea92096.tar.bz2
GT5-Unofficial-bd1ca056d63fe0ac2c3a8478c78183eafea92096.zip
Merge pull request #14 from Blood-Asp/unstable
Update
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/basic')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_LightningRod.java130
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java14
2 files changed, 10 insertions, 134 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_LightningRod.java
deleted file mode 100644
index d64db1f0a6..0000000000
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_LightningRod.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.XSTR;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-
-public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMachineBlock {
- public GT_MetaTileEntity_LightningRod(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Generates EU From Lightning Bolts");
- }
-
- public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return null;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_LightningRod(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- World aWorld = aBaseMetaTileEntity.getWorld();
- XSTR aXSTR = new XSTR();
- if (!aWorld.isRemote) {
- if (aTick % 256 == 0 && (aWorld.isThundering() || (aWorld.isRaining() && aXSTR.nextInt(10) == 0))) {
- int aRodValue = 0;
- boolean isRodValid = true;
- int aX = aBaseMetaTileEntity.getXCoord();
- int aY = aBaseMetaTileEntity.getYCoord();
- int aZ = aBaseMetaTileEntity.getZCoord();
-
- for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight()-1; i++) {
- if (isRodValid && aBaseMetaTileEntity.getBlock(aX, i, aZ).getUnlocalizedName().equals("blockFenceIron")) {
- aRodValue++;
- } else {
- isRodValid = false;
- if (aBaseMetaTileEntity.getBlock(aX, i, aZ) != Blocks.air) {
- aRodValue=0;
- break;
- }
- }
- }
- if (!aWorld.isThundering() && ((aY + aRodValue) < 128)) aRodValue = 0;
- if (aXSTR.nextInt(4 * aWorld.getHeight()) < (aRodValue * (aY + aRodValue))) {
- aBaseMetaTileEntity.setActive(true);
- aBaseMetaTileEntity.increaseStoredEnergyUnits(maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false);
- aWorld.addWeatherEffect(new EntityLightningBolt(aWorld, aX, aY + aRodValue, aZ));
- aBaseMetaTileEntity.setActive(false);
- }
- }
- }
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isOutputFacing(byte aSide) {
- return true;
- }
-
- @Override
- public boolean isEnetOutput() {
- return true;
- }
-
- @Override
- public boolean isEnetInput() {
- return false;
- }
-
- @Override
- public long maxEUStore() {
- return 25000000;
- }
-
- @Override
- public long maxEUOutput() {
- return 8192;
- }
-
- @Override
- public long maxAmperesOut() {
- return 1;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- }
-} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java
index f6b4d6c91b..2ca0350988 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java
@@ -41,6 +41,9 @@ import static gregtech.api.enums.GT_Values.V;
public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
public static boolean sInterDimensionalTeleportAllowed = true;
+ public static int sPassiveEnergyDrain = 2048;
+ public static int sPowerMultiplyer = 100;
+ public static double sFPowerMultiplyer = 1.0;
public int mTargetX = 0;
public int mTargetY = 0;
public int mTargetZ = 0;
@@ -193,6 +196,9 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
public void onConfigLoad(GT_Config aConfig) {
sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true);
+ sPassiveEnergyDrain = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PassiveDrain", sPassiveEnergyDrain);
+ sPowerMultiplyer = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PowerMultipler", sPowerMultiplyer);
+ sFPowerMultiplyer = sPowerMultiplyer / 100.0;
}
public void onFirstTick() {
@@ -239,7 +245,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
this.hasEgg = checkForEgg();
}
if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
- if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) {
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(sPassiveEnergyDrain, false)) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) {
mFluid.amount--;
if (mFluid.amount < 1) {
@@ -261,7 +267,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
int tStacksize = mInventory[0].stackSize;
GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize))), false);
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) * sFPowerMultiplyer), false);
}
}
@@ -269,8 +275,8 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) {
if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) {
Entity tEntity = (Entity) tObject;
- System.out.println("teleport"+(Math.pow(tDistance, 1.5)));
- if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity)), false)) {
+// System.out.println("teleport"+(Math.pow(tDistance, 1.5)));
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), false)) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) {
mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192)));
if (mFluid.amount < 1) {