mezz.jei.api.IGuiHelper Java Examples

The following examples show how to use mezz.jei.api.IGuiHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecipeMapCategory.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
public RecipeMapCategory(RecipeMap<?> recipeMap, IGuiHelper guiHelper) {
    this.recipeMap = recipeMap;
    FluidTank[] importFluidTanks = new FluidTank[recipeMap.getMaxFluidInputs()];
    for (int i = 0; i < importFluidTanks.length; i++)
        importFluidTanks[i] = new FluidTank(16000);
    FluidTank[] exportFluidTanks = new FluidTank[recipeMap.getMaxFluidOutputs()];
    for (int i = 0; i < exportFluidTanks.length; i++)
        exportFluidTanks[i] = new FluidTank(16000);
    this.modularUI = recipeMap.createJeiUITemplate(
        (importItems = new ItemStackHandler(recipeMap.getMaxInputs())),
        (exportItems = new ItemStackHandler(recipeMap.getMaxOutputs())),
        (importFluids = new FluidTankList(false, importFluidTanks)),
        (exportFluids = new FluidTankList(false, exportFluidTanks))
    ).build(new BlankUIHolder(), Minecraft.getMinecraft().player);
    this.modularUI.initWidgets();
    this.backgroundDrawable = guiHelper.createBlankDrawable(modularUI.getWidth(), modularUI.getHeight() * 2 / 3);
}
 
Example #2
Source File: GTJeiMultiRecipeCategory.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public GTJeiMultiRecipeCategory(IGuiHelper helper, String name, Block block) {
	this.name = name;
	displayName = new ItemStack(block).getDisplayName().replace(" Controller", "");
	backgroundTexture = new ResourceLocation(GTMod.MODID, "textures/gui/default.png");
	background = helper.createDrawable(backgroundTexture, 16, 16, 144, getHeight());
	IDrawableStatic progressPic = helper.createDrawable(backgroundTexture, 176, 0, 20, 18);
	progress = helper.createAnimatedDrawable(progressPic, 150, IDrawableAnimated.StartDirection.LEFT, false);
}
 
Example #3
Source File: MutationRecipeCategory.java    From AgriCraft with MIT License 5 votes vote down vote up
public MutationRecipeCategory(IGuiHelper guiHelper) {
    background = guiHelper.createBlankDrawable(128, 128);
    localizedName = AgriCore.getTranslator().translate("agricraft_nei.mutation.title");
    overlay = guiHelper.createDrawable(
            new ResourceLocation("agricraft", "textures/gui/jei/crop_mutation.png"),
            0, 0, 128, 128
    );
}
 
Example #4
Source File: ProduceRecipeCategory.java    From AgriCraft with MIT License 5 votes vote down vote up
public ProduceRecipeCategory(IGuiHelper guiHelper) {
    background = guiHelper.createBlankDrawable(128, 128);
    localizedName = AgriCore.getTranslator().translate("agricraft_nei.cropProduct.title");
    overlay = guiHelper.createDrawable(
            new ResourceLocation("agricraft", "textures/gui/jei/crop_produce.png"),
            0, 0, 128, 128
    );
}
 
Example #5
Source File: BaseMetalsJEIPlugin.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void register(IModRegistry registry) {

	IItemRegistry itemRegistry = registry.getItemRegistry();
	IJeiHelpers jeiHelpers = registry.getJeiHelpers();
	IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
	
	registry.addRecipeCategories(new JEICrusherRecipeCategory(guiHelper));
	registry.addRecipeHandlers(new CrusherRecipeHandler());
	
	registry.addRecipes(CrusherRecipeRegistry.getInstance().getAllRecipes().stream()
			.map((ICrusherRecipe in)->new CrusherRecipeJEI(Arrays.asList(in.getValidInputs().toArray(new ItemStack[0])), in.getOutput()))
			.collect(Collectors.toList()));
}
 
Example #6
Source File: BaseRecipeCategory.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
protected BaseRecipeCategory(R recipe, IGuiHelper guiHelper, Class<M> moduleClass)
{
    this.recipe = recipe;

    uid = recipe.getUid();
    title = recipe.title;
    gui = recipe.getGui();
    tileEntity = TileEntityRegistry.getContent(recipe.tileEntity);

    Pair<String, M> pair = getModule(moduleClass);
    this.moduleName = pair.getLeft();
    this.module = pair.getRight();

    background = guiHelper.createDrawable(gui.bg, recipe.bgX, recipe.bgY, recipe.bgWidth, recipe.bgHeight);
}
 
Example #7
Source File: GTJeiUUAmplifierCategory.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public GTJeiUUAmplifierCategory(IGuiHelper helper, String name, Block block) {
	this.name = name;
	displayName = "UU-Matter Amplification";
	backgroundTexture = new ResourceLocation(GTMod.MODID, "textures/gui/default.png");
	background = helper.createDrawable(backgroundTexture, 16, 16, 144, getHeight());
	IDrawableStatic progressPic = helper.createDrawable(backgroundTexture, 176, 0, 20, 18);
	progress = helper.createAnimatedDrawable(progressPic, 150, IDrawableAnimated.StartDirection.LEFT, false);
}
 
Example #8
Source File: GTJeiMagicFuelCategory.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public GTJeiMagicFuelCategory(IGuiHelper helper, String name, Block block) {
	this.name = name;
	displayName = "Magic Fuel";
	backgroundTexture = new ResourceLocation(GTMod.MODID, "textures/gui/default.png");
	background = helper.createDrawable(backgroundTexture, 16, 16, 144, getHeight());
	IDrawableStatic progressPic = helper.createDrawable(backgroundTexture, 176, 0, 20, 18);
	progress = helper.createAnimatedDrawable(progressPic, 150, IDrawableAnimated.StartDirection.LEFT, false);
}
 
Example #9
Source File: PrimitiveBlastRecipeCategory.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public PrimitiveBlastRecipeCategory(IGuiHelper guiHelper) {
	super("primitive_blast_furnace",
           "gregtech.machine.primitive_blast_furnace.bronze.name",
           guiHelper.createBlankDrawable(140, 60), guiHelper);

       this.slot = guiHelper.createDrawable(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18, 18, 18);
       this.progressBar = guiHelper.createDrawable(GuiTextures.BRONZE_BLAST_FURNACE_PROGRESS_BAR.imageLocation, 0, 0, 20, 15, 20, 30);
}
 
Example #10
Source File: CokeOvenRecipeCategory.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public CokeOvenRecipeCategory(IGuiHelper guiHelper) {
	super("coke_oven",
           "gregtech.machine.coke_oven.name",
           guiHelper.createBlankDrawable(176, 166), guiHelper);

       this.slot = guiHelper.createDrawable(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18, 18, 18);
       this.progressBar = guiHelper.createDrawable(GuiTextures.BRONZE_BLAST_FURNACE_PROGRESS_BAR.imageLocation, 0, 0, 20, 15, 20, 30);
	this.fluidTank = guiHelper.createDrawable(GuiTextures.FLUID_TANK_BACKGROUND.imageLocation, 0, 0, 20, 58, 20, 58);
	this.fluidTankOverlay = guiHelper.createDrawable(GuiTextures.FLUID_TANK_OVERLAY.imageLocation, 0, 0, 20, 58, 20, 58);
}
 
Example #11
Source File: OreByProductCategory.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public OreByProductCategory(IGuiHelper guiHelper) {
	super("ore_by_product", 
			"recipemap.byproductlist.name", 
			guiHelper.createBlankDrawable(176, 166), 
			guiHelper);

	this.slot = guiHelper.createDrawable(GuiTextures.SLOT.imageLocation, 0, 0, 18, 18, 18, 18);
	this.arrowBackground = guiHelper.createDrawable(GuiTextures.PROGRESS_BAR_ARROW.imageLocation, 0, 0, 20, 20, 20, 40);
	this.arrowForeground = guiHelper.createDrawable(GuiTextures.PROGRESS_BAR_ARROW.imageLocation, 0, 20, 20, 20, 20, 40);
	this.arrowAnimation = guiHelper.createAnimatedDrawable(arrowForeground, 30, StartDirection.LEFT, false);
}
 
Example #12
Source File: JEIIntegration.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@Override
public void registerCategories(IRecipeCategoryRegistration registry) {

    IGuiHelper helper = registry.getJeiHelpers().getGuiHelper();

    registry.addRecipeCategories(new ProcessorCategory(helper), new ShredderCategory(helper),
            new CookerCategory(helper), new FabricatorCategory(helper), new BioreactorCategory(helper),
            new ScaffolderCategory(helper), new CollectorCategory(helper), new BiomassCategory(helper),
            new ScrubberCategory(helper), new AlgaeBioreactorCategory(helper), new InjectorCategory(helper),
            new LightCategory(helper), new HydroponicCategory(helper));
}
 
Example #13
Source File: LatheCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public LatheCategory(IGuiHelper helper) {
	super(helper, TextureResources.latheProgressBar);
}
 
Example #14
Source File: CategoryL2IS.java    From Sakura_mod with MIT License 4 votes vote down vote up
public CategoryL2IS(IGuiHelper helper) {
	  ResourceLocation backgroundTexture = new ResourceLocation(SakuraMain.MODID+":textures/gui/jei_compat.png");
	  this.icon = helper.createDrawableIngredient(new ItemStack(Items.BUCKET));
	  this.background = helper.createDrawable(backgroundTexture, 101, 0, 93, 80);
}
 
Example #15
Source File: MachineRecipeCategory.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
public MachineRecipeCategory(JEIMachineRecipe recipe, IGuiHelper guiHelper)
{
    super(recipe, guiHelper, TileEntityModuleMachine.Supplier.class);
}
 
Example #16
Source File: HammerRecipeCategory.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
public HammerRecipeCategory(IGuiHelper helper)
{
    this.background = helper.createDrawable(texture, 0, 0, 166, 128);
    this.slotHighlight = helper.createDrawable(texture, 166, 0, 18, 18);
}
 
Example #17
Source File: FluidBlockTransformRecipeCategory.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
public FluidBlockTransformRecipeCategory(IGuiHelper helper)
{
    this.background = helper.createDrawable(texture, 0, 0, 166, 63);
}
 
Example #18
Source File: FluidTransformRecipeCategory.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
public FluidTransformRecipeCategory(IGuiHelper helper)
{
    this.background = helper.createDrawable(texture, 0, 0, 166, 63);
    this.slotHighlight = helper.createDrawable(texture, 166, 0, 18, 18);
}
 
Example #19
Source File: FluidOnTopRecipeCategory.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
public FluidOnTopRecipeCategory(IGuiHelper helper)
{
    this.background = helper.createDrawable(texture, 0, 0, 166, 63);
}
 
Example #20
Source File: CompostRecipeCategory.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
public CompostRecipeCategory(IGuiHelper helper)
{
    this.background = helper.createDrawable(texture, 0, 0, 166, 128);
    this.slotHighlight = helper.createDrawable(texture, 166, 0, 18, 18);
}
 
Example #21
Source File: SieveRecipeCategory.java    From ExNihiloAdscensio with MIT License 4 votes vote down vote up
public SieveRecipeCategory(IGuiHelper helper)
{
    this.background = helper.createDrawable(texture, 0, 0, 166, 128);
    this.slotHighlight = helper.createDrawable(texture, 166, 0, 18, 18);
}
 
Example #22
Source File: PrecisionAssemblerCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public PrecisionAssemblerCategory(IGuiHelper helper) {
	super(helper, new ProgressBarImage(168, 41, 11, 15, 67, 42, 11, 15, EnumFacing.DOWN, TextureResources.progressBars));
}
 
Example #23
Source File: SawMillCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public SawMillCategory(IGuiHelper helper) {
	super(helper, TextureResources.cuttingMachineProgressBar);
}
 
Example #24
Source File: FloadRecipeCategory.java    From YouTubeModdingTutorial with MIT License 4 votes vote down vote up
public FloadRecipeCategory(IGuiHelper guiHelper) {
    ResourceLocation location = new ResourceLocation(MyMod.MODID, "textures/gui/floader.png");
    background = guiHelper.createDrawable(location, 3, 18, 90, 30);
}
 
Example #25
Source File: CrystallizerCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public CrystallizerCategory(IGuiHelper helper) {
	super(helper, TextureResources.crystallizerProgressBar);
}
 
Example #26
Source File: RollingMachineCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public RollingMachineCategory(IGuiHelper helper) {
	super(helper, TextureResources.rollingMachineProgressBar);
}
 
Example #27
Source File: PlatePressCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public PlatePressCategory(IGuiHelper helper) {
	super(helper, TextureResources.smallPlatePresser);
}
 
Example #28
Source File: MachineCategoryTemplate.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public MachineCategoryTemplate(IGuiHelper helper, ProgressBarImage bar) {
	//drawTexturedModalRect(3,3, 7, 16, 163, 55);
	background = helper.createDrawable(new ResourceLocation("advancedrocketry:textures/gui/GenericNeiBackground.png"), 7, 16, 163, 55 ); //helper.createDrawable(bar.getResourceLocation(), bar.getBackOffsetX(),
			//bar.getBackOffsetY(), bar.getBackWidth(), bar.getBackHeight());
	this.bar = bar;
}
 
Example #29
Source File: BlastFurnaceCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public BlastFurnaceCategory(IGuiHelper helper) {
	super(helper, TextureResources.arcFurnaceProgressBar);
}
 
Example #30
Source File: ChemicalReactorCategory.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public ChemicalReactorCategory(IGuiHelper helper) {
	super(helper, TextureResources.crystallizerProgressBar);
}