aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/api/objects/minecraft
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-05-17 00:01:01 +0900
committerGitHub <noreply@github.com>2023-05-16 17:01:01 +0200
commit04514282c08ebefdb3e68a46db34092f72be2316 (patch)
tree0c9bc99f480f7e7f45a99a55a5b6619ebb5b014b /src/main/java/gtPlusPlus/api/objects/minecraft
parentcd58ff7cd4dc4b5ffe917a24a4b4c6da577f462d (diff)
downloadGT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.gz
GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.bz2
GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.zip
Remove a lot of unused classes (#629)
Diffstat (limited to 'src/main/java/gtPlusPlus/api/objects/minecraft')
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java50
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java41
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java122
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java54
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java108
5 files changed, 0 insertions, 375 deletions
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java
deleted file mode 100644
index 6748b58537..0000000000
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/DimChunkPos.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package gtPlusPlus.api.objects.minecraft;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.Chunk;
-
-public class DimChunkPos {
-
- public final int dimension;
- public final int xPos;
- public final int zPos;
- public final Chunk mainChunk;
-
- public DimChunkPos(World world, BlockPos block) {
- this.dimension = world.provider.dimensionId;
- this.mainChunk = world.getChunkFromBlockCoords(block.xPos, block.zPos);
- this.xPos = this.mainChunk.xPosition;
- this.zPos = this.mainChunk.zPosition;
- }
-
- public DimChunkPos(TileEntity tile) {
- this.dimension = tile.getWorldObj().provider.dimensionId;
- this.mainChunk = tile.getWorldObj().getChunkFromBlockCoords(tile.xCoord, tile.zCoord);
- this.xPos = this.mainChunk.xPosition;
- this.zPos = this.mainChunk.zPosition;
- }
-
- public DimChunkPos(int dim, int x, int z) {
- this.dimension = dim;
- this.xPos = x;
- this.zPos = z;
- Chunk h = Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(dim)
- .getChunkFromChunkCoords(xPos, zPos);
- if (h == null) {
- this.mainChunk = null;
- } else {
- this.mainChunk = h;
- }
- }
-
- public Chunk getChunk() {
- if (this.mainChunk != null) {
- return this.mainChunk;
- }
- Chunk h = Minecraft.getMinecraft().getIntegratedServer().worldServerForDimension(this.dimension)
- .getChunkFromChunkCoords(xPos, zPos);
- return h;
- }
-}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java b/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java
deleted file mode 100644
index b49114e610..0000000000
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/GenericStack.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package gtPlusPlus.api.objects.minecraft;
-
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GenericStack {
-
- private ItemStack mItemStack;
- private FluidStack mFluidStack;
-
- public GenericStack(ItemStack s) {
- this.mItemStack = s;
- this.mFluidStack = null;
- }
-
- public GenericStack(FluidStack f) {
- this.mItemStack = null;
- this.mFluidStack = f;
- }
-
- public GenericStack() {
- this.mItemStack = null;
- this.mFluidStack = null;
- }
-
- public final synchronized FluidStack getFluidStack() {
- return mFluidStack;
- }
-
- public final synchronized ItemStack getItemStack() {
- return mItemStack;
- }
-
- public final synchronized void setItemStack(ItemStack mItemStack) {
- this.mItemStack = mItemStack;
- }
-
- public final synchronized void setFluidStack(FluidStack mFluidStack) {
- this.mFluidStack = mFluidStack;
- }
-}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java b/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java
deleted file mode 100644
index df48c24c06..0000000000
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/NoConflictGTRecipeMap.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package gtPlusPlus.api.objects.minecraft;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_Recipe;
-import gtPlusPlus.api.objects.data.AutoMap;
-
-public class NoConflictGTRecipeMap implements Collection<GT_Recipe> {
-
- private AutoMap<GT_Recipe> mRecipeCache = new AutoMap<GT_Recipe>();
- private final IGregTechTileEntity mMachineType;
-
- public NoConflictGTRecipeMap() {
- this(null);
- }
-
- public NoConflictGTRecipeMap(IGregTechTileEntity tile0) {
- this.mMachineType = tile0;
- }
-
- public boolean put(GT_Recipe recipe) {
- return add(recipe);
- }
-
- @Override
- public boolean add(GT_Recipe recipe) {
- return mRecipeCache.setValue(recipe);
- }
-
- public Collection<GT_Recipe> getRecipeMap() {
- return mRecipeCache.values();
- }
-
- public boolean isMapValidForMachine(IGregTechTileEntity tile) {
- return tile == mMachineType;
- }
-
- @Override
- public boolean addAll(Collection<? extends GT_Recipe> arg0) {
- int a = 0;
- for (Object v : arg0) {
- if (!this.mRecipeCache.containsValue((GT_Recipe) v)) {
- this.mRecipeCache.put((GT_Recipe) v);
- a++;
- }
- }
- return a > 0;
- }
-
- @Override
- public void clear() {
- mRecipeCache.clear();
- }
-
- @Override
- public boolean contains(Object arg0) {
- return mRecipeCache.containsValue((GT_Recipe) arg0);
- }
-
- @Override
- public boolean containsAll(Collection<?> arg0) {
- int a = 0;
- for (Object v : arg0) {
- if (this.mRecipeCache.containsValue((GT_Recipe) v)) {
- a++;
- }
- }
- return a == arg0.size();
- }
-
- @Override
- public boolean isEmpty() {
- return mRecipeCache.isEmpty();
- }
-
- @Override
- public Iterator<GT_Recipe> iterator() {
- return mRecipeCache.iterator();
- }
-
- @Override
- public boolean remove(Object arg0) {
- return mRecipeCache.remove((GT_Recipe) arg0);
- }
-
- @Override
- public boolean removeAll(Collection<?> arg0) {
- int a = 0;
- for (Object v : arg0) {
- if (this.mRecipeCache.containsValue((GT_Recipe) v)) {
- this.mRecipeCache.remove((GT_Recipe) v);
- a++;
- }
- }
- return a > 0;
- }
-
- @Override
- public boolean retainAll(Collection<?> arg0) {
- int mStartSize = this.mRecipeCache.size();
- this.mRecipeCache = (AutoMap<GT_Recipe>) arg0;
- int mEndsize = this.mRecipeCache.size();
- return mStartSize != mEndsize;
- }
-
- @Override
- public int size() {
- return this.mRecipeCache.size();
- }
-
- @Override
- public Object[] toArray() {
- return this.mRecipeCache.toArray();
- }
-
- @Override
- public <T> T[] toArray(T[] arg0) {
- return (T[]) this.mRecipeCache.toArray();
- }
-}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java b/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java
deleted file mode 100644
index 4e4e0e9780..0000000000
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/TexturePackage.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package gtPlusPlus.api.objects.minecraft;
-
-import java.util.LinkedHashMap;
-import java.util.Set;
-
-import net.minecraft.util.IIcon;
-
-import gtPlusPlus.api.objects.data.AutoMap;
-
-public class TexturePackage {
-
- private AutoMap<IIcon> mAnimationArray = new AutoMap<IIcon>();
-
- public IIcon getFrame(int aFrame) {
- if (aFrame < 0 || aFrame >= mAnimationArray.size()) {
- return mAnimationArray.get(0);
- }
- return mAnimationArray.get(aFrame);
- }
-
- public boolean addFrame(IIcon aFrame) {
- if (aFrame != null) {
- return mAnimationArray.add(aFrame);
- }
- return false;
- }
-
- public boolean addFrames(AutoMap<IIcon> aFrames) {
- for (IIcon h : aFrames) {
- if (!addFrame(h)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean addFrames(LinkedHashMap<?, IIcon> aFrames) {
- for (IIcon h : aFrames.values()) {
- if (!addFrame(h)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean addFrames(Set<IIcon> aFrames) {
- for (IIcon h : aFrames) {
- if (!addFrame(h)) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
deleted file mode 100644
index f38a960044..0000000000
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ThreadPooCollector.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package gtPlusPlus.api.objects.minecraft;
-
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import net.minecraft.entity.passive.EntityAnimal;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.Chunk;
-
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.GTplusplus.INIT_PHASE;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector;
-import gtPlusPlus.core.util.Utils;
-
-public class ThreadPooCollector extends Thread {
-
- public boolean canRun = true;
- public boolean isRunning = false;
-
- private static final long INIT_TIME;
- private static long internalTickCounter = 0;
-
- private static final ThreadPooCollector mThread;
- private static final HashMap<String, Pair<BlockPos, TileEntityPooCollector>> mPooCollectors = new LinkedHashMap<String, Pair<BlockPos, TileEntityPooCollector>>();
-
- static {
- mThread = new ThreadPooCollector();
- INIT_TIME = (System.currentTimeMillis());
- }
-
- public ThreadPooCollector() {
- setName("gtpp.handler.poop");
- start();
- }
-
- public static ThreadPooCollector getInstance() {
- return mThread;
- }
-
- public static void addTask(TileEntityPooCollector aTile) {
- BlockPos aTempPos = new BlockPos(aTile);
- mPooCollectors.put(aTempPos.getUniqueIdentifier(), new Pair<BlockPos, TileEntityPooCollector>(aTempPos, aTile));
- }
-
- public static void stopThread() {
- mThread.canRun = false;
- }
-
- @Override
- public void run() {
-
- if (!isRunning) {
- isRunning = true;
- } else {
- return;
- }
-
- while (canRun) {
- if (mPooCollectors.isEmpty() || GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED) {
- continue;
- } else {
- internalTickCounter = Utils.getTicksFromSeconds(
- Utils.getSecondsFromMillis(Utils.getMillisSince(INIT_TIME, System.currentTimeMillis())));
- if (internalTickCounter % 100 == 0) {
- for (Pair<BlockPos, TileEntityPooCollector> pair : mPooCollectors.values()) {
- if (pair != null) {
- BlockPos p = pair.getKey();
- if (p != null) {
- if (p.world != null) {
- World w = p.world;
- if (w == null) {
- continue;
- }
- Chunk c = w.getChunkFromBlockCoords(p.xPos, p.zPos);
- if (c != null) {
- if (c.isChunkLoaded) {
- int startX = p.xPos - 2;
- int startY = p.yPos;
- int startZ = p.zPos - 2;
- int endX = p.xPos + 3;
- int endY = p.yPos + 5;
- int endZ = p.zPos + 3;
- AxisAlignedBB box = AxisAlignedBB
- .getBoundingBox(startX, startY, startZ, endX, endY, endZ);
- if (box != null) {
- @SuppressWarnings("unchecked")
- List<EntityAnimal> animals = w
- .getEntitiesWithinAABB(EntityAnimal.class, box);
- if (animals != null && !animals.isEmpty()) {
- pair.getValue().onPostTick(animals);
- }
- } else {
- continue;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}