-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.1.4 fixes (after dev build 01) (#1006)
* fix: filter covers no longer reset their filter mode on opening UI * fix: don't expose creative tank slot as a capability * feat: add infinite source/sink capability to creative tanks * fix: use correct underlying fluid/item transfers in pumps & conveyors * chore: changelog * fix: don't expose creative chest slot as a capability & add cap proxy * chore: oops. * fix: crash when defining a custom coil type
- Loading branch information
Showing
9 changed files
with
122 additions
and
7 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
39 changes: 39 additions & 0 deletions
39
src/main/java/com/gregtechceu/gtceu/api/transfer/fluid/InfiniteFluidTransferProxy.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.gregtechceu.gtceu.api.transfer.fluid; | ||
|
||
import com.lowdragmc.lowdraglib.side.fluid.FluidStack; | ||
import com.lowdragmc.lowdraglib.side.fluid.IFluidTransfer; | ||
import net.minecraft.MethodsReturnNonnullByDefault; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
|
||
@MethodsReturnNonnullByDefault | ||
@ParametersAreNonnullByDefault | ||
public class InfiniteFluidTransferProxy extends FluidTransferDelegate { | ||
private final boolean infiniteSource; | ||
private final boolean infiniteSink; | ||
|
||
public InfiniteFluidTransferProxy(IFluidTransfer delegate, boolean infiniteSource, boolean infiniteSink) { | ||
super(delegate); | ||
|
||
this.infiniteSource = infiniteSource; | ||
this.infiniteSink = infiniteSink; | ||
} | ||
|
||
@Override | ||
public long fill(int tank, FluidStack resource, boolean simulate, boolean notifyChanges) { | ||
if (infiniteSink) | ||
return resource.getAmount(); | ||
|
||
return super.fill(tank, resource, simulate, notifyChanges); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public FluidStack drain(int tank, FluidStack resource, boolean simulate, boolean notifyChanges) { | ||
if (infiniteSource) | ||
return resource.copy(); | ||
|
||
return super.drain(tank, resource, simulate, notifyChanges); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/com/gregtechceu/gtceu/api/transfer/item/InfiniteItemTransferProxy.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.gregtechceu.gtceu.api.transfer.item; | ||
|
||
import com.lowdragmc.lowdraglib.side.item.IItemTransfer; | ||
import net.minecraft.MethodsReturnNonnullByDefault; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
|
||
@MethodsReturnNonnullByDefault | ||
@ParametersAreNonnullByDefault | ||
public class InfiniteItemTransferProxy extends ItemTransferDelegate { | ||
private final boolean infiniteSource; | ||
private final boolean infiniteSink; | ||
|
||
public InfiniteItemTransferProxy(IItemTransfer delegate, boolean infiniteSource, boolean infiniteSink) { | ||
super(delegate); | ||
|
||
this.infiniteSource = infiniteSource; | ||
this.infiniteSink = infiniteSink; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate, boolean notifyChanges) { | ||
if (infiniteSink) | ||
return ItemStack.EMPTY; | ||
|
||
return super.insertItem(slot, stack, simulate, notifyChanges); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public ItemStack extractItem(int slot, int amount, boolean simulate, boolean notifyChanges) { | ||
if (infiniteSource) | ||
return delegate.getStackInSlot(slot).copyWithCount(amount); | ||
|
||
return super.extractItem(slot, amount, simulate, notifyChanges); | ||
} | ||
} |
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