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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.ITEM_OUT_SIGN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import gregtech.GTMod;
import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GTUIInfos;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.objects.GTRenderedTexture;
import gregtech.api.render.TextureFactory;
import gtPlusPlus.core.lib.GTPPCore;
public class MTEHatchSteamBusOutput extends MTEHatch {
public MTEHatchSteamBusOutput(int aID, String aName, String aNameRegional, int aTier) {
super(
aID,
aName,
aNameRegional,
aTier,
4,
new String[] { "Item Output for Steam Multiblocks", "Does not automatically export items",
"Capacity: 4 stacks", "Does not work with non-steam multiblocks", GTPPCore.GT_Tooltip.get() });
}
public MTEHatchSteamBusOutput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 4, aDescription, aTextures);
}
public MTEHatchSteamBusOutput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 4, aDescription, aTextures);
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return GTMod.gregtechproxy.mRenderIndicatorsOnHatch
? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }
: new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return GTMod.gregtechproxy.mRenderIndicatorsOnHatch
? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) }
: new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) };
}
@Override
public boolean isSimpleMachine() {
return true;
}
@Override
public boolean isFacingValid(ForgeDirection facing) {
return true;
}
@Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}
@Override
public boolean isValidSlot(int aIndex) {
return true;
}
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new MTEHatchSteamBusOutput(mName, mTier, mDescriptionArray, mTextures);
}
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
return true;
}
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
return side == aBaseMetaTileEntity.getFrontFacing();
}
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
return false;
}
@Override
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[14][17][];
for (byte c = -1; c < 16; c++) {
if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c);
if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c);
if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c);
if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c);
if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c);
if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c);
if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c);
if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c);
if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c);
if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c);
if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c);
if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c);
if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c);
}
return rTextures;
}
public ITexture[] getSideFacingActive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) };
}
public ITexture[] getSideFacingInactive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) };
}
public ITexture[] getFrontFacingActive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) };
}
public ITexture[] getFrontFacingInactive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) };
}
public ITexture[] getTopFacingActive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) };
}
public ITexture[] getTopFacingInactive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) };
}
public ITexture[] getBottomFacingActive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) };
}
public ITexture[] getBottomFacingInactive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) };
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM),
new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
return new ITexture[] { new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM),
new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
return new ITexture[] {
new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP),
new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
return new ITexture[] {
new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP),
new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
return new ITexture[] {
new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE),
new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
return new ITexture[] {
new GTRenderedTexture(
mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE),
new GTRenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) };
}
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
getBaseMetaTileEntity().add2by2Slots(builder);
}
}
|