From f4c725313b9fa748f81ee9a8b9670d118a3db5cc Mon Sep 17 00:00:00 2001 From: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:49:33 +0100 Subject: Add new blocks --- .../technus/tectech/loader/thing/ThingsLoader.java | 8 +- .../technus/tectech/thing/CustomItemList.java | 5 +- .../casing/SpacetimeCompressionFieldCasing.java | 165 +++++++++++++++++++++ ..._Block_SpacetimeCompressionFieldGenerators.java | 10 ++ .../multi/GT_MetaTileEntity_EM_bhg.java | 19 +-- 5 files changed, 186 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java create mode 100644 src/main/java/com/github/technus/tectech/thing/casing/TT_Block_SpacetimeCompressionFieldGenerators.java (limited to 'src/main') diff --git a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java index 7c32bb70d2..e5f93109b1 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java @@ -7,10 +7,7 @@ import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turret import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.block.ReactorSimBlock; -import com.github.technus.tectech.thing.casing.GT_Block_CasingsBA0; -import com.github.technus.tectech.thing.casing.GT_Block_CasingsNH; -import com.github.technus.tectech.thing.casing.GT_Block_CasingsTT; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.casing.*; import com.github.technus.tectech.thing.item.*; import cpw.mods.fml.common.Loader; import gregtech.api.enums.Textures; @@ -37,6 +34,9 @@ public class ThingsLoader implements Runnable { TT_Container_Casings.sBlockCasingsBA0 = new GT_Block_CasingsBA0(); TecTech.LOGGER.info("Nikolai's Casing registered"); + TT_Block_SpacetimeCompressionFieldGenerators.SpacetimeCompressionFieldGenerator = new SpacetimeCompressionFieldCasing(); + TecTech.LOGGER.info("Spacetime Compression Field Casings registered."); + QuantumGlassBlock.run(); TecTech.LOGGER.info("Quantum Glass registered"); diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 9e555e3961..b0626cf866 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -99,7 +99,10 @@ public enum CustomItemList implements IItemContainer { Machine_TeslaCoil_1by1_LV, Machine_TeslaCoil_1by1_MV, Machine_TeslaCoil_1by1_HV, Machine_TeslaCoil_1by1_EV, Machine_TeslaCoil_1by1_IV, Machine_TeslaCoil_2by2_LV, Machine_TeslaCoil_2by2_MV, Machine_TeslaCoil_2by2_HV, Machine_TeslaCoil_2by2_EV, Machine_TeslaCoil_2by2_IV, Machine_TeslaCoil_3by3_LV, Machine_TeslaCoil_3by3_MV, Machine_TeslaCoil_3by3_HV, Machine_TeslaCoil_3by3_EV, Machine_TeslaCoil_3by3_IV, - Machine_TeslaCoil_4by4_LV, Machine_TeslaCoil_4by4_MV, Machine_TeslaCoil_4by4_HV, Machine_TeslaCoil_4by4_EV, Machine_TeslaCoil_4by4_IV; + Machine_TeslaCoil_4by4_LV, Machine_TeslaCoil_4by4_MV, Machine_TeslaCoil_4by4_HV, Machine_TeslaCoil_4by4_EV, Machine_TeslaCoil_4by4_IV, + + SpacetimeCompressionFieldGeneratorTier1, SpacetimeCompressionFieldGeneratorTier2, SpacetimeCompressionFieldGeneratorTier3, SpacetimeCompressionFieldGeneratorTier4, + SpacetimeCompressionFieldGeneratorTier5, SpacetimeCompressionFieldGeneratorTier6, SpacetimeCompressionFieldGeneratorTier7, SpacetimeCompressionFieldGeneratorTier8; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java b/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java new file mode 100644 index 0000000000..f6988c3f18 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/casing/SpacetimeCompressionFieldCasing.java @@ -0,0 +1,165 @@ +package com.github.technus.tectech.thing.casing; + +import com.github.technus.tectech.thing.CustomItemList; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Block_Casings_Abstract; +import gregtech.common.blocks.GT_Material_Casings; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import java.util.List; + +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; + +/** + * Created by danie_000 on 03.10.2016. + */ +public class SpacetimeCompressionFieldCasing extends GT_Block_Casings_Abstract { + private static IIcon[] tM0 = new IIcon[2]; + private static IIcon[] tM1 = new IIcon[2]; + private static IIcon[] tM2 = new IIcon[2]; + private static IIcon[] tM3 = new IIcon[2]; + private static IIcon[] tM4 = new IIcon[2]; + private static IIcon[] tM5 = new IIcon[2]; + private static IIcon[] tM6 = new IIcon[2]; + private static IIcon tM7; + private static IIcon[] tM8 = new IIcon[2]; + private static IIcon[] tM9 = new IIcon[2]; + + private static final byte START_INDEX = 16; + + public SpacetimeCompressionFieldCasing() { + super(GT_Item_CasingsBA0.class, "gt.spacetime_compression_field_generator", GT_Material_Casings.INSTANCE); + for (byte b = 0; b < 16; b = (byte) (b + 1)) { + Textures.BlockIcons.casingTexturePages[texturePage][b + START_INDEX] = new GT_CopiedBlockTexture(this, 6, b); + } + + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "TEST Crude Spacetime Compression Field Generator"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "TEST Primitive Spacetime Compression Field Generator"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "TEST Stable Spacetime Compression Field Generator"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "TEST Superb Spacetime Compression Field Generator"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "TEST Resplendent Spacetime Compression Field Generator"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "TEST Perfect Spacetime Compression Field Generator"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "TEST Tipler Grade Spacetime Compression Field Generator"); + + CustomItemList.SpacetimeCompressionFieldGeneratorTier1.set(new ItemStack(this, 1, 0)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier2.set(new ItemStack(this, 1, 1)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier3.set(new ItemStack(this, 1, 2)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier4.set(new ItemStack(this, 1, 3)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier5.set(new ItemStack(this, 1, 4)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier6.set(new ItemStack(this, 1, 5)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier7.set(new ItemStack(this, 1, 6)); + CustomItemList.SpacetimeCompressionFieldGeneratorTier8.set(new ItemStack(this, 1, 7)); + + } + + @Override + public void registerBlockIcons(IIconRegister aIconRegister) { + tM0[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0"); + tM0[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0"); + tM1[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1"); + tM1[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1"); + tM2[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2"); + tM2[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2"); + tM3[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3"); + tM3[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3"); + tM4[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4"); + tM4[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4"); + tM5[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5"); + tM5[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5"); + tM9[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_6"); + tM9[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_6"); + + tM6[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_TOP_BOTTOM"); + tM6[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_SIDES"); + tM7 = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_TOROID"); + tM8[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM"); + tM8[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_SECONDARY_SIDES"); + } + + @Override + public IIcon getIcon(int aSide, int aMeta) { + switch (aMeta) { + case 0: + switch (aSide) { + case 0: + case 1: + return tM0[0]; + default: + return tM0[1]; + } + case 1: + switch (aSide) { + case 0: + case 1: + return tM1[0]; + default: + return tM1[1]; + } + case 2: + switch (aSide) { + case 0: + case 1: + return tM2[0]; + default: + return tM2[1]; + } + case 3: + switch (aSide) { + case 0: + case 1: + return tM3[0]; + default: + return tM3[1]; + } + case 4: + switch (aSide) { + case 0: + case 1: + return tM4[0]; + default: + return tM4[1]; + } + case 5: + switch (aSide) { + case 0: + case 1: + return tM5[0]; + default: + return tM5[1]; + } + case 6: + switch (aSide) { + case 0: + case 1: + return tM6[0]; + default: + return tM6[1]; + } + default: + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) { + int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + return getIcon(aSide, tMeta); + } + + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i <= 6; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TT_Block_SpacetimeCompressionFieldGenerators.java b/src/main/java/com/github/technus/tectech/thing/casing/TT_Block_SpacetimeCompressionFieldGenerators.java new file mode 100644 index 0000000000..4b10c45f64 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/casing/TT_Block_SpacetimeCompressionFieldGenerators.java @@ -0,0 +1,10 @@ +package com.github.technus.tectech.thing.casing; + +import net.minecraft.block.Block; + +public class TT_Block_SpacetimeCompressionFieldGenerators { + + public static Block SpacetimeCompressionFieldGenerator; + + private TT_Block_SpacetimeCompressionFieldGenerators() {} +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 97938ccca9..704f6c1858 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -38,20 +38,9 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - //todo CHECK VALUES - private static final double NEUTRONIUM_BLOCK_MASS = 4.1E17; - private static final double NEUTRONIUM_BLOCK_ATOM_COUNT = 2.4478671E44; - private static final double NEUTRONIUM_BLOCK_TO_EU_INSTANT = URANIUM_MASS_TO_EU_INSTANT * NEUTRONIUM_BLOCK_MASS / (URANIUM_INGOT_MASS_DIFF * 1.78266191e-36);//~ 5.314e40 - private static final double NEUTRON_TO_EU_INSTANT = NEUTRONIUM_BLOCK_TO_EU_INSTANT / NEUTRONIUM_BLOCK_ATOM_COUNT;//~ 0.00021708694 - - public boolean glassDome = false; //endregion - //Time dillatation - to slow down the explosion thing but REALLY REDUCE POWER OUTPUT - //Startcodes to startup - //per dim disable thingies - - //region structure actual + // Multiblock structure. private static final IStructureDefinition STRUCTURE_DEFINITION = IStructureDefinition .builder() .addShape("main", transpose(new String[][]{ @@ -94,7 +83,6 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E .addElement('C', ofBlock(sBlockCasingsTT, 12)) .addElement('D', ofBlock(sBlockCasingsTT, 13)) .addElement('E', ofBlock(sBlockCasingsTT, 14)) - .addElement('G', ofBlock(QuantumGlassBlock.INSTANCE, 0)) .addElement('H', ofHatchAdderOptional(GT_MetaTileEntity_EM_bhg::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_bhg::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) .build(); @@ -116,8 +104,8 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", - translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.0"),//1 - Classic Hatches or High Power Casing - translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.1"),//2 - Elemental Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.0"), + translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.1"), }; //endregion @@ -137,7 +125,6 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if (structureCheck_EM("main", 16, 16, 0)) { - glassDome = false; return true; } return false; -- cgit