aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/api')
-rw-r--r--src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java24
-rw-r--r--src/main/java/gtPlusPlus/api/enums/ParticleNames.java37
-rw-r--r--src/main/java/gtPlusPlus/api/enums/Quality.java62
-rw-r--r--src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java203
-rw-r--r--src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java76
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java33
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java8
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java21
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java17
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IGregtechPacketEntity.java13
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java145
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/ILazyCoverable.java144
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IPlugin.java40
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java55
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/ITexturedBlock.java14
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/ITileTooltip.java7
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/IToolable.java17
-rw-r--r--src/main/java/gtPlusPlus/api/interfaces/RunnableWithInfo.java12
-rw-r--r--src/main/java/gtPlusPlus/api/objects/GregtechException.java28
-rw-r--r--src/main/java/gtPlusPlus/api/objects/Logger.java179
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/AutoMap.java345
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java18
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java53
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java39
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ObjMap.java285
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/Pair.java35
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/Quad.java45
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/ReverseAutoMap.java175
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/Triplet.java27
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java178
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/WeightedCollection.java102
-rw-r--r--src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java12
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/AABB.java65
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java188
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_Inventory.java228
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java250
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java62
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java52
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java253
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java173
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FluidGT6.java31
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/FormattedTooltipString.java25
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java42
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java58
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemStackData.java35
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java123
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java64
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java250
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java55
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java111
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoEUBonusMultiBehaviour.java27
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java27
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/NoSpeedBonusMultiBehaviour.java27
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/multi/SpecialMultiBehaviour.java44
-rw-r--r--src/main/java/gtPlusPlus/api/objects/random/CSPRNG_DO_NOT_USE.java271
-rw-r--r--src/main/java/gtPlusPlus/api/objects/random/UUIDGenerator.java449
-rw-r--r--src/main/java/gtPlusPlus/api/objects/random/XSTR.java278
-rw-r--r--src/main/java/gtPlusPlus/api/plugin/Sample_Plugin.java47
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalConnection.java7
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalContainerItem.java15
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalHandler.java15
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalProvider.java13
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalReceiver.java13
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/IThermalStorage.java13
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorage.java116
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/energy/ThermalStorageAdv.java34
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/sample/ItemThermalContainer.java84
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/sample/TileThermalHandler.java42
-rw-r--r--src/main/java/gtPlusPlus/api/thermal/tileentity/IThermalInfo.java13
69 files changed, 6049 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java b/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java
new file mode 100644
index 0000000000..f35c9cbc6b
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.api.damage;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.ChatComponentTranslation;
+import net.minecraft.util.IChatComponent;
+
+import gtPlusPlus.core.world.damage.BaseCustomDamageSource;
+
+public class DamageTeslaTower extends BaseCustomDamageSource{
+
+ public DamageTeslaTower(Entity transmitter) {
+ super("plasmabolt", transmitter, null);
+ this.setDamageBypassesArmor();
+ this.setDamageIsAbsolute();
+ }
+
+ @Override
+ public IChatComponent func_151519_b(EntityLivingBase target) {
+ String s = "death.attack." + this.damageType;
+ return new ChatComponentTranslation(s, target.getCommandSenderName(), "Plasma");
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/api/enums/ParticleNames.java b/src/main/java/gtPlusPlus/api/enums/ParticleNames.java
new file mode 100644
index 0000000000..d082cd6779
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/enums/ParticleNames.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.api.enums;
+
+public enum ParticleNames {
+
+ explode,
+ largeexplode,
+ hugeexplosion,
+ bubble,
+ splash,
+ suspended,
+ depthsuspend,
+ crit,
+ magicCrit,
+ smoke,
+ largesmoke,
+ spell,
+ instantSpell,
+ mobSpell,
+ dripWater,
+ dripLava,
+ townaura,
+ note,
+ portal,
+ enchantmenttable,
+ flame,
+ lava,
+ footstep,
+ cloud,
+ reddust,
+ snowballpoof,
+ snowshovel,
+ slime,
+ heart,
+ iconcrack_,
+ tilecrack_;
+
+}
diff --git a/src/main/java/gtPlusPlus/api/enums/Quality.java b/src/main/java/gtPlusPlus/api/enums/Quality.java
new file mode 100644
index 0000000000..050f335b5e
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/enums/Quality.java
@@ -0,0 +1,62 @@
+package gtPlusPlus.api.enums;
+
+import net.minecraft.util.EnumChatFormatting;
+
+import gtPlusPlus.core.util.math.MathUtils;
+
+public enum Quality {
+
+ // Magic Blue
+ // Rare Yellow
+ // Set Green
+ // Unique Gold/Purple
+ // Trade-off Brown
+
+ POOR("Poor", EnumChatFormatting.GRAY), COMMON("Common", EnumChatFormatting.WHITE), UNCOMMON("Uncommon",
+ EnumChatFormatting.DARK_GREEN), MAGIC("Magic", EnumChatFormatting.BLUE), RARE("Rare",
+ EnumChatFormatting.YELLOW), UNIQUE("Unique", EnumChatFormatting.GOLD), ARTIFACT("Artifact",
+ EnumChatFormatting.AQUA), SET("Set Piece", EnumChatFormatting.GREEN), TRADEOFF("Trade-off",
+ EnumChatFormatting.DARK_RED), EPIC("Epic", EnumChatFormatting.LIGHT_PURPLE);
+
+ private String LOOT;
+ private EnumChatFormatting COLOUR;
+
+ private Quality(final String lootTier, final EnumChatFormatting tooltipColour) {
+ this.LOOT = lootTier;
+ this.COLOUR = tooltipColour;
+ }
+
+ public String getQuality() {
+ return this.LOOT;
+ }
+
+ protected EnumChatFormatting getColour() {
+ return this.COLOUR;
+ }
+
+ public String formatted() {
+ return this.COLOUR + this.LOOT;
+ }
+
+ public static Quality getRandomQuality() {
+ final int lootChance = MathUtils.randInt(0, 100);
+ if (lootChance <= 10) {
+ return Quality.POOR;
+ } else if (lootChance <= 45) {
+ return Quality.COMMON;
+ } else if (lootChance <= 65) {
+ return Quality.UNCOMMON;
+ } else if (lootChance <= 82) {
+ return Quality.MAGIC;
+ } else if (lootChance <= 92) {
+ return Quality.EPIC;
+ } else if (lootChance <= 97) {
+ return Quality.RARE;
+ } else if (lootChance <= 99) {
+ return Quality.ARTIFACT;
+ } else {
+ return null;
+ }
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
new file mode 100644
index 0000000000..6fe4209efe
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
@@ -0,0 +1,203 @@
+package gtPlusPlus.api.helpers;
+
+import java.util.HashMap;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.WeightedCollection;
+import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG;
+import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+
+public class GregtechPlusPlus_API {
+
+ public static class Multiblock_API {
+
+ private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap = new HashMap<String, SpecialMultiBehaviour>();
+
+ /**
+ * Register a special behaviour for GT++ Multis to listen use.
+ * @param aBehaviour - An Object which has extended {@link SpecialMultiBehaviour}'s base implementation.
+ * @return - Did this behaviour register properly?
+ */
+ public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) {
+ if (aBehaviour.getTriggerItem() == null || aBehaviour.getTriggerItemTooltip() == null || aBehaviour.getTriggerItemTooltip().length() <= 0) {
+ Logger.INFO("Failed to attach custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
+ return false;
+ }
+ mSpecialBehaviourItemMap.put("UniqueKey_"+aBehaviour.hashCode(), aBehaviour);
+ SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip());
+ Logger.INFO("Attached custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
+ return true;
+ }
+
+ public static final HashMap<String, SpecialMultiBehaviour> getSpecialBehaviourItemMap() {
+ return mSpecialBehaviourItemMap;
+ }
+
+ /**
+ * Allows RTG Fuel pellets from other mods to be used in the RTG hatch.
+ * @param aStack - The Pellet Stack, sanitsed after passing through.
+ * @param aFuelValue - The Fuel Value of the Pellet to be added to the energy storage.
+ * @return - Did register?
+ */
+ public static boolean registerPelletForRtgHatch(ItemStack aStack, long aFuelValue) {
+ return GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aStack, aFuelValue);
+ }
+
+ }
+
+ public static class VoidMiner_API {
+
+ private static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> mMinerLootCache;
+
+ static {
+ mMinerLootCache = new HashMap<Integer, HashMap<String, WeightedCollection<Block>>>();
+ }
+
+
+ /**
+ *
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOredictName - The OreDict name of the Ore to be mined.
+ * @return - If there was a valid Block found in the OreDict for the provided name.
+ */
+ public static boolean registerOreForVoidMiner(int aDim, String aOredictName) {
+ return registerOreForVoidMiner(aDim, aOredictName, 100);
+ }
+
+ /**
+ *
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOredictName - The OreDict name of the Ore to be mined.
+ * @param aWeight - The weight of this ore Block.
+ * @return - If there was a valid Block found in the OreDict for the provided name.
+ */
+ public static boolean registerOreForVoidMiner(int aDim, String aOredictName, int aWeight) {
+ Block b = null;
+ ItemStack[] aValidItems = ItemUtils.validItemsForOreDict(aOredictName);
+ for (ItemStack g : aValidItems) {
+ if (g != null) {
+ b = Block.getBlockFromItem(g.getItem());
+ if (b != null) {
+ break;
+ }
+ }
+ }
+ if (b != null) {
+ registerOreForVoidMiner(aDim, b, aWeight);
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * Registers an ore block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aOreBlock - The Ore Block to be mined.
+ */
+ public static void registerOreForVoidMiner(int aDim, Block aOreBlock) {
+ registerOreForVoidMiner(aDim, aOreBlock, 100);
+ }
+
+ /**
+ * Registers an ore block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aOreBlock - The Ore Block to be mined.
+ * @param aWeight - The weight of this ore Block.
+ */
+ public static void registerOreForVoidMiner(int aDim, Block aOreBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aOreBlock, aWeight);
+ }
+
+ /**
+ * Registers a surface block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aDirtBlock - The Dirt/Grass Block to be mined.
+ */
+ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock) {
+ registerEarthSurfaceForVoidMiner(aDim, aDirtBlock, 100);
+ }
+
+ /**
+ * Registers a surface block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aDirtBlock - The Dirt/Grass Block to be mined.
+ * @param aWeight - The weight of this Dirt/Grass Block.
+ */
+ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aDirtBlock, aWeight);
+ }
+
+ /**
+ * Registers a stone block for a dimension. Uses a default weight of 100.
+ * @param aDim - The Dimension ID
+ * @param aStoneBlock - The Stone Block to be mined.
+ */
+ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock) {
+ registerEarthStoneForVoidMiner(aDim, aStoneBlock, 100);
+ }
+
+ /**
+ * Registers a stone block for a dimension.
+ * @param aDim - The Dimension ID
+ * @param aStoneBlock - The Stone Block to be mined.
+ * @param aWeight - The weight of this Stone Block.
+ */
+ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock, int aWeight) {
+ GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aStoneBlock, aWeight);
+ }
+
+
+
+
+ public static WeightedCollection<Block> getAllRegisteredOresForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("ore");
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredDirtTypesForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("dirt");
+ }
+
+ public static WeightedCollection<Block> getAllRegisteredStoneTypesForDimension(int aDim) {
+ return mMinerLootCache.get(aDim).get("stone");
+ }
+
+ public static final HashMap<Integer, HashMap<String, WeightedCollection<Block>>> getVoidMinerLootCache() {
+ return mMinerLootCache;
+ }
+
+ }
+
+
+ private static class GregtechPlusPlus_API_Internal {
+
+ private static void writeBlockToDimensionInCache(int aDim, int aType, Block aBlock, int aWeight) {
+ HashMap<String, WeightedCollection<Block>> aDimMap = VoidMiner_API.mMinerLootCache.get(aDim);
+ if (aDimMap == null) {
+ aDimMap = new HashMap<String, WeightedCollection<Block>>();
+ }
+ WeightedCollection<Block> aMappedBlocks = getBlockMap(aType, aDimMap);
+ aMappedBlocks.put(aWeight, aBlock);
+
+ }
+
+ private static WeightedCollection<Block> getBlockMap(int aType, HashMap<String, WeightedCollection<Block>> aDimMap){
+ WeightedCollection<Block> aMappedBlocks;
+ String aTypeName = ((aType == 0) ? "ore" : (aType == 1) ? "dirt" : (aType == 2) ? "stone" : "error");
+ aMappedBlocks = aDimMap.get(aTypeName);
+ if (aMappedBlocks == null) {
+ aMappedBlocks = new WeightedCollection<Block>();
+ }
+ return aMappedBlocks;
+ }
+
+ }
+
+
+}
diff --git a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java
new file mode 100644
index 0000000000..9d2e894d99
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java
@@ -0,0 +1,76 @@
+package gtPlusPlus.api.helpers;
+
+import net.minecraft.item.ItemStack;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+
+public class MaterialHelper {
+
+ public static ItemStack getComponentFromMaterial(OrePrefixes oreprefix, Material material, int amount){
+ return ItemUtils.getOrePrefixStack(oreprefix, material, amount);
+ }
+ public static ItemStack getComponentFromGtMaterial(OrePrefixes oreprefix, Materials material, int amount){