use of gregtech.common.gui.impl.FakeModularUIContainerClipboard in project GregTech by GregTechCEu.
the class MetaTileEntityClipboard method createFakeGui.
public void createFakeGui() {
// Basically just the original function from the PluginBehavior, but with a lot of now useless stuff stripped out.
try {
GregFakePlayer fakePlayer = new GregFakePlayer(this.getWorld());
fakePlayer.setHeldItem(EnumHand.MAIN_HAND, this.getClipboard());
ModularUI ui = this.createUI(fakePlayer);
ModularUI.Builder builder = new ModularUI.Builder(ui.backgroundPath, ui.getWidth(), ui.getHeight());
builder.shouldColor(false);
List<Widget> widgets = new ArrayList<>(ui.guiWidgets.values());
for (Widget widget : widgets) {
builder.widget(widget);
}
ui = builder.build(ui.holder, ui.entityPlayer);
FakeModularUIContainerClipboard fakeModularUIContainer = new FakeModularUIContainerClipboard(ui, this);
this.guiContainerCache = fakeModularUIContainer;
if (getWorld().isRemote)
this.guiCache = new FakeModularGui(ui, fakeModularUIContainer);
this.writeCustomData(CREATE_FAKE_UI, buffer -> {
});
} catch (Exception e) {
GTLog.logger.error(e);
}
}
Aggregations