aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-05-23 00:11:00 +0200
committerGitHub <noreply@github.com>2021-05-23 00:11:00 +0200
commit7fa6200006e99eac6f33a884672cbc79524a2609 (patch)
tree2738ab883aea0867694101df29002a08f3c67256 /src/main/java/gregtech/api
parent85356852b644c42b932e2b4852cefb06ffd22673 (diff)
parent1fd4f8b1daaa3a1eea153bf5b9e314ae0e38c724 (diff)
downloadGT5-Unofficial-7fa6200006e99eac6f33a884672cbc79524a2609.tar.gz
GT5-Unofficial-7fa6200006e99eac6f33a884672cbc79524a2609.tar.bz2
GT5-Unofficial-7fa6200006e99eac6f33a884672cbc79524a2609.zip
Merge pull request #521 from GTNewHorizons/glow-texture
Glowing textures
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java518
-rw-r--r--src/main/java/gregtech/api/interfaces/IBlockContainer.java8
-rw-r--r--src/main/java/gregtech/api/interfaces/ITexture.java32
-rw-r--r--src/main/java/gregtech/api/interfaces/ITextureBuilder.java72
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java1
-rw-r--r--src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java43
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java391
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java155
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java43
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java38
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java54
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java45
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java34
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java18
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java43
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java8
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java17
-rw-r--r--src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java5
-rw-r--r--src/main/java/gregtech/api/objects/GT_MultiTexture.java8
-rw-r--r--src/main/java/gregtech/api/objects/GT_RenderedTexture.java1
-rw-r--r--src/main/java/gregtech/api/objects/GT_SidedTexture.java4
-rw-r--r--src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java2
-rw-r--r--src/main/java/gregtech/api/render/TextureFactory.java126
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java42
29 files changed, 1128 insertions, 635 deletions
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index b2afa4216e..8cb3547768 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -3,9 +3,7 @@ package gregtech.api.enums;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.GT_SidedTexture;
-import gregtech.api.objects.GT_StdRenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
@@ -45,16 +43,20 @@ public class Textures {
MACHINE_MAXV_BOTTOM,
OVERLAY_SCHEST,
+ OVERLAY_SCHEST_GLOW,
OVERLAY_STANK,
-
+ OVERLAY_STANK_GLOW,
+
OVERLAY_PIPELINE_FLUID_BACK,
OVERLAY_PIPELINE_FLUID_FRONT,
- OVERLAY_PIPELINE_FLUID_SIDE,
-
+ OVERLAY_PIPELINE_FLUID_SIDE,
+ OVERLAY_PIPELINE_FLUID_SIDE_GLOW,
+
OVERLAY_PIPELINE_ITEM_BACK,
OVERLAY_PIPELINE_ITEM_FRONT,
OVERLAY_PIPELINE_ITEM_SIDE,
-
+ OVERLAY_PIPELINE_ITEM_SIDE_GLOW,
+
LONG_DISTANCE_PIPE_FLUID,
LONG_DISTANCE_PIPE_ITEM,
@@ -88,8 +90,9 @@ public class Textures {
OVERLAY_ENERGY_IN_POWER,
OVERLAY_ENERGY_OUT_POWER,
OVERLAY_AUTOMAINTENANCE,
+ OVERLAY_AUTOMAINTENANCE_GLOW,
OVERLAY_AUTOMAINTENANCE_IDLE,
- OVERLAY_TELEPORTER_SIDES,
+ OVERLAY_AUTOMAINTENANCE_IDLE_GLOW,
//
VOID // The Empty Texture
@@ -124,16 +127,26 @@ public class Textures {
VENT_ADVANCED,
COVER_WOOD_PLATE,
ARROW_UP,
+ ARROW_UP_GLOW,
ARROW_DOWN,
+ ARROW_DOWN_GLOW,
ARROW_LEFT,
+ ARROW_LEFT_GLOW,
ARROW_RIGHT,
+ ARROW_RIGHT_GLOW,
AUTOMATION_FILTER,
+ AUTOMATION_FILTER_GLOW,
AUTOMATION_TYPEFILTER,
+ AUTOMATION_TYPEFILTER_GLOW,
AUTOMATION_CHESTBUFFER,
+ AUTOMATION_CHESTBUFFER_GLOW,
AUTOMATION_SUPERBUFFER,
+ AUTOMATION_SUPERBUFFER_GLOW,
AUTOMATION_REGULATOR,
+ AUTOMATION_REGULATOR_GLOW,
AUTOMATION_ITEMDISTRIBUTOR,
+ AUTOMATION_ITEMDISTRIBUTOR_GLOW,
CONCRETE_LIGHT_STONE,
CONCRETE_LIGHT_COBBLE,
CONCRETE_LIGHT_COBBLE_MOSSY,
@@ -224,6 +237,7 @@ public class Textures {
MACHINE_BRONZEBLASTFURNACE,
MACHINE_BRONZEBLASTFURNACE_ACTIVE,
+ MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW,
MACHINE_CASING_ROBUST_TUNGSTENSTEEL,
MACHINE_CASING_CLEAN_STAINLESSSTEEL,
MACHINE_CASING_STABLE_TITANIUM,
@@ -236,13 +250,19 @@ public class Textures {
MACHINE_CASING_FUSION,
MACHINE_CASING_FUSION_GLASS,
MACHINE_CASING_FUSION_GLASS_YELLOW,
+ MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW,
MACHINE_CASING_FUSION_2,
MACHINE_CASING_MAGIC,
+ MACHINE_CASING_MAGIC_GLOW,
MACHINE_CASING_MAGIC_ACTIVE,
+ MACHINE_CASING_MAGIC_ACTIVE_GLOW,
MACHINE_CASING_MAGIC_FRONT,
+ MACHINE_CASING_MAGIC_FRONT_GLOW,
MACHINE_CASING_MAGIC_FRONT_ACTIVE,
+ MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW,
MACHINE_CASING_DRAGONEGG,
+ MACHINE_CASING_DRAGONEGG_GLOW,
MACHINE_CASING_SOLID_STEEL,
MACHINE_CASING_FROST_PROOF,
@@ -288,6 +308,7 @@ public class Textures {
MACHINE_CASING_DENSEBRICKS,
MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE,
+ MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW,
MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE,
MACHINE_COIL_KANTHAL,
@@ -304,20 +325,27 @@ public class Textures {
BOILER_FRONT,
BOILER_FRONT_ACTIVE,
+ BOILER_FRONT_ACTIVE_GLOW,
BOILER_LAVA_FRONT,
BOILER_LAVA_FRONT_ACTIVE,
+ BOILER_LAVA_FRONT_ACTIVE_GLOW,
NAQUADAH_REACTOR_SOLID_BACK,
NAQUADAH_REACTOR_SOLID_FRONT,
NAQUADAH_REACTOR_SOLID_SIDE,
NAQUADAH_REACTOR_SOLID_BOTTOM,
-
NAQUADAH_REACTOR_SOLID_TOP,
+
NAQUADAH_REACTOR_SOLID_BACK_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW,
NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW,
NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW,
NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE,
-
+ NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW,
NAQUADAH_REACTOR_SOLID_TOP_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW,
+
NAQUADAH_REACTOR_FLUID_BACK,
NAQUADAH_REACTOR_FLUID_FRONT,
NAQUADAH_REACTOR_FLUID_SIDE,
@@ -325,10 +353,15 @@ public class Textures {
NAQUADAH_REACTOR_FLUID_TOP,
NAQUADAH_REACTOR_FLUID_BACK_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_BACK_ACTIVE_GLOW,
NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE_GLOW,
NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE_GLOW,
NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE_GLOW,
NAQUADAH_REACTOR_FLUID_TOP_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_TOP_ACTIVE_GLOW,
DIESEL_GENERATOR_BACK,
DIESEL_GENERATOR_FRONT,
@@ -397,16 +430,23 @@ public class Textures {
OVERLAY_MUFFLER,
OVERLAY_CONTROLLER,
OVERLAY_ACTIVITYDETECTOR,
+ OVERLAY_ACTIVITYDETECTOR_GLOW,
OVERLAY_ENERGYDETECTOR,
OVERLAY_FLUIDDETECTOR,
OVERLAY_ITEMDETECTOR,
OVERLAY_FUSION1,
+ OVERLAY_FUSION1_GLOW,
OVERLAY_FUSION2,
+ OVERLAY_FUSION2_GLOW,
OVERLAY_FUSION3,
+ OVERLAY_FUSION3_GLOW,
OVERLAY_SCREEN,
+ OVERLAY_SCREEN_GLOW,
OVERLAY_QTANK,
+ OVERLAY_QTANK_GLOW,
OVERLAY_QCHEST,
+ OVERLAY_QCHEST_GLOW,
OVERLAY_SHUTTER,
OVERLAY_CLOSET,
@@ -425,17 +465,27 @@ public class Textures {
OVERLAY_ENERGY_IN_MULTI,
OVERLAY_ENERGY_OUT_MULTI,
OVERLAY_FRONT_LARGE_BOILER,
+ OVERLAY_FRONT_LARGE_BOILER_GLOW,
OVERLAY_FRONT_LARGE_BOILER_ACTIVE,
+ OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW,
OVERLAY_FRONT_VACUUM_FREEZER,
+ OVERLAY_FRONT_VACUUM_FREEZER_GLOW,
OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE,
+ OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW,
OVERLAY_FRONT_MULTI_SMELTER,
+ OVERLAY_FRONT_MULTI_SMELTER_GLOW,
OVERLAY_FRONT_MULTI_SMELTER_ACTIVE,
+ OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW,
OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE,
+ OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW,
OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE,
+ OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW,
OVERLAY_FRONT_IMPLOSION_COMPRESSOR,
-
+ OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW,
OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE,
+ OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW,
+
OVERLAY_TOP_POTIONBREWER,
OVERLAY_TOP_REPLICATOR,
OVERLAY_TOP_MASSFAB,
@@ -455,17 +505,25 @@ public class Textures {
OVERLAY_FRONT_REPLICATOR,
OVERLAY_FRONT_MASSFAB,
OVERLAY_FRONT_STEAM_HAMMER,
+ OVERLAY_FRONT_STEAM_HAMMER_ACTIVE,
+ OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW,
OVERLAY_FRONT_STEAM_FURNACE,
OVERLAY_FRONT_STEAM_ALLOY_SMELTER,
OVERLAY_FRONT_STEAM_MACERATOR,
+ OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE,
+ OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW,
OVERLAY_FRONT_STEAM_COMPRESSOR,
OVERLAY_FRONT_STEAM_EXTRACTOR,
OVERLAY_FRONT_DISASSEMBLER,
+ OVERLAY_FRONT_DISASSEMBLER_GLOW,
+ OVERLAY_FRONT_DISASSEMBLER_ACTIVE,
+ OVERLAY_FRONT_DISASSEMBLER_ACTIVE_GLOW,
OVERLAY_FRONT_BOXINATOR,
OVERLAY_FRONT_ROCK_BREAKER,
OVERLAY_FRONT_SCANNER,
+ OVERLAY_FRONT_SCANNER_GLOW,
OVERLAY_BOTTOM_POTIONBREWER,
OVERLAY_BOTTOM_REPLICATOR,
OVERLAY_BOTTOM_MASSFAB,
@@ -504,29 +562,38 @@ public class Textures {
OVERLAY_TOP_STEAM_FURNACE_ACTIVE,
OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE,
OVERLAY_TOP_STEAM_MACERATOR_ACTIVE,
+ OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW,
OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE,
OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE,
OVERLAY_TOP_DISASSEMBLER_ACTIVE,
+ OVERLAY_TOP_DISASSEMBLER_ACTIVE_GLOW,
OVERLAY_TOP_BOXINATOR_ACTIVE,
OVERLAY_TOP_ROCK_BREAKER_ACTIVE,
OVERLAY_TOP_SCANNER_ACTIVE,
OVERLAY_FRONT_POTIONBREWER_ACTIVE,
+ OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW,
OVERLAY_FRONT_REPLICATOR_ACTIVE,
+ OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW,
OVERLAY_FRONT_MASSFAB_ACTIVE,
- OVERLAY_FRONT_STEAM_HAMMER_ACTIVE,
+ OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW,
OVERLAY_FRONT_STEAM_FURNACE_ACTIVE,
+ OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW,
OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE,
+ OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW,
- OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE,
OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE,
+ OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW,
OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE,
- OVERLAY_FRONT_DISASSEMBLER_ACTIVE,
+ OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW,
OVERLAY_FRONT_BOXINATOR_ACTIVE,
+ OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW,
OVERLAY_FRONT_ROCK_BREAKER_ACTIVE,
+ OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW,
OVERLAY_FRONT_SCANNER_ACTIVE,
+ OVERLAY_FRONT_SCANNER_ACTIVE_GLOW,
OVERLAY_BOTTOM_POTIONBREWER_ACTIVE,
OVERLAY_BOTTOM_REPLICATOR_ACTIVE,
OVERLAY_BOTTOM_MASSFAB_ACTIVE,
@@ -560,7 +627,11 @@ public class Textures {
OVERLAY_SIDE_SCANNER_ACTIVE,
OVERLAY_ADV_PUMP,
OVERLAY_TELEPORTER,
+ OVERLAY_TELEPORTER_GLOW,
OVERLAY_TELEPORTER_ACTIVE,
+ OVERLAY_TELEPORTER_ACTIVE_GLOW,
+ OVERLAY_TELEPORTER_SIDES,
+ OVERLAY_TELEPORTER_SIDES_GLOW,
FUSIONI_1,
FUSIONI_2,
FUSIONI_3,
@@ -865,33 +936,55 @@ public class Textures {
BASALT_BRICKS_CHISELED,
BASALT_SMOOTH,
OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE,
+ OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW,
OVERLAY_FRONT_HEAT_EXCHANGER,
+ OVERLAY_FRONT_HEAT_EXCHANGER_GLOW,
OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE,
+ OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW,
OVERLAY_FRONT_PROCESSING_ARRAY,
+ OVERLAY_FRONT_PROCESSING_ARRAY_GLOW,
OVERLAY_FRONT_OIL_DRILL_ACTIVE,
+ OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW,
OVERLAY_FRONT_OIL_DRILL,
+ OVERLAY_FRONT_OIL_DRILL_GLOW,
OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE,
+ OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW,
OVERLAY_FRONT_DIESEL_ENGINE,
+ OVERLAY_FRONT_DIESEL_ENGINE_GLOW,
OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE,
+ OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW,
OVERLAY_FRONT_EXTREME_DIESEL_ENGINE,
+ OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW,
OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE,
+ OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW,
OVERLAY_FRONT_PYROLYSE_OVEN,
+ OVERLAY_FRONT_PYROLYSE_OVEN_GLOW,
OVERLAY_FRONT_OIL_CRACKER_ACTIVE,
+ OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW,
OVERLAY_FRONT_OIL_CRACKER,
+ OVERLAY_FRONT_OIL_CRACKER_GLOW,
OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE,
+ OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW,
OVERLAY_FRONT_DISTILLATION_TOWER,
+ OVERLAY_FRONT_DISTILLATION_TOWER_GLOW,
OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE,
+ OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW,
OVERLAY_FRONT_ASSEMBLY_LINE,
+ OVERLAY_FRONT_ASSEMBLY_LINE_GLOW,
OVERLAY_FRONT_ORE_DRILL_ACTIVE,
+ OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW,
OVERLAY_FRONT_ORE_DRILL,
+ OVERLAY_FRONT_ORE_DRILL_GLOW,
OVERLAY_TOP_CLEANROOM_ACTIVE,
OVERLAY_TOP_CLEANROOM,
OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR,
+ OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW,
OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE,
+ OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW,
PIPE_RESTRICTOR_UP,
PIPE_RESTRICTOR_DOWN,
@@ -914,37 +1007,37 @@ public class Textures {
/**
* Icon for Fresh CFoam
*/
- public static final ITexture[] FRESHFOAM = new ITexture[]{new GT_RenderedTexture(CFOAM_FRESH)};
+ public static final ITexture[] FRESHFOAM = {TextureFactory.of(CFOAM_FRESH)};
/**
* Icons for Hardened CFoam
* 0 = No Color
* 1 - 16 = Colors
*/
- public static final ITexture[][] HARDENEDFOAMS = new ITexture[][]{
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
+ public static final ITexture[][] HARDENEDFOAMS = {
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
+ new ITexture[]{TextureFactory.of(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
};
/**
* Machine Casings by Tier
* 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV
*/
public static final IIconContainer[]
- MACHINECASINGS_SIDE = new IIconContainer[]{
+ MACHINECASINGS_SIDE = {
MACHINE_8V_SIDE,
MACHINE_LV_SIDE,
MACHINE_MV_SIDE,
@@ -962,7 +1055,7 @@ public class Textures {
MACHINE_OPV_SIDE,
MACHINE_MAXV_SIDE,
},
- MACHINECASINGS_TOP = new IIconContainer[]{
+ MACHINECASINGS_TOP = {
MACHINE_8V_TOP,
MACHINE_LV_TOP,
MACHINE_MV_TOP,
@@ -980,7 +1073,7 @@ public class Textures {
MACHINE_OPV_TOP,
MACHINE_MAXV_TOP,
},
- MACHINECASINGS_BOTTOM = new IIconContainer[]{
+ MACHINECASINGS_BOTTOM = {
MACHINE_8V_BOTTOM,
MACHINE_LV_BOTTOM,
MACHINE_MV_BOTTOM,
@@ -998,7 +1091,7 @@ public class Textures {
MACHINE_OPV_BOTTOM,
MACHINE_MAXV_BOTTOM,
},
- GRANITES = new IIconContainer[]{
+ GRANITES = {
GRANITE_BLACK_STONE,
GRANITE_BLACK_COBBLE,
GRANITE_BLACK_COBBLE_MOSSY,
@@ -1016,7 +1109,7 @@ public class Textures {
GRANITE_RED_BRICKS_CHISELED,
GRANITE_RED_SMOOTH,
},
- CONCRETES = new IIconContainer[]{
+ CONCRETES = {
CONCRETE_DARK_STONE,
CONCRETE_DARK_COBBLE,
CONCRETE_DARK_COBBLE_MOSSY,
@@ -1034,7 +1127,7 @@ public class Textures {
CONCRETE_LIGHT_BRICKS_CHISELED,
CONCRETE_LIGHT_SMOOTH,
},
- STONES = new IIconContainer[]{
+ STONES = {
MARBLE_STONE,
MARBLE_COBBLE,
MARBLE_COBBLE_MOSSY,
@@ -1052,7 +1145,7 @@ public class Textures {
BASALT_BRICKS_CHISELED,
BASALT_SMOOTH,
},
- TURBINE = new IIconContainer[]{
+ TURBINE = {
LARGETURBINE_ST1,
LARGETURBINE_ST2,
LARGETURBINE_ST3,
@@ -1063,7 +1156,7 @@ public class Textures {
LARGETURBINE_ST8,
LARGETURBINE_ST9
},
- TURBINE_ACTIVE = new IIconContainer[]{
+ TURBINE_ACTIVE = {
LARGETURBINE_ST_ACTIVE1,
LARGETURBINE_ST_ACTIVE2,
LARGETURBINE_ST_ACTIVE3,
@@ -1074,7 +1167,7 @@ public class Textures {
LARGETURBINE_ST_ACTIVE8,
LARGETURBINE_ST_ACTIVE9
},
- TURBINE1 = new IIconContainer[]{
+ TURBINE1 = {
LARGETURBINE_SS1,
LARGETURBINE_SS2,
LARGETURBINE_SS3,
@@ -1085,7 +1178,7 @@ public class Textures {
LARGETURBINE_SS8,
LARGETURBINE_SS9
},
- TURBINE_ACTIVE1 = new IIconContainer[]{
+ TURBINE_ACTIVE1 = {
LARGETURBINE_SS_ACTIVE1,
LARGETURBINE_SS_ACTIVE2,
LARGETURBINE_SS_ACTIVE3,
@@ -1096,7 +1189,7 @@ public class Textures {
LARGETURBINE_SS_ACTIVE8,
LARGETURBINE_SS_ACTIVE9
},
- TURBINE2 = new IIconContainer[]{
+ TURBINE2 = {
LARGETURBINE_TI1,
LARGETURBINE_TI2,
LARGETURBINE_TI3,
@@ -1107,7 +1200,7 @@ public class Textures {
LARGETURBINE_TI8,
LARGETURBINE_TI9
},
- TURBINE_ACTIVE2 = new IIconContainer[]{
+ TURBINE_ACTIVE2 = {
LARGETURBINE_TI_ACTIVE1,
LARGETURBINE_TI_ACTIVE2,
LARGETURBINE_TI_ACTIVE3,
@@ -1118,7 +1211,7 @@ public class Textures {
LARGETURBINE_TI_ACTIVE8,
LARGETURBINE_TI_ACTIVE9
},
- TURBINE3 = new IIconContainer[]{
+ TURBINE3 = {
LARGETURBINE_TU1,
LARGETURBINE_TU2,
LARGETURBINE_TU3,
@@ -1129,7 +1222,7 @@ public class Textures {
LARGETURBINE_TU8,
LARGETURBINE_TU9
},
- TURBINE_ACTIVE3 = new IIconContainer[]{
+ TURBINE_ACTIVE3 = {
LARGETURBINE_TU_ACTIVE1,
LARGETURBINE_TU_ACTIVE2,
LARGETURBINE_TU_ACTIVE3,
@@ -1140,7 +1233,7 @@ public class Textures {
LARGETURBINE_TU_ACTIVE8,
LARGETURBINE_TU_ACTIVE9
},
- CONNECTED_HULLS = new IIconContainer[]{
+ CONNECTED_HULLS = {
CONCRETE_DARK_STONE,
FUSIONI_1,
FUSIONI_2,
@@ -1167,7 +1260,7 @@ public class Textures {
FUSIONII_11,
FUSIONII_12,
},
- STORAGE_BLOCKS1 = new IIconContainer[]{
+ STORAGE_BLOCKS1 = {
BLOCK_ADAMANTIUM,
BLOCK_ALUMINIUM,
BLOCK_AMERICIUM,
@@ -1185,7 +1278,7 @@ public class Textures {
BLOCK_BLUESTEEL,
BLOCK_BRASS
},
- STORAGE_BLOCKS2 = new IIconContainer[]{
+ STORAGE_BLOCKS2 = {
BLOCK_BRONZE,
BLOCK_CAESIUM,
BLOCK_CERIUM,
@@ -1203,7 +1296,7 @@ public class Textures {
BLOCK_DYSPROSIUM,
BLOCK_ELECTRUM
},
- STORAGE_BLOCKS3 = new IIconContainer[]{
+ STORAGE_BLOCKS3 = {
BLOCK_ELECTRUMFLUX,
BLOCK_ENDERIUM,
BLOCK_ERBIUM,
@@ -1221,7 +1314,7 @@ public class Textures {
BLOCK_IRONWOOD,
BLOCK_KANTHAL
},
- STORAGE_BLOCKS4 = new IIconContainer[]{
+ STORAGE_BLOCKS4 = {
BLOCK_KNIGHTMETAL,
BLOCK_LANTHANUM,
BLOCK_LEAD,
@@ -1239,7 +1332,7 @@ public class Textures {
BLOCK_NAQUADAHENRICHED,
BLOCK_NAQUADRIA
},
- STORAGE_BLOCKS5 = new IIconContainer[]{
+ STORAGE_BLOCKS5 = {
BLOCK_NEODYMIUM,
BLOCK_NEODYMIUMMAGNETIC,
BLOCK_NEUTRONIUM,
@@ -1257,7 +1350,7 @@ public class Textures {
BLOCK_PLUTONIUM241,
BLOCK_PRASEODYMIUM
},
- STORAGE_BLOCKS6 = new IIconContainer[]{
+ STORAGE_BLOCKS6 = {
BLOCK_PROMETHIUM,
BLOCK_REDALLOY,
BLOCK_REDSTEEL,
@@ -1275,7 +1368,7 @@ public class Textures {
BLOCK_STEELMAGNETIC,
BLOCK_STERLINGSILVER
},
- STORAGE_BLOCKS7 = new IIconContainer[]{
+ STORAGE_BLOCKS7 = {
BLOCK_SUNNARIUM,
BLOCK_TANTALUM,
BLOCK_TELLURIUM,
@@ -1293,7 +1386,7 @@ public class Textures {
BLOCK_URANIUM,
BLOCK_URANIUM235
},
- STORAGE_BLOCKS8 = new IIconContainer[]{
+ STORAGE_BLOCKS8 = {
BLOCK_VANADIUM,
BLOCK_VANADIUMGALLIUM,
BLOCK_WROUGHTIRON,
@@ -1311,7 +1404,7 @@ public class Textures {
BLOCK_FIRESTONE,
BLOCK_SHADOW
},
- STORAGE_BLOCKS9 = new IIconContainer[]{
+ STORAGE_BLOCKS9 = {
BLOCK_AERCRYSTAL,
BLOCK_AMBER,
BLOCK_AMETHYST,
@@ -1329,7 +1422,7 @@ public class Textures {
BLOCK_IGNISCRYSTAL,
BLOCK_JASPER
},
- STORAGE_BLOCKS10 = new IIconContainer[]{
+ STORAGE_BLOCKS10 = {
BLOCK_LAZURITE,
BLOCK_LIGNITE,
BLOCK_MONAZITE,
@@ -1347,7 +1440,7 @@ public class Textures {
BLOCK_TANZANITE,
BLOCK_TERRACRYSTAL
},
- STORAGE_BLOCKS11 = new IIconContainer[]{
+ STORAGE_BLOCKS11 = {
BLOCK_TOPAZ,
BLOCK_VINTEUM,
BLOCK_YELLOWGARNET,
@@ -1355,136 +1448,136 @@ public class Textures {
BLOCK_CHARCOAL,
BLOCK_BLAZE
};
- public static ITexture[] HIDDEN_TEXTURE = new ITexture[]{
- new GT_StdRenderedTexture(BlockIcons.HIDDEN_FACE)
+ public static ITexture[] HIDDEN_TEXTURE = {
+ TextureFactory.builder().addIcon(HIDDEN_FACE).stdOrient().build()
};
public static ITexture[]
- ERROR_RENDERING = new ITexture[]{
- new GT_RenderedTexture(RENDERING_ERROR)
+ ERROR_RENDERING = {
+ TextureFactory.of(RENDERING_ERROR)
};
- public static ITexture[] OVERLAYS_ENERGY_IN = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
+ public static ITexture[] OVERLAYS_ENERGY_IN = {
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
};
- public static ITexture[] OVERLAYS_ENERGY_OUT = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
+ public static ITexture[] OVERLAYS_ENERGY_OUT = {
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
};
- public static ITexture[] OVERLAYS_ENERGY_IN_MULTI = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
+ public static ITexture[] OVERLAYS_ENERGY_IN_MULTI = {
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
};
- public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
+ public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI = {
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
};
- public static ITexture[] OVERLAYS_ENERGY_IN_POWER = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
+ public static ITexture[] OVERLAYS_ENERGY_IN_POWER = {
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
};
- public static ITexture[] OVERLAYS_ENERGY_OUT_POWER = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
+ public static ITexture[] OVERLAYS_ENERGY_OUT_POWER = {
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
};
- public static ITexture[] LOCKERS = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_LOCKER_000),
- new GT_RenderedTexture(OVERLAY_LOCKER_001),
- new GT_RenderedTexture(OVERLAY_LOCKER_002),
- new GT_RenderedTexture(OVERLAY_LOCKER_003),
- new GT_RenderedTexture(OVERLAY_LOCKER_004),
- new GT_RenderedTexture(OVERLAY_LOCKER_005),
- new GT_RenderedTexture(OVERLAY_LOCKER_006),
- new GT_RenderedTexture(OVERLAY_LOCKER_007),
- new GT_RenderedTexture(OVERLAY_LOCKER_008),
- new GT_RenderedTexture(OVERLAY_LOCKER_009),
- new GT_RenderedTexture(OVERLAY_LOCKER_010),
- new GT_RenderedTexture(OVERLAY_LOCKER_011),
- new GT_RenderedTexture(OVERLAY_LOCKER_012),
- new GT_RenderedTexture(OVERLAY_LOCKER_013),
+ public static ITexture[] LOCKERS = {
+ TextureFactory.of(OVERLAY_LOCKER_000),
+ TextureFactory.of(OVERLAY_LOCKER_001),
+ TextureFactory.of(OVERLAY_LOCKER_002),
+ TextureFactory.of(OVERLAY_LOCKER_003),
+ TextureFactory.of(OVERLAY_LOCKER_004),
+ TextureFactory.of(OVERLAY_LOCKER_005),
+ TextureFactory.of(OVERLAY_LOCKER_006),
+ TextureFactory.of(OVERLAY_LOCKER_007),
+ TextureFactory.of(OVERLAY_LOCKER_008),
+ TextureFactory.of(OVERLAY_LOCKER_009),
+ TextureFactory.of(OVERLAY_LOCKER_010),
+ TextureFactory.of(OVERLAY_LOCKER_011),
+ TextureFactory.of(OVERLAY_LOCKER_012),
+ TextureFactory.of(OVERLAY_LOCKER_013),
};
/**
* USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0]
@@ -1497,24 +1590,17 @@ public class Textures {
*/
public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
- public static ITexture getCasingTextureForId(int id){
- return casingTexturePages[(id>>7)&0x7f][id&0x7f];
- }
- public static void setCasingTextureForId(int id,ITexture iTexture){
- casingTexturePages[(id>>7)&0x7f][id&0x7f]=iTexture;
- }
- public static void setCasingTexture(byte page,byte index,ITexture iTexture){
- casingTexturePages[page][index]=iTexture;
- }
-
static {
for (byte i = 0; i < MACHINE_CASINGS.length; i++)
for (byte j = 0; j < MACHINE_CASINGS[i].length; j++)
- MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
- casingTexturePages[0] = CASING_BLOCKS;
+ MACHINE_CASINGS[i][j] = TextureFactory.of(
+ MACHINECASINGS_BOTTOM[i],
+ MACHINECASINGS_TOP[i],
+ MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
+ casingTexturePages[0] = new ITexture[128];
//adds some known pages, modders also can do it...
- GT_Utility.addTexturePage((byte)1);
- GT_Utility.addTexturePage((byte)8);
+ GT_Utility.addTexturePage((byte) 1);
+ GT_Utility.addTexturePage((byte) 8);
}
protected IIcon mIcon;
@@ -1523,6 +1609,18 @@ public class Textures {
GregTech_API.sGTBlockIconload.add(this);
}
+ public static ITexture getCasingTextureForId(int id) {
+ return casingTexturePages[(id >> 7) & 0x7f][id & 0x7f];
+ }
+
+ public static void setCasingTextureForId(int id, ITexture iTexture) {
+ casingTexturePages[(id >> 7) & 0x7f][id & 0x7f] = iTexture;
+ }
+
+ public static void setCasingTexture(byte page, byte index, ITexture iTexture) {
+ casingTexturePages[page][index] = iTexture;
+ }
+
@Override
public IIcon getIcon() {
return mIcon;
@@ -1534,13 +1632,13 @@ public class Textures {
}
@Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
}
@Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
}
public static class CustomIcon implements IIconContainer, Runnable {
@@ -1563,13 +1661,13 @@ public class Textures {
}
@Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName);
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
}
@Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName);
}
}
}
@@ -1623,7 +1721,7 @@ public class Textures {
TURBINE_HUGE;
public static final IIconContainer[]
- DURABILITY_BAR = new IIconContainer[]{
+ DURABILITY_BAR = {
DURABILITY_BAR_0,
DURABILITY_BAR_1,
DURABILITY_BAR_2,
@@ -1634,7 +1732,7 @@ public class Textures {
DURABILITY_BAR_7,
DURABILITY_BAR_8,
},
- ENERGY_BAR = new IIconContainer[]{
+ ENERGY_BAR = {
ENERGY_BAR_0,
ENERGY_BAR_1,
ENERGY_BAR_2,
@@ -1646,7 +1744,7 @@ public class Textures {
ENERGY_BAR_8,
};
- public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
+ public static final ITexture[] ERROR_RENDERING = {TextureFactory.of(RENDERING_ERROR)};
protected IIcon mIcon, mOverlay;
@@ -1695,14 +1793,14 @@ public class Textures {
}
@Override
- public void run() {
- mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName);
- mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY");
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
}
@Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY");
}
}
}
diff --git a/src/main/java/gregtech/api/interfaces/IBlockContainer.java b/src/main/java/gregtech/api/interfaces/IBlockContainer.java
new file mode 100644
index 0000000000..7949ae90ce
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/IBlockContainer.java
@@ -0,0 +1,8 @@
+package gregtech.api.interfaces;
+
+import net.minecraft.block.Block;
+
+public interface IBlockContainer {
+ Block getBlock();
+ byte getMeta();
+}
diff --git a/src/main/java/gregtech/api/interfaces/ITexture.java b/src/main/java/gregtech/api/interfaces/ITexture.java
index 4321cc523c..4c0b1984ca 100644
--- a/src/main/java/gregtech/api/interfaces/ITexture.java
+++ b/src/main/java/gregtech/api/interfaces/ITexture.java
@@ -2,6 +2,7 @@ package gregtech.api.interfaces;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.Tessellator;
public interface ITexture {
void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
@@ -17,4 +18,35 @@ public interface ITexture {
void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
boolean isValidTexture();
+
+ /**
+ * @return {@code true} if this texture is from the old package
+ */
+ default boolean isOldTexture() {
+ return getClass().toString().startsWith("gregtech.api.objects");
+ }
+
+ /**
+ * Will initialize the {@link Tessellator} if rendering off-world (Inventory)
+ * @param aRenderer The {@link RenderBlocks} Renderer
+ * @param aNormalX The X Normal for current Quad Face
+ * @param aNormalY The Y Normal for current Quad Face
+ * @param aNormalZ The Z Normal for current Quad Face
+ */
+ default void startDrawingQuads(RenderBlocks aRenderer, float aNormalX, float aNormalY, float aNormalZ) {
+ if (aRenderer.useInventoryTint) {
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(aNormalX, aNormalY, aNormalZ);
+ }
+ }
+
+ /**
+ * Will run the {@link Tessellator} to draw Quads if rendering off-world (Inventory)
+ * @param aRenderer The {@link RenderBlocks} Renderer
+ */
+ default void draw(RenderBlocks aRenderer) {
+ if (aRenderer.useInventoryTint) {
+ Tessellator.instance.draw();
+ }
+ }
}
diff --git a/src/main/java/gregtech/api/interfaces/ITextureBuilder.java b/src/main/java/gregtech/api/interfaces/ITextureBuilder.java
new file mode 100644
index 0000000000..8a4d715ccb
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/ITextureBuilder.java
@@ -0,0 +1,72 @@
+package gregtech.api.interfaces;
+
+import gregtech.api.render.TextureFactory;
+import net.minecraft.block.Block;
+import net.minecraftforge.common.util.ForgeDirection;
+
+/**
+ * <p>This Interface defines operations to configure and build instances of the {@link ITexture} implementations</p>
+ * <p>Use the {@link TextureFactory#builder()} method to get an instance of the {@link ITextureBuilder} implementation.</p>
+ */
+public interface ITextureBuilder {
+ /**
+ * Build the {@link ITexture}
+ *
+ * @return The built {@link ITexture}
+ */
+ ITexture build();
+
+ /**
+ * @param block The {@link Block}
+ * @param meta The meta value for the Block
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setFromBlock(final Block block, final int meta);
+
+ /**
+ * @param side <p>The {@link ForgeDirection} side providing the texture</p>
+ * <p>Default is {@link ForgeDirection#UNKNOWN} to use same side as rendered</p>
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setFromSide(final ForgeDirection side);
+
+ /**
+ * @param iconContainers The {@link IIconContainer}s to add
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder addIcon(final IIconContainer... iconContainers);
+
+ /**
+ * @param rgba The RGBA tint for this {@link ITexture}
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setRGBA(final short[] rgba);
+
+ /**
+ * @param iTextures The {@link ITexture} layers to add
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder addLayer(final ITexture... iTextures);
+
+ /**
+ * Set alpha blending
+ * @param allowAlpha to set
+ *
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder setAllowAlpha(final boolean allowAlpha);
+
+ /**
+ * Texture will render with same orientation as with vanilla blocks
+ *
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder stdOrient();
+
+ /**
+ * Texture always render with full brightness to glow in the dark
+ *
+ * @return {@link ITextureBuilder} for chaining
+ */
+ ITextureBuilder glow();
+}
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index 262eac674c..fd94349d31 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -22,7 +22,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.net.GT_Packet_TileEntity;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_StdRenderedTexture;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
diff --git a/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java b/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java
index b841528063..7ab494e551 100644
--- a/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java
+++ b/src/main/java/gregtech/api/metatileentity/examples/GT_MetaTileEntity_E_Furnace.java
@@ -1,22 +1,30 @@
package gregtech.api.metatileentity.examples;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE;
+
/**
* This Example Implementation still works, however I use something completely different in my own Code.
*/
public class GT_MetaTileEntity_E_Furnace extends GT_MetaTileEntity_BasicMachine {
public GT_MetaTileEntity_E_Furnace(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Not like using a Commodore 64", 1, 1, "E_Furnace.png", "smelting", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE));
+ super(aID, aName, aNameRegional, aTier, 1, "Not like using a Commodore 64", 1, 1, "E_Furnace.png", "smelting", TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE));
}
public GT_MetaTileEntity_E_Furnace(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
index 19b6d26237..c6da3522bc 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
@@ -17,9 +17,9 @@ import gregtech.api.interfaces.tileentity.IEnergyConnected;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_GC_Compat;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_GC_Compat;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Client;
@@ -30,7 +30,6 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.api.energy.tile.IEnergySource;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.reactor.IReactorChamber;
-
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -46,8 +45,6 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
-import appeng.api.parts.IPartHost;
-
import static gregtech.api.enums.GT_Values.VN;
public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
@@ -99,24 +96,24 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
if (!mInsulated)
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
if (aConnected) {
float tThickNess = getThickNess();
if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
if (tThickNess < 0.374F)//0.375 x1
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
if (tThickNess < 0.499F)//0.500 x2
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
if (tThickNess < 0.624F)//0.625 x4
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
if (tThickNess < 0.749F)//0.750 x8
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
if (tThickNess < 0.874F)//0.825 x12
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), TextureFactory.of(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{TextureFactory.of(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
}
@Override
@@ -147,7 +144,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public int getProgresstime() {
- return (int) mTransferredAmperage * 64;
+ return mTransferredAmperage * 64;
}
@Override
@@ -266,7 +263,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
}
else if (rfReceiver.receiveEnergy(tDirection, rfOut, true) > 0) {
if (mRestRF == 0) {
- int RFtrans = rfReceiver.receiveEnergy(tDirection, (int) rfOut, false);
+ int RFtrans = rfReceiver.receiveEnergy(tDirection, rfOut, false);
rUsedAmperes++;
mRestRF = rfOut - RFtrans;
} else {
@@ -453,11 +450,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
return true;
// RF Input Compat
- if (GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity)baseMetaTile, tDir)))
- return true;
-
-
- return false;
+ return GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir));
}
@Override
@@ -518,14 +511,14 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
EnumChatFormatting.RED+ mOverheat +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW+ mMaxOverheat + EnumChatFormatting.RESET,
"Max Load (1t):",
EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageOK) + EnumChatFormatting.RESET +" A / "+
- EnumChatFormatting.YELLOW + Long.toString(mAmperage) + EnumChatFormatting.RESET +" A",
+ EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.RESET +" A",
"Max EU/p (1t):",
EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageOK) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(mVoltage) + EnumChatFormatting.RESET +" EU",
+ EnumChatFormatting.YELLOW + mVoltage + EnumChatFormatting.RESET +" EU",
"Max Load (20t): "+
- EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageLast20OK) + EnumChatFormatting.RESET +" A",
+ EnumChatFormatting.GREEN + mTransferredAmperageLast20OK + EnumChatFormatting.RESET +" A",
"Max EU/p (20t): "+
- EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageLast20OK) + EnumChatFormatting.RESET +" EU"
+ EnumChatFormatting.GREEN + mTransferredVoltageLast20OK + EnumChatFormatting.RESET +" EU"
};
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
index 708bbf2ca8..59c1e91543 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
@@ -13,7 +13,7 @@ import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
@@ -59,7 +59,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
}
public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
- super(aID, aName, aNameRegional, 0, false);
+ super(aID, aName, aNameRegional, 0, false);
mThickNess = aThickNess;
mMaterial = aMaterial;
mCapacity = aCapacity;
@@ -98,16 +98,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- float tThickNess = getThickNess();
- if (mDisableInput == 0) return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ float tThickNess = getThickNess();
+ if (mDisableInput == 0)
+ return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
byte tMask = 0;
- byte[][] sRestrictionArray = new byte[][]{
- {2, 3, 5, 4},
- {2, 3, 4, 5},
- {1, 0, 4, 5},
- {1, 0, 4, 5},
- {1, 0, 2, 3},
- {1, 0, 2, 3}
+ byte[][] sRestrictionArray = {
+ {2, 3, 5, 4},
+ {2, 3, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 2, 3},
+ {1, 0, 2, 3}
};
if (aSide >= 0 && aSide < 6) {
for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i;
@@ -116,44 +117,67 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tMask > 3 && tMask < 12)
tMask = (byte) (tMask ^ 12);
}
- return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
- }
-
- protected static final ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) {
- if (aPipeAmount >= 9) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aPipeAmount >= 4) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.124F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.374F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.499F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.749F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.874F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
+ }
+
+ protected static ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) {
+ if (aPipeAmount >= 9)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aPipeAmount >= 4)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.124F)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.374F)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.499F)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.749F)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.874F)
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ return TextureFactory.of(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
}
protected static final ITexture getRestrictorTexture(byte aMask) {
- switch (aMask) {
- case 1: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UP);
- case 2: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DOWN);
- case 3: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UD);
- case 4: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LEFT);
- case 5: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UL);
- case 6: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DL);
- case 7: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NR);
- case 8: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_RIGHT);
- case 9: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UR);
- case 10: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DR);
- case 11: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NL);
- case 12: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LR);
- case 13: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_ND);
- case 14: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NU);
- case 15: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR);
- default: return null;
- }
+ switch (aMask) {
+ case 1:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_UP);
+ case 2:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_DOWN);
+ case 3:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_UD);
+ case 4:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_LEFT);
+ case 5:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_UL);
+ case 6:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_DL);
+ case 7:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_NR);
+ case 8:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_RIGHT);
+ case 9:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_UR);
+ case 10:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_DR);
+ case 11:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_NL);
+ case 12:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_LR);
+ case 13:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_ND);
+ case 14:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR_NU);
+ case 15:
+ return TextureFactory.of(Textures.BlockIcons.PIPE_RESTRICTOR);
+ default:
+ return null;
+ }
}
@Override
public void onValueUpdate(byte aValue) {
- mDisableInput = aValue;
+ mDisableInput = aValue;
}
@Override
@@ -193,40 +217,42 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public void saveNBTData(NBTTagCompound aNBT) {
- for (int i = 0; i < mPipeAmount; i++)
- if (mFluids[i] != null)
- aNBT.setTag("mFluid"+(i==0?"":i), mFluids[i].writeToNBT(new NBTTagCompound()));
+ for (int i = 0; i < mPipeAmount; i++)
+ if (mFluids[i] != null)
+ aNBT.setTag("mFluid" + (i == 0 ? "" : i), mFluids[i].writeToNBT(new NBTTagCompound()));
aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
if (GT_Mod.gregtechproxy.gt6Pipe) {
- aNBT.setByte("mConnections", mConnections);
- aNBT.setByte("mDisableInput", mDisableInput);
+ aNBT.setByte("mConnections", mConnections);
+ aNBT.setByte("mDisableInput", mDisableInput);
}
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
- for (int i = 0; i < mPipeAmount; i++)
- mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"+(i==0?"":i)));
+ for (int i = 0; i < mPipeAmount; i++)
+ mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid" + (i == 0 ? "" : i)));
mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
if (GT_Mod.gregtechproxy.gt6Pipe) {
- mConnections = aNBT.getByte("mConnections");
- mDisableInput = aNBT.getByte("mDisableInput");
+ mConnections = aNBT.getByte("mConnections");
+ mDisableInput = aNBT.getByte("mDisableInput");
}
}
@Override
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null) {
- int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null) {
+ int tTemperature = tFluid.getFluid().getTemperature(tFluid);
if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
- GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break;
+ GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F);
+ break;
} else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
- GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); break;
+ GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
+ break;
}
- }
- }
+ }
+ }
}
}
@@ -269,13 +295,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tTemperature > mHeatResistance) {
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
// Poof
- GT_Log.exp.println("Set Pipe to Fire due to to low heat resistance at "+aBaseMetaTileEntity.getXCoord()+ " | "+aBaseMetaTileEntity.getYCoord()+ " | "+aBaseMetaTileEntity.getZCoord()+ " DIMID: "+aBaseMetaTileEntity.getWorld().provider.dimensionId);
+ GT_Log.exp.println("Set Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() + " | " + aBaseMetaTileEntity.getYCoord() + " | " + aBaseMetaTileEntity.getZCoord() + " DIMID: " + aBaseMetaTileEntity.getWorld().provider.dimensionId);
aBaseMetaTileEntity.setToFire();
return true;
}
// Mmhmm, Fire
aBaseMetaTileEntity.setOnFire();
- GT_Log.exp.println("Set Blocks around Pipe to Fire due to to low heat resistance at "+aBaseMetaTileEntity.getXCoord()+ " | "+aBaseMetaTileEntity.getYCoord()+ " | "+aBaseMetaTileEntity.getZCoord()+ " DIMID: "+aBaseMetaTileEntity.getWorld().provider.dimensionId);
+ GT_Log.exp.println("Set Blocks around Pipe to Fire due to to low heat resistance at " + aBaseMetaTileEntity.getXCoord() + " | " + aBaseMetaTileEntity.getYCoord() + " | " + aBaseMetaTileEntity.getZCoord() + " DIMID: " + aBaseMetaTileEntity.getWorld().provider.dimensionId);
}
if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
@@ -319,9 +345,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null;
if (isConnectedAtSide(aSide) && tTank != null && (mLastReceivedFrom & (1 << aSide)) == 0 &&
- getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsFluidOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), tFluid.getFluid(), getBaseMetaTileEntity()) &&
- (gTank == null || gTank.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, gTank.getCoverIDAtSide(tSide), gTank.getCoverDataAtSide(tSide), tFluid.getFluid(), gTank)))
- {
+ getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsFluidOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), tFluid.getFluid(), getBaseMetaTileEntity()) &&
+ (gTank == null || gTank.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, gTank.getCoverIDAtSide(tSide), gTank.getCoverDataAtSide(tSide), tFluid.getFluid(), gTank))) {
if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) {
tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0));
}
@@ -335,15 +360,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
double availableCapacity = 0;
// Calculate available capacity for distribution from all tanks
- for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry: tTanks) {
+ for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry : tTanks) {
tEntry.right = tEntry.left.fill(tEntry.middle, maxFluid, false);
availableCapacity += tEntry.right;
}
// Now distribute
- for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry: tTanks) {
- if (availableCapacity > tAmount) tEntry.right = (int) Math.floor(tEntry.right * tAmount / availableCapacity); // Distribue fluids based on percentage available space at destination
- if (tEntry.right == 0) tEntry.right = (int)Math.min(1, tAmount); // If the percent is not enough to give at least 1L, try to give 1L
+ for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry : tTanks) {
+ if (availableCapacity > tAmount)
+ tEntry.right = (int) Math.floor(tEntry.right * tAmount / availableCapacity); // Distribue fluids based on percentage available space at destination
+ if (tEntry.right == 0)
+ tEntry.right = (int) Math.min(1, tAmount); // If the percent is not enough to give at least 1L, try to give 1L
if (tEntry.right <= 0) continue;
int tFilledAmount = tEntry.left.fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false);
@@ -355,31 +382,30 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Mod.gregtechproxy.gt6Pipe) {
- byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- byte tMask = (byte) (1 << tSide);
- if (aPlayer.isSneaking()) {
- if (isInputDisabledAtSide(tSide)) {
- mDisableInput &= ~tMask;
- GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
- if (!isConnectedAtSide(tSide))
- connect(tSide);
- } else {
- mDisableInput |= tMask;
- GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
- }
- } else {
- if (!isConnectedAtSide(tSide)) {
- if (connect(tSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
- }
- else {
- disconnect(tSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
- }
- }
- return true;
- }
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ byte tMask = (byte) (1 << tSide);
+ if (aPlayer.isSneaking()) {
+ if (isInputDisabledAtSide(tSide)) {
+ mDisableInput &= ~tMask;
+ GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
+ if (!isConnectedAtSide(tSide))
+ connect(tSide);
+ } else {
+ mDisableInput |= tMask;
+ GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
+ }
+ } else {
+ if (!isConnectedAtSide(tSide)) {
+ if (connect(tSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ } else {
+ disconnect(tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ }
+ }
+ return true;
+ }
return false;
}
@@ -398,7 +424,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tTileEntity == null)
return false;
- final byte tSide = (byte)ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
+ final byte tSide = (byte) ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
if (baseMetaTile == null)
return false;
@@ -419,18 +445,18 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
|| gTileEntity != null && gTileEntity.getCoverBehaviorAtSide(tSide) instanceof GT_Cover_FluidRegulator;
}
- }
+ }
return false;
}
@Optional.Method(modid = "TConstruct")
- private boolean isTConstructFaucet(TileEntity tTileEntity){
+ private boolean isTConstructFaucet(TileEntity tTileEntity) {
// Tinker Construct Faucets return a null tank info, so check the class
return tTileEntity instanceof tconstruct.smeltery.logic.FaucetLogic;
}
@Optional.Method(modid = "Translocator")
- private boolean isTranslocator(TileEntity tTileEntity){
+ private boolean isTranslocator(TileEntity tTileEntity) {
// Translocators return a TankInfo, but it's of 0 length - so check the class if we see this pattern
return tTileEntity instanceof codechicken.translocator.TileLiquidTranslocator;
}
@@ -457,9 +483,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
ForgeDirection.getOrientation(i).offsetZ / 5.0
)
.setPosition(
- aX - 0.5 + XSTR_INSTANCE.nextFloat(),
- aY - 0.5 + XSTR_INSTANCE.nextFloat(),
- aZ - 0.5 + XSTR_INSTANCE.nextFloat()
+ aX - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aY - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat()
).run()
);
}
@@ -467,16 +493,16 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public final int getCapacity() {
- return mCapacity * 20 * mPipeAmount;
+ return mCapacity * 20 * mPipeAmount;
}
@Override
public FluidTankInfo getInfo() {
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- return new FluidTankInfo(tFluid, mCapacity * 20);
- }
- return new FluidTankInfo(null, mCapacity * 20);
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ return new FluidTankInfo(tFluid, mCapacity * 20);
+ }
+ return new FluidTankInfo(null, mCapacity * 20);
}
@Override
@@ -484,7 +510,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
ArrayList<FluidTankInfo> tList = new ArrayList<>();
for (FluidStack tFluid : mFluids)
- tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
+ tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
return tList.toArray(new FluidTankInfo[mPipeAmount]);
}
@@ -500,20 +526,20 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public final FluidStack getFluid() {
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- return tFluid;
- }
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ return tFluid;
+ }
return null;
}
@Override
public final int getFluidAmount() {
- int rAmount = 0;
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- rAmount += tFluid.amount;
- }
+ int rAmount = 0;
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ rAmount += tFluid.amount;
+ }
return rAmount;
}
@@ -523,20 +549,20 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
int index = -1;
for (int i = 0; i < mPipeAmount; i++) {
- if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
- index = i; break;
- }
- else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
- index = i;
- }
- }
-
+ if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
+ index = i;
+ break;
+ } else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
+ index = i;
+ }
+ }
+
return fill_default_intoIndex(aSide, aFluid, doFill, index);
}
private final int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
- if (index < 0 || index >= mPipeAmount) return 0;
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+ if (index < 0 || index >= mPipeAmount) return 0;
+ if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
if (mFluids[index] == null || mFluids[index].getFluid().getID() <= 0) {
if (aFluid.amount * mPipeAmount <= getCapacity()) {
@@ -573,17 +599,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public final FluidStack drain(int maxDrain, boolean doDrain) {
- FluidStack drained = null;
- for (int i = 0; i < mPipeAmount; i++) {
- if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
- return drained;
- }
- return null;
+ FluidStack drained = null;
+ for (int i = 0; i < mPipeAmount; i++) {
+ if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
+ return drained;
+ }
+ return null;
}
private final FluidStack drainFromIndex(int maxDrain, boolean doDrain, int index) {
- if (index < 0 || index >= mPipeAmount) return null;
- if (mFluids[index] == null) return null;
+ if (index < 0 || index >= mPipeAmount) return null;
+ if (mFluids[index] == null) return null;
if (mFluids[index].amount <= 0) {
mFluids[index] = null;
return null;
@@ -615,12 +641,12 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public String[] getDescription() {
if (mPipeAmount == 1) {
- return new String[]{
+ return new String[]{
EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
};
} else {
- return new String[]{
+ return new String[]{
EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY
@@ -630,67 +656,86 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public float getThickNess() {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
return mThickNess;
}
@Override
public boolean isLiquidInput(byte aSide) {
- return !isInputDisabledAtSide(aSide);
+ return !isInputDisabledAtSide(aSide);
}
@Override
public boolean isLiquidOutput(byte aSide) {
- return true;
+ return true;
}
public boolean isInputDisabledAtSide(int aSide) {
- return (mDisableInput & (1 << aSide)) != 0;
+ return (mDisableInput & (1 << aSide)) != 0;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ float tSpace = (1f - mThickNess) / 2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0) {
+ tSide2 = tSide4 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide1 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0) {
+ tSide0 = tSide4 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide1 = tSide3 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0) {
+ tSide0 = tSide2 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if ((tConn & (1 << ForgeDirection.DOWN.ordinal())) != 0) tSide0 = 0f;
+ if ((tConn & (1 << ForgeDirection.UP.ordinal())) != 0) tSide1 = 1f;
+ if ((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if ((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
+ if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
}
@Override
public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
- AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
- }
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
}
+
@Override
public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
if (aFluid == null)
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
index a1f0c1ed8f..e1677b1deb 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
@@ -1,11 +1,14 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_ModHandler.RecipeBits;
@@ -47,7 +50,7 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
index d56cd9d2fa..e24aebc064 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
@@ -1,7 +1,9 @@
package gregtech.api.metatileentity.implementations;
import gregtech.GT_Mod;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.metatileentity.IMetaTileEntityItemPipe;
@@ -9,7 +11,7 @@ import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Client;
@@ -30,6 +32,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
+import static gregtech.api.enums.Textures.BlockIcons.PIPE_RESTRICTOR;
+
public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileEntityItemPipe {
public final float mThickNess;
public final Materials mMaterial;
@@ -79,34 +83,34 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
if (aConnected) {
float tThickNess = getThickNess();
if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
if (tThickNess < 0.374F)//0.375
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
if (tThickNess < 0.499F)//0.500
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
if (tThickNess < 0.749F)//0.750
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
if (tThickNess < 0.874F)//0.825
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
}
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR)};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), TextureFactory.of(PIPE_RESTRICTOR)};
}
if (aConnected) {
float tThickNess = getThickNess();
if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (tThickNess < 0.374F)//0.375
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (tThickNess < 0.499F)//0.500
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (tThickNess < 0.749F)//0.750
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (tThickNess < 0.874F)//0.825
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
}
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
}
@Override
@@ -143,14 +147,14 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
if (GT_Mod.gregtechproxy.gt6Pipe)
- aNBT.setByte("mConnections", mConnections);
+ aNBT.setByte("mConnections", mConnections);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
if (GT_Mod.gregtechproxy.gt6Pipe) {
- mConnections = aNBT.getByte("mConnections");
+ mConnections = aNBT.getByte("mConnections");
}
}
@@ -187,18 +191,17 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Mod.gregtechproxy.gt6Pipe) {
- byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- if (!isConnectedAtSide(tSide)) {
- if (connect(tSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
- }
- else {
- disconnect(tSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
- }
- return true;
- }
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ if (isConnectedAtSide(tSide)) {
+ disconnect(tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ } else {
+ if (connect(tSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ return true;
+ }
return false;
}
@@ -272,7 +275,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
TileEntity tInventory = getBaseMetaTileEntity().getTileEntityAtSide(aSide);
if (tInventory != null && !(tInventory instanceof BaseMetaPipeEntity)) {
if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser)) || getBaseMetaTileEntity().getMetaIDAtSide(aSide) != GT_Utility.getOppositeSide(aSide)) {
- return GT_Utility.moveMultipleItemStacks(aSender, tInventory, (byte) 6, GT_Utility.getOppositeSide(aSide), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,1) > 0;
+ return GT_Utility.moveMultipleItemStacks(aSender, tInventory, (byte) 6, GT_Utility.getOppositeSide(aSide), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1, 1) > 0;
}
}
}
@@ -306,7 +309,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return isConnectedAtSide(aSide) && super.canInsertItem(aIndex, aStack, aSide);
+ return isConnectedAtSide(aSide) && super.canInsertItem(aIndex, aStack, aSide);
}
@Override
@@ -334,7 +337,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (!isConnectedAtSide(aSide)) return false;
+ if (!isConnectedAtSide(aSide)) return false;
if (isInventoryEmpty()) mLastReceivedFrom = aSide;
return mLastReceivedFrom == aSide && mInventory[aIndex] == null;
}
@@ -356,51 +359,69 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public float getThickNess() {
- if(GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
return mThickNess;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ float tSpace = (1f - mThickNess) / 2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0) {
+ tSide2 = tSide4 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide1 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0) {
+ tSide0 = tSide4 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0) {
+ tSide0 = tSide2 = tSide4 = 0;
+ tSide1 = tSide3 = 1;
+ }
+ if (getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0) {
+ tSide0 = tSide2 = 0;
+ tSide1 = tSide3 = tSide5 = 1;
+ }
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if ((tConn & (1 << ForgeDirection.DOWN.ordinal())) != 0) tSide0 = 0f;
+ if ((tConn & (1 << ForgeDirection.UP.ordinal())) != 0) tSide1 = 1f;
+ if ((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if ((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
+ if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
}
@Override
public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
- AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
- }
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
index 7d79d2b93f..84bce3e7c6 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
@@ -3,14 +3,13 @@ package gregtech.api.metatileentity.implementations;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_BasicMachine;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMachineCallback;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
@@ -33,6 +32,8 @@ import java.util.Arrays;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.GT_Values.debugCleanroom;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
/**
@@ -157,7 +158,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
for (int i = 0; i < aTextures.length; i++)
if (aTextures[i] != null) for (byte c = -1; c < 16; c++) {
if (rTextures[i][c + 1] == null)
- rTextures[i][c + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
+ rTextures[i][c + 1] = new ITexture[]{MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
}
for (byte c = -1; c < 16; c++) {
@@ -786,13 +787,13 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
EnumChatFormatting.BLUE + mNEIName + EnumChatFormatting.RESET,
"Progress:",
EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
- EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s",
+ EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET +" s",
"Stored Energy:",
EnumChatFormatting.GREEN + Long.toString(getBaseMetaTileEntity().getStoredEU()) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(getBaseMetaTileEntity().getEUCapacity()) + EnumChatFormatting.RESET +" EU",
+ EnumChatFormatting.YELLOW + getBaseMetaTileEntity().getEUCapacity() + EnumChatFormatting.RESET +" EU",
"Probably uses: " +
- EnumChatFormatting.RED + Integer.toString(mEUt) + EnumChatFormatting.RESET + " EU/t at " +
- EnumChatFormatting.RED + Integer.toString(mEUt==0?0:mAmperage) + EnumChatFormatting.RESET +" A"
+ EnumChatFormatting.RED + mEUt + EnumChatFormatting.RESET + " EU/t at " +
+ EnumChatFormatting.RED + (mEUt == 0 ? 0 : mAmperage) + EnumChatFormatting.RESET +" A"
};
}
@@ -922,58 +923,58 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
}
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)};
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
index 12ae6c6044..3cdb26c9e1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
@@ -2,10 +2,9 @@ package gregtech.api.metatileentity.implementations;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
@@ -17,6 +16,13 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZE_BOTTOM;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZE_SIDE;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZE_TOP;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
/**
@@ -189,71 +195,71 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_BOTTOM : MACHINE_BRONZE_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_TOP : MACHINE_BRONZE_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_BRONZEBRICKS_SIDE : MACHINE_BRONZE_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
index 00ce4051ec..281d0f6541 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
@@ -1,14 +1,18 @@
package gregtech.api.metatileentity.implementations;
import cpw.mods.fml.common.Loader;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures.BlockIcons.CustomIcon;
+import gregtech.api.enums.Tier;
import gregtech.api.gui.GT_Container_BasicMachine;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -23,7 +27,10 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.Locale;
import java.util.Random;
-import static gregtech.api.enums.GT_Values.*;
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.VN;
+import static gregtech.api.enums.GT_Values.W;
+import static gregtech.api.enums.GT_Values.ticksBetweenSounds;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -39,19 +46,36 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
private final byte mGUIParameterA, mGUIParameterB;
public GT_MetaTileEntity_BasicMachine_GT_Recipe(
- int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes,
- int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank,
- boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes,
+ int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank,
+ boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe
) {
- super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName,
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")),
- new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")));
+ super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName,
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE_GLOW"))).glow().build()),
+ TextureFactory.of(
+ TextureFactory.of(new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")),
+ TextureFactory.builder().addIcon((new CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_GLOW"))).glow().build())
+ );
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
this.mSpecialEffect = aSpecialEffect;
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java
index 3badfae1ff..20a3758324 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java
@@ -1,9 +1,16 @@
package gregtech.api.metatileentity.implementations;
import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
+
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEEL_BOTTOM;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEEL_SIDE;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEEL_TOP;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
/**
@@ -25,12 +32,6 @@ public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEn
super(aName, aDescription, aTextures, aInputSlotCount, aOutputSlotCount, aBricked);
}
- /*
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_BasicMachine_Steel(mTier, mDescription, mTextures);
- }
- */
@Override
public float getSteamDamage() {
return 12.0F;
@@ -38,71 +39,71 @@ public abstract class GT_MetaTileEntity_BasicMachine_Steel extends GT_MetaTileEn
@Override
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE : Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE : Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE : Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE : Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_TOP : Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_TOP : Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa))};
}
@Override
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_BOTTOM : MACHINE_STEEL_BOTTOM, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_TOP : Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_TOP : Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_TOP : MACHINE_STEEL_TOP, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE : Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE : Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{TextureFactory.of(mTier == 1 ? MACHINE_STEELBRICKS_SIDE : MACHINE_STEEL_SIDE, Dyes.getModulation(aColor, Dyes._NULL.mRGBa)), TextureFactory.of(OVERLAY_PIPE_OUT)};
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
index d73db20951..7f9e21ff65 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
@@ -1,9 +1,8 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -11,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.Textures.BlockIcons.*;
public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock {
private static final int OUTPUT_INDEX = 0;
@@ -45,18 +45,26 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[ForgeDirection.VALID_DIRECTIONS.length][17][];
ITexture tIcon = getOverlayIcon();
- ITexture tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT);
- ITexture tUp = new GT_RenderedTexture(Textures.BlockIcons.ARROW_UP);
- ITexture tDown = new GT_RenderedTexture(Textures.BlockIcons.ARROW_DOWN);
- ITexture tLeft = new GT_RenderedTexture(Textures.BlockIcons.ARROW_LEFT);
- ITexture tRight = new GT_RenderedTexture(Textures.BlockIcons.ARROW_RIGHT);
+ ITexture tOut = TextureFactory.of(OVERLAY_PIPE_OUT);
+ ITexture tUp = TextureFactory.of(
+ TextureFactory.of(ARROW_UP),
+ TextureFactory.builder().addIcon(ARROW_UP_GLOW).glow().build());
+ ITexture tDown = TextureFactory.of(
+ TextureFactory.of(ARROW_DOWN),
+ TextureFactory.builder().addIcon(ARROW_DOWN_GLOW).glow().build());
+ ITexture tLeft = TextureFactory.of(
+ TextureFactory.of(ARROW_LEFT),
+ TextureFactory.builder().addIcon(ARROW_LEFT_GLOW).glow().build());
+ ITexture tRight = TextureFactory.of(
+ TextureFactory.of(ARROW_RIGHT),
+ TextureFactory.builder().addIcon(ARROW_RIGHT_GLOW).glow().build());
for (int i = 0; i < rTextures[0].length; i++) {
- rTextures[OUTPUT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tOut};
- rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tRight, tIcon};
- rTextures[ARROW_DOWN_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tDown, tIcon};
- rTextures[ARROW_LEFT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tLeft, tIcon};
- rTextures[ARROW_UP_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tUp, tIcon};
- rTextures[FRONT_INDEX][i] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i], tIcon};
+ rTextures[OUTPUT_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tOut};
+ rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tRight, tIcon};
+ rTextures[ARROW_DOWN_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tDown, tIcon};
+ rTextures[ARROW_LEFT_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tLeft, tIcon};
+ rTextures[ARROW_UP_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tUp, tIcon};
+ rTextures[FRONT_INDEX][i] = new ITexture[]{MACHINE_CASINGS[mTier][i], tIcon};
}
return rTextures;
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
index 0683f020fa..2faf113e18 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
@@ -1,6 +1,5 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_2by2;
import gregtech.api.gui.GT_Container_4by4;
import gregtech.api.gui.GT_GUIContainer_2by2;
@@ -8,11 +7,13 @@ import gregtech.api.gui.GT_GUIContainer_4by4;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DATA_ACCESS;
+
public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch {
private int timeout=4;
@@ -32,12 +33,12 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DATA_ACCESS)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_DATA_ACCESS)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DATA_ACCESS)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_DATA_ACCESS)};
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java
index 466095fc21..e37d2160a2 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java
@@ -1,16 +1,17 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN;
+
public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
public GT_Recipe_Map mRecipeMap = null;
@@ -28,12 +29,12 @@ public class GT_MetaTileEntity_Hatch_Input extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)};
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
index f2f76dca4f..c8fe305de9 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
@@ -1,11 +1,17 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.*;
+import gregtech.api.gui.GT_Container_1by1;
+import gregtech.api.gui.GT_Container_2by2;
+import gregtech.api.gui.GT_Container_3by3;
+import gregtech.api.gui.GT_Container_4by4;
+import gregtech.api.gui.GT_GUIContainer_1by1;
+import gregtech.api.gui.GT_GUIContainer_2by2;
+import gregtech.api.gui.GT_GUIContainer_3by3;
+import gregtech.api.gui.GT_GUIContainer_4by4;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
@@ -15,6 +21,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN;
+
public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch {
public GT_Recipe_Map mRecipeMap = null;
public boolean disableSort;
@@ -37,12 +45,12 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)};
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
index 2742e99816..9067f5bb7b 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
@@ -5,7 +5,6 @@ import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_2by2;
import gregtech.api.gui.GT_Container_MaintenanceHatch;
import gregtech.api.gui.GT_GUIContainer_2by2;
@@ -13,7 +12,7 @@ import gregtech.api.gui.GT_GUIContainer_MaintenanceHatch;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
@@ -24,6 +23,13 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE_IDLE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE_IDLE_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DUCTTAPE;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_MAINTENANCE;
+
public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch {
public boolean mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false, mAuto;
@@ -66,14 +72,25 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- if(mAuto)return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE_IDLE)};
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MAINTENANCE)};
+ if (mAuto) return new ITexture[]{
+ aBaseTexture,
+ TextureFactory.of(OVERLAY_AUTOMAINTENANCE_IDLE),
+ TextureFactory.builder().addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW).glow().build()};
+ return new ITexture[]{
+ aBaseTexture,
+ TextureFactory.of(OVERLAY_MAINTENANCE)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- if(mAuto)return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_AUTOMAINTENANCE)};
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MAINTENANCE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DUCTTAPE)};
+ if (mAuto) return new ITexture[]{
+ aBaseTexture,
+ TextureFactory.of(OVERLAY_AUTOMAINTENANCE),
+ TextureFactory.builder().addIcon(OVERLAY_AUTOMAINTENANCE_GLOW).glow().build()};
+ return new ITexture[]{
+ aBaseTexture,
+ TextureFactory.of(OVERLAY_MAINTENANCE),
+ TextureFactory.of(OVERLAY_DUCTTAPE)};
}
@Override
@@ -146,7 +163,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
}
public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess) {
- ItemStack[] mInputs=new ItemStack[]{ItemList.Duct_Tape.get(4, new Object[]{}),
+ ItemStack[] mInputs= {ItemList.Duct_Tape.get(4),
GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2),
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4),
GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2)};
@@ -188,12 +205,12 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
}
}
}
- this.mCrowbar = true;
- this.mHardHammer = true;
- this.mScrewdriver = true;
- this.mSoftHammer = true;
- this.mSolderingTool = true;
- this.mWrench = true;
+ mCrowbar = true;
+ mHardHammer = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mSolderingTool = true;
+ mWrench = true;
updateSlots();
}
return true;
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
index 49a28d28ff..9e59520edb 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
@@ -3,11 +3,10 @@ package gregtech.api.metatileentity.implementations;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.common.GT_Pollution;
@@ -18,6 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.Arrays;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_MUFFLER;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
@SuppressWarnings("unused") // Unused API is expected within scope
@@ -54,12 +54,12 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_MUFFLER)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_MUFFLER)};
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
index f57d0ed402..1cb80886a9 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
@@ -1,10 +1,9 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
@@ -13,7 +12,12 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+import net.minecraftforge.fluids.IFluidHandler;
+
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch {
private String lockedFluidName = null;
@@ -39,12 +43,12 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
index 57cfc44ff6..7c8efb88e0 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
@@ -1,17 +1,24 @@
package gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.*;
+import gregtech.api.gui.GT_Container_1by1;
+import gregtech.api.gui.GT_Container_2by2;
+import gregtech.api.gui.GT_Container_3by3;
+import gregtech.api.gui.GT_Container_4by4;
+import gregtech.api.gui.GT_GUIContainer_1by1;
+import gregtech.api.gui.GT_GUIContainer_2by2;
+import gregtech.api.gui.GT_GUIContainer_3by3;
+import gregtech.api.gui.GT_GUIContainer_4by4;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch {
@@ -42,12 +49,12 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch {
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)};
}
@Override
diff --git a/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java b/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java
index 184bd67556..61136c8f40 100644
--- a/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java
+++ b/src/main/java/gregtech/api/objects/GT_CopiedBlockTexture.java
@@ -5,10 +5,13 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.util.LightingHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
+/**
+ * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API.
+ */
+@Deprecated
public class GT_CopiedBlockTexture implements ITexture {
private final Block mBlock;
private final byte mSide, mMeta;
diff --git a/src/main/java/gregtech/api/objects/GT_MultiTexture.java b/src/main/java/gregtech/api/objects/GT_MultiTexture.java
index ec89a0dfa1..c7878374b4 100644
--- a/src/main/java/gregtech/api/objects/GT_MultiTexture.java
+++ b/src/main/java/gregtech/api/objects/GT_MultiTexture.java
@@ -1,14 +1,16 @@
package gregtech.api.objects;
import gregtech.api.interfaces.ITexture;
+import gregtech.api.render.TextureFactory;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
/**
- * Lets Multiple ITextures Render overlay over each other.
- * <p/>
- * I should have done this much earlier...
+ * <p>Lets Multiple ITextures Render overlay over each other.<</p>
+ * <p>I should have done this much earlier...</p>
+ * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API.
*/
+@Deprecated
public class GT_MultiTexture implements ITexture {
private final ITexture[] mTextures;
diff --git a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java
index 9a0fbf344e..12d013303c 100644
--- a/src/main/java/gregtech/api/objects/GT_RenderedTexture.java
+++ b/src/main/java/gregtech/api/objects/GT_RenderedTexture.java
@@ -11,6 +11,7 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
+@Deprecated
public class GT_RenderedTexture implements ITexture, IColorModulationContainer {
final IIconContainer mIconContainer;
final boolean mAllowAlpha;
diff --git a/src/main/java/gregtech/api/objects/GT_SidedTexture.java b/src/main/java/gregtech/api/objects/GT_SidedTexture.java
index 2242259e69..c6ed003be9 100644
--- a/src/main/java/gregtech/api/objects/GT_SidedTexture.java
+++ b/src/main/java/gregtech/api/objects/GT_SidedTexture.java
@@ -7,6 +7,10 @@ import gregtech.api.interfaces.ITexture;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
+/**
+ * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API.
+ */
+@Deprecated
public class GT_SidedTexture implements ITexture, IColorModulationContainer {
private final ITexture[] mTextures;
/**
diff --git a/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java b/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java
index 041fed4164..0dd405c792 100644
--- a/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java
+++ b/src/main/java/gregtech/api/objects/GT_StdRenderedTexture.java
@@ -12,7 +12,9 @@ import net.minecraftforge.common.util.ForgeDirection;
* to render with bottom side flipped as with dumb blocks rendering.
* It is used in Ore blocks rendering so they better blends with dumb block ores
* from vanilla or other mods, when seen from bottom.
+ * @deprecated Replaced by the {@link gregtech.api.render.TextureFactory} API.
*/
+@Deprecated
public class GT_StdRenderedTexture extends GT_RenderedTexture{
@SuppressWarnings("unused")
diff --git a/src/main/java/gregtech/api/render/TextureFactory.java b/src/main/java/gregtech/api/render/TextureFactory.java
new file mode 100644
index 0000000000..8c67cd6740
--- /dev/null
+++ b/src/main/java/gregtech/api/render/TextureFactory.java
@@ -0,0 +1,126 @@
+package gregtech.api.render;
+
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.ITextureBuilder;
+import gregtech.common.render.GT_TextureBuilder;
+import net.minecraft.block.Block;
+import net.minecraftforge.common.util.ForgeDirection;
+
+/**
+ * <p>This class contains a collection of static factory methods to access the New Texture API.</p>
+ * <p>The {@link #of} methods directly returns ready-to-use instances of {@link ITexture} implementations.</p>
+ * <p>To get more specific implementations of {@link ITexture} instances, use the {@link #builder()} method.</p>
+ * <p>Example of the {@link #builder()}:</p>
+ * <pre>{@code
+ * // Texture that glows in the dark
+ * TextureFactory.builder().addIcon(OVERLAY_FUSION1_GLOW).glow().build());
+ *
+ * // Texture with same bottom flipped orientation as vanilla
+ * TextureFactory.builder().addIcon(GRANITE_RED_STONE).stdOrient().build();
+ * }</pre>
+ * See: the {@link ITextureBuilder} interface
+ */
+@SuppressWarnings("unused")
+public final class TextureFactory {
+ private TextureFactory() {
+ throw new AssertionError("Non-instantiable class");
+ }
+
+ /**
+ * Multi-layered {@link ITexture} factory
+ *
+ * @param textures The layers of {@link ITexture} from bottom to top
+ * @return The instance of an {@link ITexture} implementation
+ */
+ public static ITexture of(final ITexture... textures) {
+ return builder().addLayer(textures).build();
+ }
+
+ /**
+ * All-Sided {@link ITexture} factory
+ *
+ * @param bottom The {@link IIconContainer} Icon for the Bottom Side.
+ * @param top The {@link IIconContainer} Icon for the Top Side.
+ * @param north The {@link IIconContainer} Icon for the North Side.
+ * @param south The {@link IIconContainer} Icon for the South Side.
+ * @param west The {@link IIconContainer} Icon for the West Side.
+ * @param east The {@link IIconContainer} Icon for the East Side.
+ * @param rgba The {@code short[]} RGBA tint for all sides.
+ * @return The instance of an {@link ITexture} implementation
+ */
+ public static ITexture of(final IIconContainer bottom, final IIconContainer top, final IIconContainer north,
+ final IIconContainer south, final IIconContainer west, final IIconContainer east,
+ final short[] rgba) {
+ return builder().addIcon(bottom, top, north, south, west, east).setRGBA(rgba).setAllowAlpha(true).build();
+ }
+
+ /**
+ * Bottom-Top-Sides-Sided {@link ITexture} factory
+ *
+ * @param bottom The {@link IIconContainer} Icon for the Bottom Side.
+ * @param top The {@link IIconContainer} Icon for the Top Side.
+ * @param sides The {@link IIconContainer} Icon for the North, South, West and East Sides.
+ * @param rgba The {@code short[]} RGBA tint for all sides.
+ * @return The instance of an {@link ITexture} implementation
+ */
+ public static ITexture of(final IIconContainer bottom, final IIconContainer top, final IIconContainer sides,
+ final short[] rgba) {
+ return builder().addIcon(bottom, top, sides, sides, sides, sides).setRGBA(rgba).setAllowAlpha(true).build();
+ }
+
+ /**
+ * Rendered {@link ITexture} factory
+ *
+ * @param iconContainer The {@link IIconContainer} to render
+ * @param rgba The {@code short[]} RGBA tint for the texture.
+ * @param allowAlpha Determine if texture will use alpha blending (Not yet implemented)
+ * @return The instance of an {@link ITexture} implementation
+ */
+ public static ITexture of(final IIconContainer iconContainer, final short[] rgba, final boolean allowAlpha) {
+ return builder().addIcon(iconContainer).setRGBA(rgba).setAllowAlpha(allowAlpha).build();
+ }
+
+ public static ITexture of(final IIconContainer iconContainer, final short[] rgba) {
+ return builder().addIcon(iconContainer).setRGBA(rgba).build();
+ }
+
+ public static ITexture of(final IIconContainer iconContainer) {
+ return builder().addIcon(iconContainer).build();
+ }
+
+ /**
+ * Copied-Block {@link ITexture} factory
+ * that will render a texture copied from the side of a {@link Block}.
+ *
+ * @param block The {@link Block} that will provide the texture
+ * @param meta The meta value for the Block
+ * @param side The {@link ForgeDirection} side providing the texture
+ * @param rgba The RGBA tint to apply
+ * @return The instance of an {@link ITexture} implementation
+ */
+ public static ITexture of(final Block block, final int meta, final ForgeDirection side, final short[] rgba) {
+ return builder().setFromBlock(block, meta).setFromSide(side).setRGBA(rgba).build();
+ }
+
+ public static ITexture of(final Block block, final int meta, final ForgeDirection side) {
+ return builder().setFromBlock(block, meta).setFromSide(side).build();
+ }
+
+ public static ITexture of(final Block block, final int meta) {
+ return builder().setFromBlock(block, meta).build();
+ }
+
+ public static ITexture of(final Block block) {
+ return of(block, 0);
+ }
+
+ /**
+ * {@link ITextureBuilder} factory
+ *
+ * @return An instance of the {@link ITextureBuilder} implementation
+ */
+ public static ITextureBuilder builder() {
+ return new GT_TextureBuilder();
+ }
+}
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index 4fe57964d3..4acdf07c1f 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -16,6 +16,7 @@ import gregtech.api.enums.SubTag;
import gregtech.api.enums.Textures;
import gregtech.api.enums.ToolDictNames;
import gregtech.api.events.BlockScanningEvent;
+import gregtech.api.interfaces.IBlockContainer;
import gregtech.api.interfaces.IDebugableBlock;
import gregtech.api.interfaces.IProjectileItem;
import gregtech.api.interfaces.ITexture;
@@ -29,7 +30,6 @@ import gregtech.api.items.GT_EnergyArmor_Item;
import gregtech.api.items.GT_Generic_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.net.GT_Packet_Sound;
-import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.ItemData;
import gregtech.api.threads.GT_Runnable_Sound;
@@ -153,7 +153,7 @@ public class GT_Utility {
}
public static int safeInt(long number){
- return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number<Integer.MIN_VALUE ? Integer.MIN_VALUE : (int)number;
+ return number> V[V.length-1] ? safeInt(V[V.length-1],1) : number<Integer.MIN_VALUE ? Integer.MIN_VALUE : (int)number;
}
public static Field getPublicField(Object aObject, String aField) {
@@ -411,9 +411,7 @@ public class GT_Utility {
if (TE_CHECK && aTileEntity instanceof IItemDuct) return true;
if (BC_CHECK && aTileEntity instanceof buildcraft.api.transport.IPipeTile)
return ((buildcraft.api.transport.IPipeTile) aTileEntity).isPipeConnected(ForgeDirection.getOrientation(aSide));
- if (GregTech_API.mTranslocator && aTileEntity instanceof codechicken.translocator.TileItemTranslocator) return true;
-
- return false;
+ return GregTech_API.mTranslocator && aTileEntity instanceof codechicken.translocator.TileItemTranslocator;
}
/**
* Moves Stack from Inv-Slot to Inv-Slot, without checking if its even allowed.
@@ -1028,7 +1026,7 @@ public class GT_Utility {
if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)
return aFluid.isFluidEqual(((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack)));
FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack));
- return tData == null ? false : tData.fluid.isFluidEqual(aFluid);
+ return tData != null && tData.fluid.isFluidEqual(aFluid);
}
public static FluidStack getFluidForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) {
@@ -1140,7 +1138,7 @@ public class GT_Utility {
}
}
ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput);
- if(tStack==null||(tStack.length>0&&GT_Utility.areStacksEqual(aInput, tStack[0])))return false;
+ if(tStack==null||(tStack.length>0&& areStacksEqual(aInput, tStack[0])))return false;
if (tOreName != null) {
if(tOreName.toString().equals("dustAsh")&&tStack[0].getUnlocalizedName().equals("tile.volcanicAsh"))return false;
aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack));
@@ -1438,24 +1436,24 @@ public class GT_Utility {
* Return texture id from item stack, unoptimized but readable?
* @return casing texture 0 to 16383
*/
- public static int getTextureId(Block blockFromBlock,byte metaFromBlock){
+ public static int getTextureId(Block blockFromBlock, byte metaFromBlock) {
for (int page = 0; page < Textures.BlockIcons.casingTexturePages.length; page++) {
ITexture[] casingTexturePage = Textures.BlockIcons.casingTexturePages[page];
- if(casingTexturePage!=null){
+ if (casingTexturePage != null) {
for (int index = 0; index < casingTexturePage.length; index++) {
ITexture iTexture = casingTexturePage[index];
- if(iTexture instanceof GT_CopiedBlockTexture){
- Block block = ((GT_CopiedBlockTexture) iTexture).getBlock();
- byte meta = ((GT_CopiedBlockTexture) iTexture).getMeta();
- if(meta==metaFromBlock && blockFromBlock==block){
- return (page<<7)+index;
+ if (iTexture instanceof IBlockContainer) {
+ Block block = ((IBlockContainer) iTexture).getBlock();
+ byte meta = ((IBlockContainer) iTexture).getMeta();
+ if (meta == metaFromBlock && blockFromBlock == block) {
+ return (page << 7) + index;
}
}
}
}
}
- throw new RuntimeException("Probably missing mapping or different texture class used for: "+
- blockFromBlock.getUnlocalizedName()+" meta:"+metaFromBlock);
+ throw new RuntimeException("Probably missing mapping or different texture class used for: " +
+ blockFromBlock.getUnlocalizedName() + " meta:" + metaFromBlock);
}
/**
@@ -1938,7 +1936,7 @@ public class GT_Utility {
rEUAmount += 500;
FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity).getTankInfo(ForgeDirection.getOrientation(aSide));
if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) {
- tList.add(trans("167","Tank ") + i + ": " +EnumChatFormatting.GREEN+ GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) +EnumChatFormatting.RESET+ " L / " +EnumChatFormatting.YELLOW+ GT_Utility.formatNumbers(tTanks[i].capacity) +EnumChatFormatting.RESET+ " L " +EnumChatFormatting.GOLD+ getFluidName(tTanks[i].fluid, true)+EnumChatFormatting.RESET);
+ tList.add(trans("167","Tank ") + i + ": " +EnumChatFormatting.GREEN+ formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) +EnumChatFormatting.RESET+ " L / " +EnumChatFormatting.YELLOW+ formatNumbers(tTanks[i].capacity) +EnumChatFormatting.RESET+ " L " +EnumChatFormatting.GOLD+ getFluidName(tTanks[i].fluid, true)+EnumChatFormatting.RESET);
}
}
} catch (Throwable e) {
@@ -2032,7 +2030,7 @@ public class GT_Utility {
rEUAmount += 400;
int tValue = 0;
if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress()))
- tList.add(trans("178","Progress/Load: ") +EnumChatFormatting.GREEN+GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress()) +EnumChatFormatting.RESET+ " / " +EnumChatFormatting.YELLOW+GT_Utility.formatNumbers(tValue) +EnumChatFormatting.RESET);
+ tList.add(trans("178","Progress/Load: ") +EnumChatFormatting.GREEN+ formatNumbers(((IMachineProgress) tTileEntity).getProgress()) +EnumChatFormatting.RESET+ " / " +EnumChatFormatting.YELLOW+ formatNumbers(tValue) +EnumChatFormatting.RESET);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -2048,9 +2046,9 @@ public class GT_Utility {
}
try {
if (tTileEntity instanceof IBasicEnergyContainer && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) {
- tList.add(trans("179","Max IN: ") +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] + ") " +EnumChatFormatting.RESET+ trans("182"," EU at ") +EnumChatFormatting.RED+((IBasicEnergyContainer)tTileEntity).getInputAmperage()+EnumChatFormatting.RESET+trans("183"," A"));
- tList.add(trans("181","Max OUT: ") +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] + ") " +EnumChatFormatting.RESET+ trans("182"," EU at ") +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() +EnumChatFormatting.RESET+ trans("183"," A"));
- tList.add(trans("184","Energy: ") +EnumChatFormatting.GREEN+ GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) +EnumChatFormatting.RESET+ " EU / " +EnumChatFormatting.YELLOW+ GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) +EnumChatFormatting.RESET+ " EU");
+ tList.add(trans("179","Max IN: ") +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + " (" + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] + ") " +EnumChatFormatting.RESET+ trans("182"," EU at ") +EnumChatFormatting.RED+((IBasicEnergyContainer)tTileEntity).getInputAmperage()+EnumChatFormatting.RESET+trans("183"," A"));
+ tList.add(trans("181","Max OUT: ") +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() + " (" + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] + ") " +EnumChatFormatting.RESET+ trans("182"," EU at ") +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() +EnumChatFormatting.RESET+ trans("183"," A"));
+ tList.add(trans("184","Energy: ") +EnumChatFormatting.GREEN+ formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) +EnumChatFormatting.RESET+ " EU / " +EnumChatFormatting.YELLOW+ formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) +EnumChatFormatting.RESET+ " EU");
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -2412,7 +2410,7 @@ public class GT_Utility {
setBookTitle(aStack, "Raw Prospection Data");
- NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack);
+ NBTTagCompound tNBT = getNBT(aStack);
tNBT.setByte("prospection_tier", aTier);
tNBT.setString("prospection_pos", "Dim: " + aDim + "\nX: " + aX + " Y: " + aY + " Z: " + aZ);