-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add filtering to base handler classes
rename and rework IFilteredHandler for item handlers as well deprecate some classes
- Loading branch information
Showing
15 changed files
with
142 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 3 additions & 31 deletions
34
src/main/java/gregtech/api/capability/impl/NotifiableFilteredFluidHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,11 @@ | ||
package gregtech.api.capability.impl; | ||
|
||
import gregtech.api.capability.INotifiableHandler; | ||
import gregtech.api.metatileentity.MetaTileEntity; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class NotifiableFilteredFluidHandler extends FilteredFluidHandler implements INotifiableHandler { | ||
|
||
List<MetaTileEntity> notifiableEntities = new ArrayList<>(); | ||
private final boolean isExport; | ||
@Deprecated | ||
public class NotifiableFilteredFluidHandler extends NotifiableFluidTank { | ||
|
||
public NotifiableFilteredFluidHandler(int capacity, MetaTileEntity entityToNotify, boolean isExport) { | ||
super(capacity); | ||
this.notifiableEntities.add(entityToNotify); | ||
this.isExport = isExport; | ||
} | ||
|
||
@Override | ||
protected void onContentsChanged() { | ||
super.onContentsChanged(); | ||
for (MetaTileEntity metaTileEntity : notifiableEntities) { | ||
if (metaTileEntity != null && metaTileEntity.isValid()) { | ||
addToNotifiedList(metaTileEntity, this, isExport); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void addNotifiableMetaTileEntity(MetaTileEntity metaTileEntity) { | ||
this.notifiableEntities.add(metaTileEntity); | ||
} | ||
|
||
@Override | ||
public void removeNotifiableMetaTileEntity(MetaTileEntity metaTileEntity) { | ||
this.notifiableEntities.remove(metaTileEntity); | ||
super(capacity, entityToNotify, isExport); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.