1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
package tectech.thing.metaTileEntity.hatch;
import static net.minecraft.util.StatCollector.translateToLocal;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import tectech.mechanics.dataTransport.QuantumDataPacket;
import tectech.mechanics.pipe.IConnectsToDataPipe;
import tectech.util.CommonValues;
import tectech.util.TTUtility;
/**
* Created by danie_000 on 27.10.2016.
*/
public class MTEHatchDataInput extends MTEHatchDataConnector<QuantumDataPacket> {
private boolean delDelay = true;
public MTEHatchDataInput(int aID, String aName, String aNameRegional, int aTier) {
super(
aID,
aName,
aNameRegional,
aTier,
new String[] { CommonValues.TEC_MARK_EM, translateToLocal("gt.blockmachines.hatch.datain.desc.0"),
translateToLocal("gt.blockmachines.hatch.datain.desc.1"),
EnumChatFormatting.AQUA + translateToLocal("gt.blockmachines.hatch.datain.desc.2") });
TTUtility.setTier(aTier, this);
}
public MTEHatchDataInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new MTEHatchDataInput(mName, mTier, mDescriptionArray, mTextures);
}
@Override
protected QuantumDataPacket loadPacketFromNBT(NBTTagCompound nbt) {
return new QuantumDataPacket(nbt);
}
@Override
public boolean isInputFacing(ForgeDirection side) {
return side == getBaseMetaTileEntity().getFrontFacing();
}
@Override
public boolean isDataInputFacing(ForgeDirection side) {
return isInputFacing(side);
}
@Override
public boolean isOutputFacing(ForgeDirection side) {
return false;
}
@Override
public boolean isSimpleMachine() {
return true;
}
@Override
public boolean canConnectData(ForgeDirection side) {
return isInputFacing(side);
}
@Override
public IConnectsToDataPipe getNext(IConnectsToDataPipe source) {
return null;
}
public void setContents(QuantumDataPacket qIn) {
if (qIn == null) {
this.q = null;
} else {
if (qIn.getContent() > 0) {
this.q = qIn;
delDelay = true;
} else {
this.q = null;
}
}
}
@Override
public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) {
if (delDelay) {
delDelay = false;
} else {
setContents(null);
}
}
}
|