aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java
blob: 28c5c82c91a1c4a740443101a749e2262aee883c (plain)
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
package gregtech.common.tileentities.machines.multi.purification;

import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
import static gregtech.api.enums.GTValues.AuthorNotAPenguin;
import static gregtech.api.enums.HatchElement.InputHatch;
import static gregtech.api.enums.HatchElement.OutputHatch;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
import static gregtech.api.util.GTStructureUtility.ofFrame;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;

import org.jetbrains.annotations.NotNull;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;

import gregtech.api.GregTechAPI;
import gregtech.api.enums.Materials;
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
import gregtech.api.enums.TierEU;
import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GTStructureUtility;
import gregtech.api.util.GTUtility;
import gregtech.api.util.IGTHatchAdder;
import gregtech.api.util.MultiblockTooltipBuilder;

public class MTEPurificationUnitUVTreatment extends MTEPurificationUnitBase<MTEPurificationUnitUVTreatment>
    implements ISurvivalConstructable {

    private static final int CASING_INDEX_MAIN = getTextureIndex(GregTechAPI.sBlockCasings9, 12);

    private static final String STRUCTURE_PIECE_MAIN = "main";
    private static final int STRUCTURE_X_OFFSET = 6;
    private static final int STRUCTURE_Y_OFFSET = 8;
    private static final int STRUCTURE_Z_OFFSET = 0;

    private MTEHatchLensHousing lensInputBus;
    private MTEHatchLensIndicator lensIndicator;

    private UVTreatmentLensCycle lensCycle = null;

    /**
     * Bonus chance to success for each lens swap
     */
    public static final float SUCCESS_PER_LENS = 10.0f;

    /**
     * Maximum amount of ticks between two lens swaps
     */
    public static final int MAX_TIME_BETWEEN_SWAPS = MTEPurificationPlant.CYCLE_TIME_TICKS / 8;
    /**
     * Minimum amount of time between two lens swaps
     */
    public static final int MIN_TIME_BETWEEN_SWAPS = MAX_TIME_BETWEEN_SWAPS / 4;

    public static final ArrayList<ItemStack> LENS_ITEMS = new ArrayList<>();

    private int numSwapsPerformed = 0;
    private int timeUntilNextSwap = 0;

    private boolean removedTooEarly = false;

    private static final String[][] structure = new String[][] {
        // spotless:off
        { "             ", "     DDD     ", "             ", "             ", "             ", "             ", "             ", "     DDD     ", "     H~H     " },
        { "     AAA     ", "   DDAAADD   ", "     BBB     ", "     BBB     ", "     BBB     ", "     BBB     ", "     BBB     ", "   DDBBBDD   ", "   AAAAAAA   " },
        { "   AAAAAAA   ", " DDAACCCAADD ", "   BB   BB   ", "   BB   BB   ", "   BB   BB   ", "   BB   BB   ", "   BB   BB   ", " DDBB   BBDD ", " AAAAAAAAAAA " },
        { " AAAAAAAAAAA ", "DAACCCCCCCAAD", " BB       BB ", " BB       BB ", " BB       BB ", " BB       BB ", " BB       BB ", "DBB       BBD", "HAAAAAAAAAAAH" },
        { " AAAAALAAAAA ", "DACCCCCCCCCAD", " B         B ", " B         B ", " B         B ", " B         B ", " B         B ", "DB         BD", "HAAAAAAAAAAAH" },
        { " AAAAAAAAAAA ", "DAACCCCCCCAAD", " BB       BB ", " BB       BB ", " BB       BB ", " BB       BB ", " BB       BB ", "DBB       BBD", "HAAAAAAAAAAAH" },
        { "   AAAAAAA   ", " DDAACCCAADD ", "   BB   BB   ", "   BB   BB   ", "   BB   BB   ", "   BB   BB   ", "   BB   BB   ", " DDBB   BBDD ", " AAAAAAAAAAA " },
        { "     AIA     ", "   DDAAADD   ", "     BBB     ", "     BBB     ", "     BBB     ", "     BBB     ", "     BBB     ", "   DDBBBDD   ", "   AAAAAAA   " },
        { "             ", "     DDD     ", "             ", "             ", "             ", "             ", "             ", "     DDD     ", "     HHH     " } };
        // spotless:on

    private static final IStructureDefinition<MTEPurificationUnitUVTreatment> STRUCTURE_DEFINITION = StructureDefinition
        .<MTEPurificationUnitUVTreatment>builder()
        .addShape(STRUCTURE_PIECE_MAIN, structure)
        // Naquadria-Reinforced Water Plant Casing
        .addElement('A', ofBlock(GregTechAPI.sBlockCasings9, 12))
        // Neutronium-Coated UV-Resistant Glass
        .addElement('B', ofBlock(GregTechAPI.sBlockGlass1, 1))
        // UV Backlight sterilizer casing
        .addElement('C', ofBlock(GregTechAPI.sBlockCasings9, 13))
        .addElement('D', ofFrame(Materials.StellarAlloy))
        // Lens housing bus
        .addElement(
            'L',
            lazy(
                t -> GTStructureUtility.<MTEPurificationUnitUVTreatment>buildHatchAdder()
                    .atLeast(SpecialHatchElement.LensHousing)
                    .dot(2)
                    .cacheHint(() -> "Lens Housing")
                    .casingIndex(CASING_INDEX_MAIN)
                    .build()))
        // Lens indicator hatch
        .addElement(
            'I',
            lazy(
                t -> GTStructureUtility.<MTEPurificationUnitUVTreatment>buildHatchAdder()
                    .atLeast(SpecialHatchElement.LensIndicator)
                    .dot(3)
                    .cacheHint(() -> "Lens Indicator")
                    .casingIndex(CASING_INDEX_MAIN)
                    .build()))
        // Input or output hatch
        .addElement(
            'H',
            ofChain(
                lazy(
                    t -> GTStructureUtility.<MTEPurificationUnitUVTreatment>buildHatchAdder()
                        .atLeastList(Arrays.asList(InputHatch, OutputHatch))
                        .dot(1)
                        .cacheHint(() -> "Input Hatch, Output Hatch")
                        .casingIndex(CASING_INDEX_MAIN)
                        .build()),
                // Naquadria-reinforced Water Plant Casing
                ofBlock(GregTechAPI.sBlockCasings9, 12)))
        .build();

    public MTEPurificationUnitUVTreatment(int aID, String aName, String aNameRegional) {
        super(aID, aName, aNameRegional);
    }

    public MTEPurificationUnitUVTreatment(String aName) {
        super(aName);
    }

    @Override
    public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
        return new MTEPurificationUnitUVTreatment(this.mName);
    }

    @Override
    public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
        int colorIndex, boolean active, boolean redstoneLevel) {
        if (side == facing) {
            if (active) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX_MAIN),
                TextureFactory.builder()
                    .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE)
                    .extFacing()
                    .build(),
                TextureFactory.builder()
                    .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW)
                    .extFacing()
                    .glow()
                    .build() };
            return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX_MAIN),
                TextureFactory.builder()
                    .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR)
                    .extFacing()
                    .build(),
                TextureFactory.builder()
                    .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW)
                    .extFacing()
                    .glow()
                    .build() };
        }
        return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX_MAIN) };
    }

    @Override
    public void construct(ItemStack stackSize, boolean hintsOnly) {
        buildPiece(
            STRUCTURE_PIECE_MAIN,
            stackSize,
            hintsOnly,
            STRUCTURE_X_OFFSET,
            STRUCTURE_Y_OFFSET,
            STRUCTURE_Z_OFFSET);
    }

    @Override
    public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
        return survivialBuildPiece(
            STRUCTURE_PIECE_MAIN,
            stackSize,
            STRUCTURE_X_OFFSET,
            STRUCTURE_Y_OFFSET,
            STRUCTURE_Z_OFFSET,
            elementBudget,
            env,
            true);
    }

    @Override
    public IStructureDefinition<MTEPurificationUnitUVTreatment> getStructureDefinition() {
        return STRUCTURE_DEFINITION;
    }

    @Override
    protected MultiblockTooltipBuilder createTooltip() {
        MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
        tt.addMachineType("Purification Unit");
        tt.addInfo(
            EnumChatFormatting.AQUA + ""
                + EnumChatFormatting.BOLD
                + "Water Tier: "
                + EnumChatFormatting.WHITE
                + GTUtility.formatNumbers(getWaterTier())
                + EnumChatFormatting.RESET)
            .addInfo("Must be linked to a Purification Plant using a data stick to work.")
            .addSeparator()
            .addInfo(
                "During operation, swap the lens in the " + EnumChatFormatting.WHITE
                    + "Lens Housing"
                    + EnumChatFormatting.GRAY
                    + ".")
            .addInfo(
                "The multiblock will output a signal through the " + EnumChatFormatting.WHITE + "Lens Indicator Hatch")
            .addInfo("when the current lens must be swapped.")
            .addInfo(
                "Lens swaps will be requested in random intervals of " + EnumChatFormatting.RED
                    + (MIN_TIME_BETWEEN_SWAPS / SECONDS)
                    + " to "
                    + (MAX_TIME_BETWEEN_SWAPS / SECONDS)
                    + "s"
                    + EnumChatFormatting.GRAY
                    + ".")
            .addSeparator()
            .addInfo(
                "Success chance is boosted by " + EnumChatFormatting.RED
                    + SUCCESS_PER_LENS
                    + "% "
                    + EnumChatFormatting.GRAY
                    + "for each successful swap performed.")
            .addInfo("Removing a lens too early will fail the recipe.")
            .addInfo("Find the order of lenses in the recipe in NEI,")
            .addInfo("or use a portable scanner to view the currently requested lens.")
            .addInfo("The recipe always starts at the Orundum Lens.")
            .addSeparator()
            .addInfo(
                EnumChatFormatting.AQUA + ""
                    + EnumChatFormatting.ITALIC
                    + "The sixth step of water purification involves identifying any remaining negatively charged ions within")
            .addInfo(
                EnumChatFormatting.AQUA + ""
                    + EnumChatFormatting.ITALIC
                    + "the water which may cause electrical faults in future wafer manufacturing. Bombarding the water with varying")
            .addInfo(
                EnumChatFormatting.AQUA + ""
                    + EnumChatFormatting.ITALIC
                    + "wavelengths of photon beams will impart energy into outer-shell electrons, causing them to detach from the")
            .addInfo(
                EnumChatFormatting.AQUA + ""
                    + EnumChatFormatting.ITALIC
                    + "atoms themselves and pass through the walls of the tank, ensuring the water is perfectly electrically polar.")
            .beginStructureBlock(13, 9, 9, true)
            .addCasingInfoRangeColored(
                "Naquadria-Reinforced Water Plant Casing",
                EnumChatFormatting.GRAY,
                147,
                155,
                EnumChatFormatting.GOLD,
                false)
            .addCasingInfoExactlyColored(
                "Electron-Permeable Neutronium Coated Glass",
                EnumChatFormatting.GRAY,
                144,
                EnumChatFormatting.GOLD,
                false)
            .addCasingInfoExactlyColored(
                "High Energy Ultraviolet Emitter Casing",
                EnumChatFormatting.GRAY,
                29,
                EnumChatFormatting.GOLD,
                false)
            .addCasingInfoExactlyColored(
                "Stellar Alloy Frame Box",
                EnumChatFormatting.GRAY,
                56,
                EnumChatFormatting.GOLD,
                false)
            .addController("Front center")
            .addOtherStructurePart("Input Hatch, Output Hatch", EnumChatFormatting.GOLD + "1+", 1)
            .addOtherStructurePart("Lens Housing", EnumChatFormatting.GOLD + "1", 2)
            .addOtherStructurePart("Lens Indicator", EnumChatFormatting.GOLD + "1", 3)
            .toolTipFinisher(AuthorNotAPenguin);
        return tt;
    }

    @Override
    public RecipeMap<?> getRecipeMap() {
        return RecipeMaps.purificationUVTreatmentRecipes;
    }

    @NotNull
    @Override
    public CheckRecipeResult checkProcessing() {
        CheckRecipeResult result = super.checkProcessing();
        if (result.wasSuccessful()) {
            this.lensCycle = new UVTreatmentLensCycle(LENS_ITEMS);
        }
        return result;
    }

    private int generateNextSwapTime() {
        ThreadLocalRandom random = ThreadLocalRandom.current();
        return random.nextInt(MIN_TIME_BETWEEN_SWAPS, MAX_TIME_BETWEEN_SWAPS);
    }

    @Override
    public void startCycle(int cycleTime, int progressTime) {
        super.startCycle(cycleTime, progressTime);
        // Reset internal state
        this.timeUntilNextSwap = 0;
        this.numSwapsPerformed = 0;
        this.lensCycle.reset();
        this.removedTooEarly = false;
    }

    private ItemStack getCurrentlyInsertedLens() {
        return this.lensInputBus.getStackInSlot(0);
    }

    @Override
    protected void runMachine(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
        super.runMachine(aBaseMetaTileEntity, aTick);

        // Do no processing if no recipe is running
        if (mMaxProgresstime <= 0) return;

        // This can happen because the lens cycle isn't saved to NBT correctly yet, FIXME
        if (this.lensCycle == null) {
            // FIXME: Properly save current recipe in NBT instead of exiting early
            return;
        }

        ItemStack currentLens = getCurrentlyInsertedLens();

        // If we are currently counting down to a next swap, do so
        if (timeUntilNextSwap > 0) {
            timeUntilNextSwap -= 1;
            // Set the indicator to not output a signal for now
            lensIndicator.updateRedstoneOutput(false);

            // If we are counting down to the next swap, and there is no correct lens in the bus, we removed a lens
            // too early
            if (currentLens == null || !currentLens.isItemEqual(lensCycle.current())) {
                removedTooEarly = true;
            }

            // If the time until the next swap became zero, move on to the next requested lens
            if (timeUntilNextSwap == 0) {
                boolean advanced = lensCycle.advance();
                if (!advanced) {
                    // cycle didn't advance, we arrived at the end. This mainly means we want to stop the cycle
                    // The easiest way to do this is by setting the time until next swap larger than the recipe time
                    timeUntilNextSwap = mMaxProgresstime + 1;
                }
            }
        }

        // Time until next swap is zero, this means we are waiting for the user to output a lens.
        else if (timeUntilNextSwap == 0) {
            // Set the indicator to output a signal
            lensIndicator.updateRedstoneOutput(true);

            // If we now have a matching lens, we can accept it and move on to the next swap
            if (currentLens != null && currentLens.isItemEqual(lensCycle.current())) {
                numSwapsPerformed += 1;
                timeUntilNextSwap = generateNextSwapTime();
            }
        }
    }

    @Override
    public boolean isCorrectMachinePart(ItemStack aStack) {
        return true;
    }

    @Override
    public int getWaterTier() {
        return 6;
    }

    @Override
    public long getBasePowerUsage() {
        return TierEU.RECIPE_UV;
    }

    @Override
    public float calculateFinalSuccessChance() {
        if (removedTooEarly) return 0.0f;
        return numSwapsPerformed * SUCCESS_PER_LENS + currentRecipeChance;
    }

    @Override
    public String[] getInfoData() {
        ArrayList<String> infoData = new ArrayList<>(Arrays.asList(super.getInfoData()));
        if (this.lensCycle != null) {
            infoData.add("Lens swaps performed this run: " + EnumChatFormatting.YELLOW + numSwapsPerformed);
            infoData.add(
                "Current lens requested: " + EnumChatFormatting.GREEN
                    + lensCycle.current()
                        .getDisplayName());
            if (removedTooEarly) {
                infoData.add("Removed lens too early. Failing this recipe.");
            }
        }
        return infoData.toArray(new String[] {});
    }

    @Override
    public void saveNBTData(NBTTagCompound aNBT) {
        super.saveNBTData(aNBT);
        aNBT.setInteger("numSwapsPerformed", numSwapsPerformed);
        aNBT.setInteger("timeUntilNextSwap", timeUntilNextSwap);
    }

    @Override
    public void loadNBTData(NBTTagCompound aNBT) {
        super.loadNBTData(aNBT);
        numSwapsPerformed = aNBT.getInteger("numSwapsPerformed");
        timeUntilNextSwap = aNBT.getInteger("timeUntilNextSwap");
    }

    public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
        if (!checkPiece(STRUCTURE_PIECE_MAIN, STRUCTURE_X_OFFSET, STRUCTURE_Y_OFFSET, STRUCTURE_Z_OFFSET)) return false;
        // Do not form without lens bus
        if (lensInputBus == null) return false;
        return super.checkMachine(aBaseMetaTileEntity, aStack);
    }

    public boolean addLensHousingToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
        if (aTileEntity == null) return false;
        IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
        if (aMetaTileEntity instanceof MTEHatchLensHousing) {
            ((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
            this.lensInputBus = (MTEHatchLensHousing) aMetaTileEntity;
            return true;
        }
        return false;
    }

    public boolean addLensIndicatorToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
        if (aTileEntity == null) return false;
        IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
        if (aMetaTileEntity instanceof MTEHatchLensIndicator) {
            ((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
            this.lensIndicator = (MTEHatchLensIndicator) aMetaTileEntity;
            lensIndicator.updateRedstoneOutput(false);
            return true;
        }
        return false;
    }

    private enum SpecialHatchElement implements IHatchElement<MTEPurificationUnitUVTreatment> {

        LensHousing(MTEPurificationUnitUVTreatment::addLensHousingToMachineList, MTEHatchLensHousing.class) {

            @Override
            public long count(MTEPurificationUnitUVTreatment gtMetaTileEntityPurificationUnitUVTreatment) {
                if (gtMetaTileEntityPurificationUnitUVTreatment.lensInputBus == null) return 0;
                else return 1;
            }
        },

        LensIndicator(MTEPurificationUnitUVTreatment::addLensIndicatorToMachineList, MTEHatchLensIndicator.class) {

            @Override
            public long count(MTEPurificationUnitUVTreatment gtMetaTileEntityPurificationUnitUVTreatment) {
                if (gtMetaTileEntityPurificationUnitUVTreatment.lensIndicator == null) return 0;
                else return 1;
            }
        };

        private final List<Class<? extends IMetaTileEntity>> mteClasses;
        private final IGTHatchAdder<MTEPurificationUnitUVTreatment> adder;

        @SafeVarargs
        SpecialHatchElement(IGTHatchAdder<MTEPurificationUnitUVTreatment> adder,
            Class<? extends IMetaTileEntity>... mteClasses) {
            this.mteClasses = Collections.unmodifiableList(Arrays.asList(mteClasses));
            this.adder = adder;
        }

        @Override
        public List<? extends Class<? extends IMetaTileEntity>> mteClasses() {
            return mteClasses;
        }

        public IGTHatchAdder<? super MTEPurificationUnitUVTreatment> adder() {
            return adder;
        }
    }

    @Override
    protected SoundResource getActivitySoundLoop() {
        return SoundResource.IC2_MACHINES_MAGNETIZER_LOOP;
    }
}