Skip to content

Commit

Permalink
Fixed custom seals
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Aug 5, 2023
1 parent fff81b1 commit 9cd117f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx8G
modGroup=com.buuz135
modVersion=3.1.1
modVersion=3.1.2
modBaseName=seals
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.buuz135.seals.network;

import com.buuz135.seals.Seals;
import com.buuz135.seals.config.SealManager;
import com.buuz135.seals.datapack.SealInfo;
import com.buuz135.seals.storage.SealWorldStorage;
import net.minecraft.nbt.CompoundTag;
Expand Down Expand Up @@ -41,7 +42,9 @@ public void handle(Supplier<NetworkEvent.Context> contextSupplier) {
contextSupplier.get().enqueueWork(() -> {
ServerPlayer entity = contextSupplier.get().getSender();
if (entity.level() instanceof ServerLevel serverLevel) {
SealInfo sealInfo = serverLevel.getRecipeManager().getAllRecipesFor(Seals.SEAL_RECIPE_TYPE.get()).stream().filter(sealInfo1 -> sealInfo1.getSealID().equals(this.seal)).findFirst().orElse(null);
var manager = new SealManager();
manager.setSeals(serverLevel.getRecipeManager().getAllRecipesFor(Seals.SEAL_RECIPE_TYPE.get()));
SealInfo sealInfo = manager.getSeal(this.seal);
if (sealInfo != null && sealInfo.hasAchievedSeal(entity)) {
SealWorldStorage.get(serverLevel).put(entity.getUUID(), seal);
CompoundTag data = SealWorldStorage.get(serverLevel).save(new CompoundTag());
Expand Down

0 comments on commit 9cd117f

Please sign in to comment.