diff options
| author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-09-02 23:17:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-02 23:17:17 +0200 |
| commit | 1b820de08a05070909a267e17f033fcf58ac8710 (patch) | |
| tree | 02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/com/detrav/utils | |
| parent | afd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff) | |
| download | GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2 GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip | |
The Great Renaming (#3014)
* move kekztech to a single root dir
* move detrav to a single root dir
* move gtnh-lanthanides to a single root dir
* move tectech and delete some gross reflection in gt++
* remove more reflection inside gt5u
* delete more reflection in gt++
* fix imports
* move bartworks and bwcrossmod
* fix proxies
* move galactigreg and ggfab
* move gtneioreplugin
* try to fix gt++ bee loader
* apply the rename rules to BW
* apply rename rules to bwcrossmod
* apply rename rules to detrav scanner mod
* apply rename rules to galacticgreg
* apply rename rules to ggfab
* apply rename rules to goodgenerator
* apply rename rules to gtnh-lanthanides
* apply rename rules to gt++
* apply rename rules to kekztech
* apply rename rules to kubatech
* apply rename rules to tectech
* apply rename rules to gt
apply the rename rules to gt
* fix tt import
* fix mui hopefully
* fix coremod except intergalactic
* rename assline recipe class
* fix a class name i stumbled on
* rename StructureUtility to GTStructureUtility to prevent conflict with structurelib
* temporary rename of GTTooltipDataCache to old name
* fix gt client/server proxy names
Diffstat (limited to 'src/main/java/com/detrav/utils')
| -rw-r--r-- | src/main/java/com/detrav/utils/BartWorksHelper.java | 23 | ||||
| -rw-r--r-- | src/main/java/com/detrav/utils/DetravCreativeTab.java | 52 | ||||
| -rw-r--r-- | src/main/java/com/detrav/utils/FluidColors.java | 135 | ||||
| -rw-r--r-- | src/main/java/com/detrav/utils/GTppHelper.java | 67 |
4 files changed, 0 insertions, 277 deletions
diff --git a/src/main/java/com/detrav/utils/BartWorksHelper.java b/src/main/java/com/detrav/utils/BartWorksHelper.java deleted file mode 100644 index bac23893c1..0000000000 --- a/src/main/java/com/detrav/utils/BartWorksHelper.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.detrav.utils; - -import net.minecraft.block.Block; -import net.minecraft.world.chunk.Chunk; - -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; - -public class BartWorksHelper { - - public static boolean isOre(Block tBlock) { - return tBlock instanceof BW_MetaGenerated_Ores; - } - - public static boolean isSmallOre(Block tBlock) { - return tBlock instanceof BW_MetaGenerated_SmallOres; - } - - public static short getMetaFromBlock(Chunk c, int x, int y, int z, Block tBlock) { - return (short) (tBlock.getDamageValue(c.worldObj, c.xPosition * 16 + x, y, c.zPosition * 16 + z) * -1); - } - -} diff --git a/src/main/java/com/detrav/utils/DetravCreativeTab.java b/src/main/java/com/detrav/utils/DetravCreativeTab.java deleted file mode 100644 index ba79c55ab2..0000000000 --- a/src/main/java/com/detrav/utils/DetravCreativeTab.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.detrav.utils; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; - -import com.detrav.items.DetravMetaGeneratedTool01; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Created by wital_000 on 19.03.2016. - */ -public class DetravCreativeTab extends CreativeTabs { - - public DetravCreativeTab() { - super("Detrav Scanner"); - } - - @Override - public Item getTabIconItem() { - return Items.stick; - } - - @Override - @SideOnly(Side.CLIENT) - public void displayAllReleventItems(List p_78018_1_) { - for (Object o : Item.itemRegistry) { - Item item = (Item) o; - - if (item == null) { - continue; - } - - for (CreativeTabs tab : item.getCreativeTabs()) { - if (tab == this) { - item.getSubItems(item, this, p_78018_1_); - if (item instanceof DetravMetaGeneratedTool01) { - ((DetravMetaGeneratedTool01) item).getDetravSubItems(item, this, p_78018_1_); - } - } - } - } - - if (this.func_111225_m() != null) { - this.addEnchantmentBooksToList(p_78018_1_, this.func_111225_m()); - } - } -} diff --git a/src/main/java/com/detrav/utils/FluidColors.java b/src/main/java/com/detrav/utils/FluidColors.java deleted file mode 100644 index 25611dbf3e..0000000000 --- a/src/main/java/com/detrav/utils/FluidColors.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.detrav.utils; - -import static com.detrav.net.ProspectingPacket.fluidColors; - -import java.util.Arrays; -import java.util.Objects; - -import net.minecraftforge.fluids.FluidRegistry; - -import gregtech.api.enums.Materials; - -public class FluidColors { - - public static void makeColors() { - - reFillFluidColors(); - - // ProgressManager.ProgressBar progressBar = ProgressManager.push("Making Fluid Colors", (int) - // (Materials.values().length + - // FluidRegistry.getRegisteredFluids().values().stream().filter(Objects::nonNull).count())); - Arrays.stream(Materials.values()) - .forEach(mat -> { - // progressBar.step(mat.mDefaultLocalName); - if (mat.getSolid(0) != null) fluidColors.putIfAbsent( - mat.getSolid(0) - .getFluidID(), - mat.mRGBa); - if (mat.getGas(0) != null) fluidColors.putIfAbsent( - mat.getGas(0) - .getFluidID(), - mat.mRGBa); - if (mat.getFluid(0) != null) fluidColors.putIfAbsent( - mat.getFluid(0) - .getFluidID(), - mat.mRGBa); - if (mat.getMolten(0) != null) fluidColors.putIfAbsent( - mat.getMolten(0) - .getFluidID(), - mat.mRGBa); - }); - FluidRegistry.getRegisteredFluids() - .values() - .stream() - .filter(Objects::nonNull) - .forEach(fluid -> { - // progressBar.step(fluid.getName()); - fluidColors.putIfAbsent(fluid.getID(), convertColorInt(fluid.getColor())); - }); - // ProgressManager.pop(progressBar); - } - - private static void reFillFluidColors() { - try { - // Should probably be put somewhere else, but I suck at Java - fluidColors.put(Materials.NatruralGas.mGas.getID(), new short[] { 0x00, 0xff, 0xff }); - fluidColors.put(Materials.OilLight.mFluid.getID(), new short[] { 0xff, 0xff, 0x00 }); - fluidColors.put(Materials.OilMedium.mFluid.getID(), new short[] { 0x00, 0xFF, 0x00 }); - fluidColors.put(Materials.OilHeavy.mFluid.getID(), new short[] { 0xFF, 0x00, 0xFF }); - fluidColors.put(Materials.Oil.mFluid.getID(), new short[] { 0x00, 0x00, 0x00 }); - fluidColors.put(Materials.Helium_3.mGas.getID(), new short[] { 0x80, 0x20, 0xe0 }); - fluidColors.put(Materials.SaltWater.mFluid.getID(), new short[] { 0x80, 0xff, 0x80 }); - // fluidColors.put(Materials.Naquadah.getMolten(0).getFluid().getID(), new short[]{0x20, 0x20, 0x20}); - // fluidColors.put(Materials.NaquadahEnriched.getMolten(0).getFluid().getID(), new short[]{0x60, 0x60, - // 0x60}); - fluidColors.put( - Materials.Lead.getMolten(0) - .getFluid() - .getID(), - new short[] { 0xd0, 0xd0, 0xd0 }); - fluidColors.put(Materials.Chlorobenzene.mFluid.getID(), new short[] { 0x40, 0x80, 0x40 }); - fluidColors.put( - FluidRegistry.getFluid("liquid_extra_heavy_oil") - .getID(), - new short[] { 0x00, 0x00, 0x50 }); - fluidColors.put(Materials.Oxygen.mGas.getID(), new short[] { 0x40, 0x40, 0xA0 }); - fluidColors.put(Materials.Nitrogen.mGas.getID(), new short[] { 0x00, 0x80, 0xd0 }); - fluidColors.put(Materials.Methane.mGas.getID(), new short[] { 0x80, 0x20, 0x20 }); - fluidColors.put(Materials.Ethane.mGas.getID(), new short[] { 0x40, 0x80, 0x20 }); - fluidColors.put(Materials.Ethylene.mGas.getID(), new short[] { 0xd0, 0xd0, 0xd0 }); - fluidColors.put(FluidRegistry.LAVA.getID(), new short[] { 0xFF, 0x00, 0x00 }); - fluidColors.put( - FluidRegistry.getFluid("unknowwater") - .getID(), - new short[] { 0x8A, 0x2B, 0xE2 }); - fluidColors.put(Materials.Hydrogen.mGas.getID(), new short[] { 0x32, 0x32, 0xD6 }); - fluidColors.put(Materials.SulfuricAcid.mFluid.getID(), new short[] { 0xFF, 0xB9, 0x0F }); - fluidColors.put(Materials.HydricSulfide.mFluid.getID(), new short[] { 0xFF, 0x8F, 0x43 }); - fluidColors.put(Materials.CarbonMonoxide.mGas.getID(), new short[] { 0x10, 0x4E, 0x8B }); - fluidColors.put(Materials.CarbonDioxide.mGas.getID(), new short[] { 0x69, 0x69, 0x69 }); - fluidColors.put( - FluidRegistry.getFluid("ic2distilledwater") - .getID(), - new short[] { 0x1E, 0x90, 0xFF }); - fluidColors.put(Materials.Deuterium.mGas.getID(), new short[] { 0xFF, 0xE3, 0x9F }); - fluidColors.put( - Materials.Iron.getMolten(0) - .getFluid() - .getID(), - new short[] { 0x8B, 0x88, 0x78 }); - fluidColors.put( - Materials.Tin.getMolten(0) - .getFluid() - .getID(), - new short[] { 0xE7, 0xE7, 0xE4 }); - fluidColors.put( - Materials.Copper.getMolten(0) - .getFluid() - .getID(), - new short[] { 0xFF, 0x7F, 0x24 }); - fluidColors.put( - FluidRegistry.getFluid("fluorine") - .getID(), - new short[] { 0x99, 0xC1, 0xAD }); - fluidColors.put( - FluidRegistry.getFluid("hydrofluoricacid") - .getID(), - new short[] { 0x00, 0xCE, 0xD1 }); - fluidColors.put(Materials.PhosphoricAcid.mFluid.getID(), new short[] { 0xEE, 0x76, 0x00 }); - - // possible nulls - fluidColors.put(Materials.LiquidAir.mFluid.getID(), new short[] { 0x99, 0x99, 0xEA }); - } catch (Exception ignored) {} - /* - * Set set = fluidColors.entrySet(); Iterator iterator = set.iterator(); System.out.println( - * "DETRAV SCANNER DEBUG" ); while(iterator.hasNext()) { Map.Entry mentry = (Map.Entry) iterator.next(); - * System.out.println( "key is: "+ (Integer)mentry.getKey() + " & Value is: " + ((short[])mentry.getValue())[0] - * + " " + ((short[])mentry.getValue())[1] + " " + ((short[])mentry.getValue())[2] ); } - */ - } - - private static short[] convertColorInt(int color) { - return new short[] { (short) (color << 16 & 0xff), (short) (color << 8 & 0xff), (short) (color & 0xff) }; - } - -} diff --git a/src/main/java/com/detrav/utils/GTppHelper.java b/src/main/java/com/detrav/utils/GTppHelper.java deleted file mode 100644 index dd86b3d9f6..0000000000 --- a/src/main/java/com/detrav/utils/GTppHelper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.detrav.utils; - -import java.util.HashMap; - -import net.minecraft.block.Block; - -import gtPlusPlus.core.block.base.BlockBaseOre; -import gtPlusPlus.core.material.ALLOY; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.MISC_MATERIALS; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.nuclear.FLUORIDES; - -/** - * Created by bartimaeusnek on 19.04.2018. - */ -public class GTppHelper { - - public static final HashMap<Short, Material> decodeoresGTpp = new HashMap<>(); - public static final HashMap<Material, Short> encodeoresGTpp = new HashMap<>(); - - public static void generate_OreIDs() { - short n = 0; - for (; n < gtPlusPlus.core.material.ORES.class.getFields().length; ++n) { - try { - Short i = (short) (n + 1); - Material m = ((Material) gtPlusPlus.core.material.ORES.class.getFields()[n] - .get(gtPlusPlus.core.material.ORES.class.getFields()[n])); - decodeoresGTpp.put(i, m); - encodeoresGTpp.put(m, i); - } catch (Exception ignored) {} - } - // Manually add ores from other places than the ore class - // Fluorite - decodeoresGTpp.put((short) (++n + 1), FLUORIDES.FLUORITE); - encodeoresGTpp.put(FLUORIDES.FLUORITE, (short) (n + 1)); - // Rare Earths - decodeoresGTpp.put((short) (++n + 1), MISC_MATERIALS.RARE_EARTH_LOW); - encodeoresGTpp.put(MISC_MATERIALS.RARE_EARTH_LOW, (short) (n + 1)); - decodeoresGTpp.put((short) (++n + 1), MISC_MATERIALS.RARE_EARTH_MID); - encodeoresGTpp.put(MISC_MATERIALS.RARE_EARTH_MID, (short) (n + 1)); - decodeoresGTpp.put((short) (++n + 1), MISC_MATERIALS.RARE_EARTH_HIGH); - encodeoresGTpp.put(MISC_MATERIALS.RARE_EARTH_HIGH, (short) (n + 1)); - // Koboldite - decodeoresGTpp.put((short) (++n + 1), ALLOY.KOBOLDITE); - encodeoresGTpp.put(ALLOY.KOBOLDITE, (short) (n + 1)); - // Runite - decodeoresGTpp.put((short) (++n + 1), ELEMENT.STANDALONE.RUNITE); - encodeoresGTpp.put(ELEMENT.STANDALONE.RUNITE, (short) (n + 1)); - // Ancient granite - decodeoresGTpp.put((short) (++n + 1), ELEMENT.STANDALONE.GRANITE); - encodeoresGTpp.put(ELEMENT.STANDALONE.GRANITE, (short) (n + 1)); - } - - public static boolean isGTppBlock(Block tBlock) { - return tBlock instanceof BlockBaseOre; - } - - public static short getGTppMeta(Block tBlock) { - return (short) (GTppHelper.encodeoresGTpp.get(((BlockBaseOre) tBlock).getMaterialEx()) + 7000); - } - - public static String getGTppVeinName(Block tBlock) { - return tBlock.getLocalizedName(); - } - -} |
