Skip to content

Commit

Permalink
get rid of selected slot changing in ffa
Browse files Browse the repository at this point in the history
  • Loading branch information
Inf1nityy committed Nov 5, 2024
1 parent 59e3fcb commit 7d10a40
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/com/nexia/ffa/base/BaseFfaUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.nexia.nexus.api.world.util.BoundingBox;
import com.nexia.nexus.api.world.util.Location;
import com.nexia.nexus.builder.implementation.world.entity.projectile.WrappedProjectile;
import io.github.blumbo.inventorymerger.InventoryMerger;
import io.github.blumbo.inventorymerger.saving.SavableInventory;
import net.fabricmc.loader.api.FabricLoader;
import net.kyori.adventure.text.Component;
Expand All @@ -35,8 +34,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.FileWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
Expand Down Expand Up @@ -253,10 +250,11 @@ public void setInventory(NexiaPlayer player){
return;
}

if(layout != null) {
player.unwrap().inventory.replaceWith(layout.asPlayerInventory());
} else {
player.unwrap().inventory.replaceWith(defaultInventory.asPlayerInventory());
for (int i = 0; i < player.unwrap().inventory.getContainerSize(); ++i) {
player.unwrap().inventory.setItem(i,
(layout != null) ?
layout.asPlayerInventory().getItem(i) :
defaultInventory.asPlayerInventory().getItem(i));
}

alterInventory(player);
Expand Down

0 comments on commit 7d10a40

Please sign in to comment.