abstracted out side buttons (thanks to this they also work on ctrls now)

This commit is contained in:
Raoul Van den Berge
2015-12-20 16:43:56 +01:00
parent d57618f990
commit 23a9b358bf
18 changed files with 322 additions and 158 deletions

View File

@@ -0,0 +1,31 @@
package storagecraft.gui.sidebutton;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import storagecraft.StorageCraft;
import storagecraft.gui.GuiBase;
import storagecraft.network.MessageRedstoneModeUpdate;
import storagecraft.tile.IRedstoneControllable;
public class SideButtonRedstoneMode extends SideButton {
private IRedstoneControllable control;
public SideButtonRedstoneMode(IRedstoneControllable control) {
this.control = control;
}
@Override
public String getTooltip(GuiBase gui) {
return gui.t("misc.storagecraft:redstoneMode." + control.getRedstoneMode().id);
}
@Override
public void draw(GuiBase gui, int x, int y) {
gui.drawItem(x, y, new ItemStack(Items.redstone, 1));
}
@Override
public void actionPerformed() {
StorageCraft.NETWORK.sendToServer(new MessageRedstoneModeUpdate(control));
}
}