GT Teleporter be Interdimentional with Block of Neutronium
This commit is contained in:
Dream-Master 2016-08-20 18:23:37 +02:00
parent bc33222dfe
commit 11d2e6a516

View file

@ -44,7 +44,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
public int mTargetZ = 0;
public int mTargetD = 0;
public boolean mDebug = false;
public boolean hasEgg = false;
public boolean hasBlock = false;
public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 3, "Teleport long distances with this little device.");
@ -136,7 +136,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
this.hasEgg = checkForEgg();
this.hasBlock = checkForBlock();
aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@ -201,15 +201,15 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
this.mTargetZ = getBaseMetaTileEntity().getZCoord();
this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId;
}
this.hasEgg = checkForEgg();
this.hasBlock = checkForBlock();
}
}
public boolean checkForEgg() {
public boolean checkForBlock() {
for (byte i = -5; i <= 5; i = (byte) (i + 1)) {
for (byte j = -5; j <= 5; j = (byte) (j + 1)) {
for (byte k = -5; k <= 5; k = (byte) (k + 1)) {
if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) {
if (getBaseMetaTileEntity().getBlock(i, j, k).getUnlocalizedName() == "gt.blockmetal5.2.name") {
return true;
}
}
@ -219,7 +219,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
}
public boolean hasDimensionalTeleportCapability() {
return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000);
return (this.mDebug) || (this.hasBlock) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000);
}
public boolean isDimensionalTeleportAvailable() {
@ -234,11 +234,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (getBaseMetaTileEntity().isServerSide()) {
if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
this.hasEgg = checkForEgg();
this.hasBlock = checkForBlock();
}
if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) {
mFluid.amount--;
if (mFluid.amount < 1) {
mFluid = null;
@ -268,7 +268,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) {
Entity tEntity = (Entity) tObject;
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (tDistance * tDistance * weightCalculation(tEntity)), false)) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) {
mFluid.amount = mFluid.amount - ((int) Math.min(1000, (tDistance * tDistance * weightCalculation(tEntity) / 8192)));
if (mFluid.amount < 1) {
mFluid = null;