Skip to content

Commit

Permalink
fix: Apply implicit components (probably not necessary in my case but…
Browse files Browse the repository at this point in the history
… may as well)
  • Loading branch information
BlayTheNinth committed May 23, 2024
1 parent db22ca7 commit 9af5c76
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ protected ResourceLocation getWaystoneType() {
return WaystoneTypes.WARP_PLATE;
}

@Override
protected void applyImplicitComponents(DataComponentInput input) {
super.applyImplicitComponents(input);
if (input.get(ModComponents.warpPlateCompletedFirstAttunement.get()) != null) {
completedFirstAttunement = true;
}
}

@Override
protected void collectImplicitComponents(DataComponentMap.Builder builder) {
super.collectImplicitComponents(builder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public int getCount() {
private final NonNullList<ItemStack> items = NonNullList.withSize(5, ItemStack.EMPTY);

private boolean readyForAttunement;
private boolean completedFirstAttunement;
protected boolean completedFirstAttunement;

protected int attunementTicks;
private Waystone waystone = InvalidWaystone.INSTANCE;
Expand Down Expand Up @@ -109,6 +109,14 @@ public void loadAdditional(CompoundTag compound, HolderLookup.Provider provider)
completedFirstAttunement = compound.getBoolean("CompletedFirstAttunement");
}

@Override
protected void applyImplicitComponents(DataComponentInput input) {
final var waystoneUidComponent = input.get(ModComponents.waystone.get());
if (waystoneUidComponent != null) {
waystoneUid = waystoneUidComponent;
}
}

@Override
protected void collectImplicitComponents(DataComponentMap.Builder builder) {
builder.set(ModComponents.waystone.get(), waystone.isValid() ? waystone.getWaystoneUid() : waystoneUid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.mojang.blaze3d.systems.RenderSystem;
import net.blay09.mods.balm.api.Balm;
import net.blay09.mods.waystones.Waystones;
import net.blay09.mods.waystones.api.WaystoneTypes;
import net.blay09.mods.waystones.client.gui.widget.ITooltipProvider;
import net.blay09.mods.waystones.client.gui.widget.WaystoneVisbilityButton;
import net.blay09.mods.waystones.core.WaystoneVisibilities;
Expand All @@ -18,7 +17,6 @@
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import org.lwjgl.glfw.GLFW;
Expand Down

0 comments on commit 9af5c76

Please sign in to comment.