Sack finished i think? for now...

This commit is contained in:
Flanks255 2024-03-06 12:59:34 -06:00
parent e125e80e8c
commit 38f4824757
4 changed files with 14 additions and 9 deletions

View file

@ -25,6 +25,7 @@ import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.ClickType;
import net.minecraft.world.inventory.ContainerListener;
import net.minecraft.world.inventory.Slot; import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.Dist;
@ -105,13 +106,12 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
} }
} }
@Override /* @Override
public void broadcastChanges() { // TODO is this needed anymore? public void broadcastChanges() { // TODO is this needed anymore?
super.broadcastChanges(); super.broadcastChanges();
if (this.filter.needsUpdateSend() || this.autoInsert != this.oldAutoInsert) { if (this.filter.needsUpdateSend() || this.autoInsert != this.oldAutoInsert) {
/* for (ContainerListener listener : this..containerListeners) {
for (IContainerListener listener : this.containerListeners) {
listener.setContainerData(this, 0, this.filter.isWhitelist listener.setContainerData(this, 0, this.filter.isWhitelist
? 1 ? 1
: 0); : 0);
@ -129,7 +129,6 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
? 1 ? 1
: 0); : 0);
} }
*/
this.filter.updateLasts(); this.filter.updateLasts();
this.oldAutoInsert = this.autoInsert; this.oldAutoInsert = this.autoInsert;
} }
@ -145,7 +144,7 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
} else if (id == 2) { } else if (id == 2) {
this.filter.respectMod = data == 1; this.filter.respectMod = data == 1;
} }
} }*/
@Override @Override
public ItemStack quickMoveStack(@Nonnull Player player, int slot) { public ItemStack quickMoveStack(@Nonnull Player player, int slot) {

View file

@ -41,11 +41,17 @@ public class FilterSettingsGui {
public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer<AbstractButton> buttonConsumer, int idOffset) { public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer<AbstractButton> buttonConsumer, int idOffset) {
this.theSettings = settings; this.theSettings = settings;
this.whitelistButton = Button.builder(Component.literal("WH"), $ -> buttonClicked(idOffset)) this.whitelistButton = Button.builder(Component.literal("WH"), $ -> {
theSettings.isWhitelist = !theSettings.isWhitelist;
buttonClicked(idOffset);
})
.bounds(x, y, 16, 12).build(); .bounds(x, y, 16, 12).build();
buttonConsumer.accept(this.whitelistButton); buttonConsumer.accept(this.whitelistButton);
y += 14; y += 14;
this.modButton = Button.builder(Component.literal("MO"), $ -> buttonClicked(idOffset + 1)) this.modButton = Button.builder(Component.literal("MO"), $ -> {
theSettings.respectMod = !theSettings.respectMod;
buttonClicked(idOffset + 1);
})
.bounds(x, y, 16, 12).build(); .bounds(x, y, 16, 12).build();
buttonConsumer.accept(this.modButton); buttonConsumer.accept(this.modButton);

View file

@ -52,7 +52,7 @@ public class SackGui extends AAScreen<SackContainer> {
public void init() { public void init() {
super.init(); super.init();
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 138, this.topPos + 10, this::addRenderableWidget, 1); this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 137, this.topPos + 10, this::addRenderableWidget, 1);
this.buttonAutoInsert = Button.builder( this.buttonAutoInsert = Button.builder(
Component.literal("I") Component.literal("I")

View file

@ -382,7 +382,7 @@
"item.actuallyadditions.biocoal": "Bio Coal (wip)", "item.actuallyadditions.biocoal": "Bio Coal (wip)",
"item.actuallyadditions.player_probe": "Player Probe (wip)", "item.actuallyadditions.player_probe": "Player Probe (wip)",
"item.actuallyadditions.worm": "Worm", "item.actuallyadditions.worm": "Worm",
"item.actuallyadditions.travelers_sack": "Traveler's Sack (wip)", "item.actuallyadditions.travelers_sack": "Traveler's Sack",
"item.actuallyadditions.bag.storage": "filled slots (wip)", "item.actuallyadditions.bag.storage": "filled slots (wip)",
"item.actuallyadditions.void_sack": "Void Sack (wip)", "item.actuallyadditions.void_sack": "Void Sack (wip)",
"item.actuallyadditions.crystallized_canola_seed": "Crystallized Canola Seed", "item.actuallyadditions.crystallized_canola_seed": "Crystallized Canola Seed",