diff options
Diffstat (limited to 'src/main/java')
45 files changed, 0 insertions, 4457 deletions
diff --git a/src/main/java/gtPlusPlus/RoadMap.java b/src/main/java/gtPlusPlus/RoadMap.java deleted file mode 100644 index e10c40d1cf..0000000000 --- a/src/main/java/gtPlusPlus/RoadMap.java +++ /dev/null @@ -1,47 +0,0 @@ -package gtPlusPlus; - -/** - * This Class purely exists to note down ideas and or plans to (re)implement things. - * - * @author Alkalus - * - */ -public class RoadMap { - - // Reorganization of Item, Block and Common Class loading. - /* - * So, due to the complex/silly way I've done things, I've ran into some circular loading problems around the mod. - * Issues occur where Classes like CI.java try access the GregtechItemList.java objects before they're actually set. - * A plan should be created to organize the best scheme to load things in the best order. - */ - - // Recreation of GUIs for all Multiblocks - /* - * Most Multi's use generic or straight out wrong GUI's on the controller. I'd like to go back and recreate all of - * these. Some could even benefit from a totally new type of UI (Instead of Text issues, just change a 2x2px area - * between red and green for status lights) These advanced GUIs are probably out of my capability, but if anyone - * thinks they're a good idea, I'll give them a go. - */ - - // Better Integration with GTNH - /* - * Refactor things to be more common, refactor things to automatically switch between GTNH and standard variants - * without having to over-abuse CORE.GTNH switches everywhere. Most of this can be done via expanding CI.java, so - * that we have automated handlers for everything (IE. getX(5) will get 5x of the correct version of X) - */ - - /* - * Thallium - Everglades only. (Mostly useless) Technetium - Has some recipes but seem to be dead ends so - * unobtainable. Polonium - Unobtainable. (Radioactive, Mostly Useless) Francium - Unobtainable. (Radioactive, - * Mostly Useless) Promethium - Unobtainable. Radium - Everglades only. (Do use, Moderately Rare) Actinium - - * Unobtainable. (Radioactive, Do use) Proactinium - Unobtainable. (Do use) Neptunium - Has some recipes but seem to - * be dead ends so unobtainable. Curium - Fusion only. Berkelium - Unobtainable. Californium - Fusion only. - * Einsteinium - Unobtainable. Fermium - Unobtainable. Strontium - Everglades only. (Do use 1) Iodine - Everglades - * only. Dysprosium - Everglades only. (Do use 1) Rhenium - Weird ABS recipe only. Flerovium - Unobtainable. Dubnium - * - Unobtainable. Seaborgium - Unobtainable. Bohrium - Unobtainable. Hassium - Unobtainable. Meitnerium - - * Unobtainable. Darmstadtium - Unobtainable. Roentgenium - Unobtainable. Copernicium - Unobtainable. Nihonium - - * Unobtainable. Moscovium - Unobtainable. Livermorium - Unobtainable. Tennessine - Unobtainable. Nobelium - - * Unobtainable. Lawrencium - Unobtainable. Astatine - Unobtainable. (Radioactive, Mostly Useless) - */ - -} diff --git a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java deleted file mode 100644 index 4bfa15855c..0000000000 --- a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java +++ /dev/null @@ -1,80 +0,0 @@ -package gtPlusPlus.api.helpers; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import net.minecraft.item.ItemStack; - -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.util.minecraft.ItemUtils; - -public class MaterialHelper { - - public static ItemStack getComponentFromMaterial(OrePrefixes oreprefix, Material material, int amount) { - return ItemUtils.getOrePrefixStack(oreprefix, material, amount); - } - - /** - * Generates a 16 Fluid Pipe - * - * @see {@code Example: Copper 16x Pipe (Materials.Copper, Materials.Copper.mName, "Copper", ID, 60, 1000, true)} - * @param aMaterial - Pipe Material - * @param name - Pipe Internal name - * @param displayName - Pipe Display Name - * @param aID - Pipe's Meta ID - * @param baseCapacity - Pipes Base Capacity - * @param heatCapacity - Pipe Max Temp - * @param gasProof - Is Gas Proof? - * @return A boolean which corresponds to whether or not the Pipe was registered to the Ore Dictionary. - */ - public static boolean generateHexadecuplePipe(Materials aMaterial, String name, String displayName, int aID, - int baseCapacity, int heatCapacity, boolean gasProof) { - try { - Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class; - Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor( - new Class[] { int.class, String.class, String.class, float.class, Materials.class, int.class, - int.class, boolean.class, int.class }); - if (constructor != null) { - GT_MetaPipeEntity_Fluid aPipe; - aPipe = constructor.newInstance( - aID, - "GT_Pipe_" + name + "_Hexadecuple", - "Hexadecuple " + displayName + " Fluid Pipe", - 1.0F, - aMaterial, - baseCapacity, - heatCapacity, - gasProof, - 16); - return GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L)); - } - - } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException - | IllegalArgumentException | InvocationTargetException e) {} - return false; - } - - public static ItemStack getCells(Materials aMaterial, int i) { - return ItemUtils.getOrePrefixStack(OrePrefixes.cell, aMaterial, i); - } - - public static ItemStack getDust(Materials aMaterial, int i) { - return ItemUtils.getOrePrefixStack(OrePrefixes.dust, aMaterial, i); - } - - public static ItemStack getDustSmall(Materials aMaterial, int i) { - return ItemUtils.getOrePrefixStack(OrePrefixes.dustSmall, aMaterial, i); - } - - public static ItemStack getDustTiny(Materials aMaterial, int i) { - return ItemUtils.getOrePrefixStack(OrePrefixes.dustTiny, aMaterial, i); - } - - public static ItemStack getGems(Materials aMaterial, int i) { - return ItemUtils.getOrePrefixStack(OrePrefixes.gem, aMaterial, i); - } -} diff --git a/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java b/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java deleted file mode 100644 index e3aa00e7a1..0000000000 --- a/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java +++ /dev/null @@ -1,20 +0,0 @@ -package gtPlusPlus.api.interfaces; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.minecraft.BlockPos; - -public interface IEntityCatcher { - - public boolean hasEntity(ItemStack aStack); - - public Entity getStoredEntity(World aWorld, ItemStack aStack); - - public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity); - - public Class<? extends Entity> getStoredEntityClass(ItemStack aStack); - - public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos); -} diff --git a/src/main/java/gtPlusPlus/api/interfaces/IToolable.java b/src/main/java/gtPlusPlus/api/interfaces/IToolable.java deleted file mode 100644 index d696585b76..0000000000 --- a/src/main/java/gtPlusPlus/api/interfaces/IToolable.java +++ /dev/null @@ -1,22 +0,0 @@ -package gtPlusPlus.api.interfaces; - -public interface IToolable { - - public boolean isScrewdriverable(); - - public boolean onScrewdriverLMB(); - - public boolean onScrewdriverRMB(); - - public boolean isWrenchable(); - - public boolean onWrenchLMB(); - - public boolean onWrenchRMB(); - - public boolean isMalletable(); - - public boolean onMalletLMB(); - - public boolean onMalletRMB(); -} diff --git a/src/main/java/gtPlusPlus/api/objects/GregtechException.java b/src/main/java/gtPlusPlus/api/objects/GregtechException.java deleted file mode 100644 index 083a15f790..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/GregtechException.java +++ /dev/null @@ -1,25 +0,0 @@ -package gtPlusPlus.api.objects; - -public class GregtechException extends Throwable { - - private static final long serialVersionUID = 3601884582161841486L; - - public GregtechException(String aError) { - this(aError, true); - } - - public GregtechException(String aError, boolean aIsVerbose) { - Logger.ERROR("Throwing GT++ Exception!"); - Logger.ERROR("[EXCEPTION] " + aError); - if (aIsVerbose) { - Logger.INFO("Throwing GT++ Exception!"); - Logger.INFO("[EXCEPTION] " + aError); - printStackTrace(); - } - } - - @Override - public void printStackTrace() { - super.printStackTrace(); - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java b/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java deleted file mode 100644 index 1d6cad3a38..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentHashSet.java +++ /dev/null @@ -1,17 +0,0 @@ -package gtPlusPlus.api.objects.data; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -public class ConcurrentHashSet<V> extends ConcurrentSet<V> { - - private static final long serialVersionUID = -1293478938482781728L; - - public ConcurrentHashSet() { - this(new ConcurrentHashMap<Integer, V>()); - } - - public ConcurrentHashSet(ConcurrentMap<Integer, V> defaultMapType) { - super(defaultMapType); - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java b/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java deleted file mode 100644 index aaa759edfa..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/data/ConcurrentSet.java +++ /dev/null @@ -1,53 +0,0 @@ -package gtPlusPlus.api.objects.data; - -import java.io.Serializable; -import java.util.AbstractSet; -import java.util.Iterator; -import java.util.concurrent.ConcurrentMap; - -public abstract class ConcurrentSet<E> extends AbstractSet<E> implements Serializable { - - private static final long serialVersionUID = -6761513279741915432L; - - private final ConcurrentMap<Integer, E> mInternalMap; - - private int mInternalID = 0; - - /** - * Creates a new instance which wraps the specified {@code map}. - */ - public ConcurrentSet(ConcurrentMap<Integer, E> aMap) { - mInternalMap = aMap; - } - - @Override - public int size() { - return mInternalMap.size(); - } - - @Override - public boolean contains(Object o) { - return mInternalMap.containsKey(o); - } - - @Override - public boolean add(E o) { - return mInternalMap.putIfAbsent(mInternalID++, o) == null; - } - - @Override - public boolean remove(Object o) { - return mInternalMap.remove(o) != null; - } - - @Override - public void clear() { - this.mInternalID = 0; - mInternalMap.clear(); - } - - @Override - public Iterator<E> iterator() { - return mInternalMap.values().iterator(); - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java b/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java deleted file mode 100644 index 8ec21dab59..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/data/FlexiblePair.java +++ /dev/null @@ -1,39 +0,0 @@ -package gtPlusPlus.api.objects.data; - -import java.io.Serializable; - -import com.google.common.base.Objects; - -public class FlexiblePair<K, V> implements Serializable { - - /** - * SVUID - */ - private static final long serialVersionUID = 1250550491092812443L; - - private final K key; - private V value; - - public FlexiblePair(final K key, final V value) { - this.key = key; - this.value = value; - } - - public final K getKey() { - return this.key; - } - - public final V getValue() { - return this.value; - } - - public final void setValue(V aObj) { - value = aObj; - } - - @Override - public int hashCode() { - Integer aCode = Objects.hashCode(getKey(), getValue()); - return aCode != null ? aCode : super.hashCode(); - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java deleted file mode 100644 index 4af3df18ba..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeBlockPos.java +++ /dev/null @@ -1,272 +0,0 @@ -package gtPlusPlus.api.objects.minecraft; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -import gtPlusPlus.api.objects.data.AutoMap; - -public class FakeBlockPos extends BlockPos { - - private static final long serialVersionUID = -6442245826092414593L; - private transient Block aBlockAtPos; - private int aBlockMetaAtPos = 0; - - public static FakeBlockPos generateBlockPos(String sUUID) { - String[] s2 = sUUID.split("@"); - return new FakeBlockPos(s2); - } - - public FakeBlockPos(String[] s) { - this(Integer.parseInt(s[1]), Integer.parseInt(s[2]), Integer.parseInt(s[3]), Integer.parseInt(s[0])); - } - - public FakeBlockPos(int x, int y, int z, Block aBlock, int aMeta) { - this(x, y, z, 0); - aBlockAtPos = aBlock; - aBlockMetaAtPos = aMeta; - } - - private FakeBlockPos(int x, int y, int z, int dim) { - this(x, y, z, DimensionManager.getWorld(dim)); - } - - private FakeBlockPos(int x, int y, int z, World dim) { - super(x, y, z, null); - } - - @Override - public String getLocationString() { - String S = "" + this.xPos + "@" + this.yPos + "@" + this.zPos; - return S; - } - - @Override - public String getUniqueIdentifier() { - String S = "" + this.xPos - + "@" - + this.yPos - + "@" - + this.zPos - + this.aBlockAtPos.getLocalizedName() - + "@" - + this.aBlockMetaAtPos; - return S; - } - - @Override - public int hashCode() { - int hash = 5; - hash += (13 * this.xPos); - hash += (19 * this.yPos); - hash += (31 * this.zPos); - hash += (17 * this.dim); - return hash; - } - - @Override - public boolean equals(Object other) { - if (other == null) { - return false; - } - if (other == this) { - return true; - } - if (!(other instanceof FakeBlockPos)) { - return false; - } - FakeBlockPos otherPoint = (FakeBlockPos) other; - return this.xPos == otherPoint.xPos && this.yPos == otherPoint.yPos && this.zPos == otherPoint.zPos; - } - - public int distanceFrom(FakeBlockPos target) { - if (target.dim != this.dim) { - return Short.MIN_VALUE; - } - return distanceFrom(target.xPos, target.yPos, target.zPos); - } - - /** - * - * @param x X coordinate of target. - * @param y Y coordinate of target. - * @param z Z coordinate of target. - * @return square of distance - */ - @Override - public int distanceFrom(int x, int y, int z) { - int distanceX = this.xPos - x; - int distanceY = this.yPos - y; - int distanceZ = this.zPos - z; - return distanceX * distanceX + distanceY * distanceY + distanceZ * distanceZ; - } - - public boolean isWithinRange(FakeBlockPos target, int range) { - if (target.dim != this.dim) { - return false; - } - return isWithinRange(target.xPos, target.yPos, target.zPos, range); - } - - @Override - public boolean isWithinRange(int x, int y, int z, int range) { - return distanceFrom(x, y, z) <= (range * range); - } - - @Override - public FakeBlockPos getUp() { - return new FakeBlockPos(this.xPos, this.yPos + 1, this.zPos, this.dim); - } - - @Override - public FakeBlockPos getDown() { - return new FakeBlockPos(this.xPos, this.yPos - 1, this.zPos, this.dim); - } - - @Override - public FakeBlockPos getXPos() { - return new FakeBlockPos(this.xPos + 1, this.yPos, this.zPos, this.dim); - } - - @Override - public FakeBlockPos getXNeg() { - return new FakeBlockPos(this.xPos - 1, this.yPos, this.zPos, this.dim); - } - - @Override - public FakeBlockPos getZPos() { - return new FakeBlockPos(this.xPos, this.yPos, this.zPos + 1, this.dim); - } - - @Override - public FakeBlockPos getZNeg() { - return new FakeBlockPos(this.xPos, this.yPos, this.zPos - 1, this.dim); - } - - @Override - public AutoMap<BlockPos> getSurroundingBlocks() { - AutoMap<BlockPos> sides = new AutoMap<BlockPos>(); - sides.put(getUp()); - sides.put(getDown()); - sides.put(getXPos()); - sides.put(getXNeg()); - sides.put(getZPos()); - sides.put(getZNeg()); - return sides; - } - - @Override - public Block getBlockAtPos() { - return getBlockAtPos(this); - } - - public Block getBlockAtPos(FakeBlockPos pos) { - return getBlockAtPos(world, pos); - } - - public Block getBlockAtPos(World world, FakeBlockPos pos) { - return aBlockAtPos; - } - - @Override - public int getMetaAtPos() { - return getMetaAtPos(this); - } - - public int getMetaAtPos(FakeBlockPos pos) { - return getMetaAtPos(world, pos); - } - - public int getMetaAtPos(World world, FakeBlockPos pos) { - return aBlockMetaAtPos; - } - - @Override - public boolean hasSimilarNeighbour() { - return hasSimilarNeighbour(false); - } - - /** - * @param strict - Does this check Meta Data? - * @return - Does this block have a neighbour that is the same? - */ - @Override - public boolean hasSimilarNeighbour(boolean strict) { - for (BlockPos g : getSurroundingBlocks().values()) { - if (getBlockAtPos(g) == getBlockAtPos()) { - if (!strict) { - return true; - } else { - if (getMetaAtPos() == getMetaAtPos(g)) { - return true; - } - } - } - } - return false; - } - - @Override - public AutoMap<BlockPos> getSimilarNeighbour() { - return getSimilarNeighbour(false); - } - - /** - * @param strict - Does this check Meta Data? - * @return - Does this block have a neighbour that is the same? - */ - @Override - public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) { - AutoMap<BlockPos> sides = new AutoMap<BlockPos>(); - for (BlockPos g : getSurroundingBlocks().values()) { - if (getBlockAtPos(g) == getBlockAtPos()) { - if (!strict) { - sides.put(g); - } else { - if (getMetaAtPos() == getMetaAtPos(g)) { - sides.put(g); - } - } - } - } - return sides; - } - - @Override - public Set<BlockPos> getValidNeighboursAndSelf() { - AutoMap<BlockPos> h = getSimilarNeighbour(true); - h.put(this); - Set<BlockPos> result = new HashSet<BlockPos>(); - for (BlockPos f : h.values()) { - result.add(f); - } - return result; - } - - /** - * Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right - * now. Modder may implement this for custom plants. This does not use ForgeDirection, because large/huge trees can - * be located in non-representable direction, so the source location is specified. Currently this just changes the - * block to dirt if it was grass. - * - * Note: This happens DURING the generation, the generation may not be complete when this is called. - * - * @param world Current world - * @param x Soil X - * @param y Soil Y - * @param z Soil Z - * @param sourceX Plant growth location X - * @param sourceY Plant growth location Y - * @param sourceZ Plant growth location Z - */ - public void onPlantGrow(FakeWorld world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) { - if (getBlockAtPos() == Blocks.grass || getBlockAtPos() == Blocks.farmland) { - this.aBlockAtPos = Blocks.dirt; - this.aBlockMetaAtPos = 0; - } - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java b/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java deleted file mode 100644 index be158a38cd..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/FakeWorld.java +++ /dev/null @@ -1,154 +0,0 @@ -package gtPlusPlus.api.objects.minecraft; - -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.util.ForgeDirection; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class FakeWorld implements IBlockAccess { - - public static HashMap<String, FakeBlockPos> mStaticFakeWorldData; - - public HashMap<String, FakeBlockPos> mFakeWorldData = new HashMap<String, FakeBlockPos>(); - - /** - * Must be an odd number - */ |
