From 3c9479e5e8ef7a784abd62b9acd8812dd816c657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salom=C3=A3o?= Date: Thu, 8 Apr 2021 23:56:58 -0300 Subject: [PATCH] switch to a linked list reformatted javadoc re-based --- .../java/gregtech/api/capability/INotifiableHandler.java | 9 ++++----- .../capability/impl/NotifiableFilteredFluidHandler.java | 7 +++---- .../api/capability/impl/NotifiableFluidTank.java | 7 +++---- .../api/capability/impl/NotifiableItemStackHandler.java | 7 +++---- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main/java/gregtech/api/capability/INotifiableHandler.java b/src/main/java/gregtech/api/capability/INotifiableHandler.java index 9cea3f4cd2..c746fdeaa2 100644 --- a/src/main/java/gregtech/api/capability/INotifiableHandler.java +++ b/src/main/java/gregtech/api/capability/INotifiableHandler.java @@ -3,7 +3,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import java.util.Iterator; -import java.util.List; +import java.util.LinkedList; /** * For Item and Fluid handlers capable of notifying entities when @@ -14,6 +14,7 @@ public interface INotifiableHandler { /** * Notifies the entities of the changes in their inventories * An iterator is used to remove invalid TileEntities + * * @param isExport boolean specifying if a handler is an output handler */ @@ -31,13 +32,11 @@ default void notifyMetaTileEntitiesOfChange(boolean isExport) { } /** - * returns a List containing the notifiable MetaTileEntities - * @return + * @return a List containing the notifiable MetaTileEntities */ - List getNotifiableMetaTileEntities(); + LinkedList getNotifiableMetaTileEntities(); /** - * * @param metaTileEntity MetaTileEntity to be notified */ default void addNotifiableMetaTileEntity(MetaTileEntity metaTileEntity) { diff --git a/src/main/java/gregtech/api/capability/impl/NotifiableFilteredFluidHandler.java b/src/main/java/gregtech/api/capability/impl/NotifiableFilteredFluidHandler.java index 6554b4da20..b3aa0dbd6c 100644 --- a/src/main/java/gregtech/api/capability/impl/NotifiableFilteredFluidHandler.java +++ b/src/main/java/gregtech/api/capability/impl/NotifiableFilteredFluidHandler.java @@ -3,12 +3,11 @@ import gregtech.api.capability.INotifiableHandler; import gregtech.api.metatileentity.MetaTileEntity; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedList; public class NotifiableFilteredFluidHandler extends FilteredFluidHandler implements INotifiableHandler { - List entitiesToNotify = new ArrayList<>(); + LinkedList entitiesToNotify = new LinkedList<>(); private final boolean isExport; public NotifiableFilteredFluidHandler(int capacity, MetaTileEntity entityToNotify, boolean isExport) { @@ -24,7 +23,7 @@ protected void onContentsChanged() { } @Override - public List getNotifiableMetaTileEntities() { + public LinkedList getNotifiableMetaTileEntities() { return this.entitiesToNotify; } } diff --git a/src/main/java/gregtech/api/capability/impl/NotifiableFluidTank.java b/src/main/java/gregtech/api/capability/impl/NotifiableFluidTank.java index 764e91b057..d0c3081b5c 100644 --- a/src/main/java/gregtech/api/capability/impl/NotifiableFluidTank.java +++ b/src/main/java/gregtech/api/capability/impl/NotifiableFluidTank.java @@ -4,12 +4,11 @@ import gregtech.api.metatileentity.MetaTileEntity; import net.minecraftforge.fluids.FluidTank; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedList; public class NotifiableFluidTank extends FluidTank implements INotifiableHandler { - List entitiesToNotify = new ArrayList<>(); + LinkedList entitiesToNotify = new LinkedList<>(); private final boolean isExport; public NotifiableFluidTank(int capacity, MetaTileEntity entityToNotify, boolean isExport) { @@ -25,7 +24,7 @@ protected void onContentsChanged() { } @Override - public List getNotifiableMetaTileEntities() { + public LinkedList getNotifiableMetaTileEntities() { return this.entitiesToNotify; } } diff --git a/src/main/java/gregtech/api/capability/impl/NotifiableItemStackHandler.java b/src/main/java/gregtech/api/capability/impl/NotifiableItemStackHandler.java index 12e72eba9e..22186c706c 100644 --- a/src/main/java/gregtech/api/capability/impl/NotifiableItemStackHandler.java +++ b/src/main/java/gregtech/api/capability/impl/NotifiableItemStackHandler.java @@ -5,12 +5,11 @@ import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedList; public class NotifiableItemStackHandler extends ItemStackHandler implements IItemHandlerModifiable, INotifiableHandler { - List entitiesToNotify = new ArrayList<>(); + LinkedList entitiesToNotify = new LinkedList<>(); private final boolean isExport; public NotifiableItemStackHandler(int slots, MetaTileEntity entityToNotify, boolean isExport) { @@ -26,7 +25,7 @@ public void onContentsChanged(int slot) { } @Override - public List getNotifiableMetaTileEntities() { + public LinkedList getNotifiableMetaTileEntities() { return this.entitiesToNotify; } }