mmb.content.stn.STNInventoryController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
/**
*
*/
package mmb.content.stn;
import java.awt.Color;
import javax.swing.JButton;
import mmb.content.stn.network.STNNetworkInventory;
import mmb.engine.inv.Inventory;
import mmb.menu.helper.MenuHelper;
import mmb.menu.world.inv.InventoryController;
/**
* @author oskar
*
*/
public class STNInventoryController extends InventoryController {
private static final long serialVersionUID = 5289202043220848886L;
public STNInventoryController() {
super();
initstn();
}
public STNInventoryController(Inventory out) {
super(out);
initstn();
}
public STNInventoryController(InventoryController other) {
super(other);
initstn();
}
private void initstn() {
JButton rebuild = MenuHelper.newButton("#stnm-reset", Color.orange, e -> {
Inventory inv = getInv();
if(inv instanceof STNNetworkInventory) {
((STNNetworkInventory) inv).rebuild();
}
});
ubox.add(rebuild);
}
}