com.parzivail.util.inventory.StrictSlot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pswg Show documentation
Show all versions of pswg Show documentation
Explore the galaxy with Galaxies: Parzi's Star Wars Mod!
package com.parzivail.util.inventory;
import com.parzivail.util.generics.Consumers;
import java.util.function.Predicate;
import net.minecraft.class_1263;
import net.minecraft.class_1735;
import net.minecraft.class_1799;
public class StrictSlot extends class_1735
{
private final Predicate filter;
private final Runnable onDirty;
public StrictSlot(class_1263 inventory, int index, int x, int y, Predicate filter)
{
this(inventory, index, x, y, filter, Consumers::noop);
}
public StrictSlot(class_1263 inventory, int index, int x, int y, Predicate filter, Runnable onDirty)
{
super(inventory, index, x, y);
this.filter = filter;
this.onDirty = onDirty;
}
@Override
public boolean method_7680(class_1799 stack)
{
return filter.test(stack);
}
@Override
public void method_7668()
{
super.method_7668();
onDirty.run();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy