Start on item transfer, work on forge reverse-abstraction

This commit is contained in:
shedaniel
2021-12-06 01:36:33 +08:00
parent c28bb6bb39
commit 5ee37d5091
21 changed files with 1293 additions and 168 deletions

View File

@@ -183,6 +183,10 @@ public final class FluidStack {
return getFluid() == other.getFluid() && getAmount() == other.getAmount() && isTagEqual(other);
}
public boolean isFluidEqual(FluidStack other) {
return getFluid() == other.getFluid();
}
private boolean isTagEqual(FluidStack other) {
return tag == null ? other.tag == null : other.tag != null && tag.equals(other.tag);
}
@@ -203,6 +207,11 @@ public final class FluidStack {
return FluidStackHooks.write(this, tag);
}
public FluidStack copyWithAmount(long amount) {
if (isEmpty()) return this;
return new FluidStack(fluid, amount, tag);
}
@Environment(EnvType.CLIENT)
@Nullable
public TextureAtlasSprite getStillTexture() {