Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thepigcat76 committed Dec 22, 2024
2 parents d450933 + ef9acf1 commit 5d60573
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ public class MutatorBlockEntity extends LaserBlockEntity implements MenuProvider

public MutatorBlockEntity(BlockPos blockPos, BlockState blockState) {
super(NTBlockEntityTypes.MUTATOR.get(), blockPos, blockState);
addItemHandler(3, 1, (slot, stack) -> (slot == 0 && stack.getItem() instanceof PetriDishItem) || slot == 1 || slot == 2);
addItemHandler(3, (slot) -> {
if (slot == 0 || slot == 1) {
return 1;
} else {
return 64;
}
}, (slot, stack) -> (slot == 0 && stack.getItem() instanceof PetriDishItem) || slot == 1 || slot == 2);
}

@Override
Expand All @@ -56,13 +62,13 @@ public void commonTick() {

ItemStack result = extracted.copy();

// Bacteria bacteria = BacteriaHelper.getBacteria(getLevel().getServer().registryAccess(), extracted.get(NTDataComponents.BACTERIA).bacteria());
// bacteria.stats().rollStats();
//
// result.set(NTDataComponents.BACTERIA, new ComponentBacteriaStorage(
// NTBacterias.EMPTY,
// 1
// ));
Bacteria bacteria = BacteriaHelper.getBacteria(getLevel().getServer().registryAccess(), extracted.get(NTDataComponents.BACTERIA).bacteria());
bacteria.stats().rollStats();

result.set(NTDataComponents.BACTERIA, new ComponentBacteriaStorage(
NTBacterias.EMPTY,
1
));

getItemHandler().insertItem(1, result, false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public MutatorMenu(int containerId, Inventory inv, FriendlyByteBuf extraData) {
public MutatorMenu(int containerId, @NotNull Inventory inv, @NotNull MutatorBlockEntity blockEntity) {
super(NTMenuTypes.MUTATOR.get(), containerId, inv, blockEntity);
// Input
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 0, 25, 25));
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 0, 26, 25));

// Output
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 1, 133, 25));
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 1, 134, 25));

// Catalyst
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 2, 79, 54));
addSlot(new SlotItemHandler(blockEntity.getItemHandler(), 2, 80, 54));

addPlayerInventory(inv, 84);
addPlayerHotbar(inv, 142);
Expand Down
Binary file modified src/main/resources/assets/nautec/textures/gui/mutator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5d60573

Please sign in to comment.