It's a long road, to 1.19
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.10-SNAPSHOT'
|
||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
id 'idea'
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
@@ -31,7 +31,7 @@ public class FluidStackWidget extends AbstractWidget {
|
||||
private final String toolTipTitle;
|
||||
|
||||
public FluidStackWidget(Screen displayOn, Supplier<FluidTank> getFluid, int pX, int pY, int pWidth, int pHeight, String tooltipTitle) {
|
||||
super(pX, pY, pWidth, pHeight, TextComponent.EMPTY);
|
||||
super(pX, pY, pWidth, pHeight, Component.empty());
|
||||
this.displayOn = displayOn;
|
||||
this.getFluid = getFluid;
|
||||
this.toolTipTitle = tooltipTitle;
|
||||
@@ -85,7 +85,7 @@ public class FluidStackWidget extends AbstractWidget {
|
||||
@Override
|
||||
public void renderToolTip(PoseStack poseStack, int mouseX, int mouseY) {
|
||||
if (this.visible && this.isFocused() && isHoveredOrFocused()) {
|
||||
displayOn.renderTooltip(poseStack, Arrays.asList(LangUtils.getTooltipTitle(toolTipTitle), new TextComponent((int) (((float) this.getFluid.get().getAmount() / this.getFluid.get().getCapacity()) * 100) + "%")), Optional.empty(), mouseX, mouseY);
|
||||
displayOn.renderTooltip(poseStack, Arrays.asList(LangUtils.getTooltipTitle(toolTipTitle), Component.literal((int) (((float) this.getFluid.get().getAmount() / this.getFluid.get().getCapacity()) * 100) + "%")), Optional.empty(), mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,6 @@ import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant;
|
||||
import net.fabricmc.fabric.api.transfer.v1.storage.Storage;
|
||||
import net.fabricmc.fabric.api.transfer.v1.storage.StoragePreconditions;
|
||||
import net.fabricmc.fabric.api.transfer.v1.storage.StorageView;
|
||||
import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleViewIterator;
|
||||
import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
@@ -61,6 +60,12 @@ public class FluidTank implements Storage<FluidVariant>, StorageView<FluidVarian
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<StorageView<FluidVariant>> iterator() {
|
||||
// TODO: FIX THIS!
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isResourceBlank() {
|
||||
return fluid.isBlank();
|
||||
@@ -81,11 +86,6 @@ public class FluidTank implements Storage<FluidVariant>, StorageView<FluidVarian
|
||||
return capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<StorageView<FluidVariant>> iterator(TransactionContext transaction) {
|
||||
return SingleViewIterator.create(this, transaction);
|
||||
}
|
||||
|
||||
public CompoundTag writeNbt(CompoundTag compound) {
|
||||
FluidUtils.putFluid(compound, "fluid", getResource());
|
||||
compound.putLong("amt", level);
|
||||
|
@@ -5,7 +5,8 @@
|
||||
"name": "CraterLib",
|
||||
"description": "A library mod used by HypherionSA's Mods",
|
||||
"authors": [
|
||||
"Me!"
|
||||
"HypherionSA",
|
||||
"Misha"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://fabricmc.net/",
|
||||
@@ -28,12 +29,9 @@
|
||||
],
|
||||
"accessWidener": "craterlib.aw",
|
||||
"depends": {
|
||||
"fabricloader": ">=0.12",
|
||||
"fabricloader": ">=0.14",
|
||||
"fabric": "*",
|
||||
"minecraft": "1.18.x",
|
||||
"minecraft": "1.19.x",
|
||||
"java": ">=17"
|
||||
},
|
||||
"suggests": {
|
||||
"another-mod": "*"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user