mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 19:05:29 +00:00
Merge branch 'master' into gui-reaper
This commit is contained in:
4 files changed
+86
-44
No files matched your search
+7
-7
@@ -34,30 +34,30 @@
|
||||
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
||||
*/
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.6-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:NotEnoughItems:2.8.20-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:99:dev')
|
||||
api('curse.maven:cofh-core-69162:2388751')
|
||||
api('com.github.GTNewHorizons:waila:1.9.0:dev')
|
||||
api('com.github.GTNewHorizons:waila:1.9.2:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.7.0:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.7:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.0-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.17:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.0:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.20:dev') {
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.3:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.65:dev') {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||
}
|
||||
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.0-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.2-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.14-GTNH:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.2:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.3:dev") { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.44'
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IMemoryCard;
|
||||
import appeng.api.implementations.tiles.ITileStorageMonitorable;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
@@ -48,7 +49,6 @@ import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.ticking.IGridTickable;
|
||||
import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
@@ -305,6 +305,16 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartP2PTunnel<?> applyMemoryCard(EntityPlayer player, IMemoryCard memoryCard, ItemStack is) {
|
||||
PartP2PTunnel<?> newTunnel = super.applyMemoryCard(player, memoryCard, is);
|
||||
NBTTagCompound data = memoryCard.getData(is);
|
||||
if (newTunnel instanceof PartFluidP2PInterface p2PInterface) {
|
||||
p2PInterface.duality.getConfigManager().readFromNBT(data);
|
||||
}
|
||||
return newTunnel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToWorld() {
|
||||
super.addToWorld();
|
||||
@@ -338,41 +348,7 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate(final EntityPlayer p, final Vec3 pos) {
|
||||
AppEngInternalInventory patterns = this.duality.getPatterns();
|
||||
|
||||
if (super.onPartActivate(p, pos)) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
for (int i = 0; i < patterns.getSizeInventory(); i++) {
|
||||
if (patterns.getStackInSlot(i) == null) continue;
|
||||
drops.add(patterns.getStackInSlot(i));
|
||||
}
|
||||
|
||||
final IPart tile = this.getHost().getPart(this.getSide());
|
||||
if (tile instanceof PartFluidP2PInterface dualTile) {
|
||||
DualityInterface newDuality = dualTile.duality;
|
||||
// Copy interface storage, upgrades, and settings over
|
||||
UpgradeInventory upgrades = (UpgradeInventory) duality.getInventoryByName("upgrades");
|
||||
dualTile.duality.getStorage();
|
||||
UpgradeInventory newUpgrade = (UpgradeInventory) newDuality.getInventoryByName("upgrades");
|
||||
for (int i = 0; i < upgrades.getSizeInventory(); ++i) {
|
||||
newUpgrade.setInventorySlotContents(i, upgrades.getStackInSlot(i));
|
||||
}
|
||||
|
||||
if (!duality.sharedInventory) {
|
||||
IInventory storage = duality.getStorage();
|
||||
IInventory newStorage = newDuality.getStorage();
|
||||
for (int i = 0; i < storage.getSizeInventory(); ++i) {
|
||||
newStorage.setInventorySlotContents(i, storage.getStackInSlot(i));
|
||||
}
|
||||
}
|
||||
|
||||
IConfigManager config = duality.getConfigManager();
|
||||
config.getSettings().forEach(
|
||||
setting -> newDuality.getConfigManager().putSetting(setting, config.getSetting(setting)));
|
||||
}
|
||||
TileEntity te = getTileEntity();
|
||||
Platform.spawnDrops(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, drops);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -392,6 +368,64 @@ public class PartFluidP2PInterface extends PartP2PTunnelStatic<PartFluidP2PInter
|
||||
return true;
|
||||
}
|
||||
|
||||
private void dropPatterns(final PartFluidP2PInterface p2p) {
|
||||
final AppEngInternalInventory patterns = p2p.duality.getPatterns();
|
||||
final List<ItemStack> drops = new ArrayList<>();
|
||||
for (int i = 0; i < patterns.getSizeInventory(); i++) {
|
||||
if (patterns.getStackInSlot(i) == null) continue;
|
||||
drops.add(patterns.getStackInSlot(i));
|
||||
}
|
||||
if (!drops.isEmpty()) {
|
||||
final TileEntity te = p2p.getTileEntity();
|
||||
Platform.spawnDrops(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, drops);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void copyContents(final PartP2PTunnel<?> from) {
|
||||
if (from instanceof PartFluidP2PInterface fromInterface) {
|
||||
DualityInterface newDuality = this.duality;
|
||||
// Copy interface storage, upgrades, and settings over
|
||||
UpgradeInventory upgrades = (UpgradeInventory) fromInterface.duality.getInventoryByName("upgrades");
|
||||
UpgradeInventory newUpgrade = (UpgradeInventory) newDuality.getInventoryByName("upgrades");
|
||||
for (int i = 0; i < upgrades.getSizeInventory(); ++i) {
|
||||
newUpgrade.setInventorySlotContents(i, upgrades.getStackInSlot(i));
|
||||
}
|
||||
|
||||
if (!fromInterface.duality.sharedInventory) {
|
||||
IInventory storage = fromInterface.duality.getStorage();
|
||||
IInventory newStorage = newDuality.getStorage();
|
||||
for (int i = 0; i < storage.getSizeInventory(); ++i) {
|
||||
newStorage.setInventorySlotContents(i, storage.getStackInSlot(i));
|
||||
}
|
||||
}
|
||||
|
||||
AppEngInternalInventory patterns = fromInterface.duality.getPatterns();
|
||||
boolean drop = true;
|
||||
if (!from.isOutput() && !this.isOutput()) { // input to input
|
||||
for (int i = 0; i < patterns.getSizeInventory(); i++) {
|
||||
newDuality.getPatterns().setInventorySlotContents(i, patterns.getStackInSlot(i));
|
||||
}
|
||||
drop = false;
|
||||
}
|
||||
|
||||
if (drop) {
|
||||
this.dropPatterns(fromInterface);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void copySettings(final PartP2PTunnel<?> from) {
|
||||
if (from instanceof PartFluidP2PInterface fromInterface) {
|
||||
DualityInterface newDuality = this.duality;
|
||||
|
||||
IConfigManager config = fromInterface.duality.getConfigManager();
|
||||
config.getSettings()
|
||||
.forEach(setting -> newDuality.getConfigManager().putSetting(setting, config.getSetting(setting)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBreakingTexture() {
|
||||
return this.getItemStack().getIconIndex();
|
||||
|
||||
@@ -43,6 +43,7 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
private final HashMap<IMEMonitorHandlerReceiver, Object> listeners = new HashMap<>();
|
||||
private BaseActionSource mySource;
|
||||
private StorageFilter mode;
|
||||
private boolean init = false;
|
||||
|
||||
public MEMonitorIFluidHandler(IFluidHandler handler, ForgeDirection side) {
|
||||
this.mode = StorageFilter.EXTRACTABLE_ONLY;
|
||||
@@ -223,7 +224,10 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
}
|
||||
|
||||
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out, int iteration) {
|
||||
|
||||
if (!init) {
|
||||
this.onTick();
|
||||
init = true;
|
||||
}
|
||||
for (IAEFluidStack fs : this.cache) {
|
||||
out.addStorage(fs);
|
||||
}
|
||||
@@ -233,6 +237,10 @@ public class MEMonitorIFluidHandler implements IMEMonitor<IAEFluidStack> {
|
||||
|
||||
@Override
|
||||
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request, int iteration) {
|
||||
if (!init) {
|
||||
this.onTick();
|
||||
init = true;
|
||||
}
|
||||
return this.cache.findPrecise(request);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user