mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-26 14:53:04 +00:00
Move JEI items out of the way of GuiMultiModule modules
This commit is contained in:
1 parent
eeccb45b16
commit
e2e08b93d8
5 files changed
+71
-1
No files matched your search
@@ -36,6 +36,10 @@ repositories {
|
||||
name 'CB Maven FS'
|
||||
url "http://chickenbones.net/maven/"
|
||||
}
|
||||
maven {
|
||||
name 'DVS1 Maven FS'
|
||||
url 'http://dvs1.progwml6.com/files/maven'
|
||||
}
|
||||
maven {
|
||||
name 'forge'
|
||||
url 'http://files.minecraftforge.net/maven'
|
||||
@@ -87,6 +91,7 @@ minecraft {
|
||||
version = config.minecraft_version + "-" + config.forge_version
|
||||
mappings = config.mappings
|
||||
runDir = 'run'
|
||||
useDepAts = true
|
||||
replace '${version}', project.version
|
||||
}
|
||||
|
||||
@@ -99,6 +104,7 @@ dependencies {
|
||||
//compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev"
|
||||
//compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.ccc_version}:dev"
|
||||
//compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.NEI_version}:dev"
|
||||
deobfCompile "mezz.jei:jei_${config.minecraft_version}:${config.jei_version}"
|
||||
// Configuration
|
||||
shade "ninja.leaping.configurate:configurate-hocon:${config.configurate_version}"
|
||||
shade "ninja.leaping.configurate:configurate-gson:${config.configurate_version}"
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
mod_version=0.7
|
||||
minecraft_version=1.8.9
|
||||
forge_version=11.15.0.1663
|
||||
forge_version=11.15.1.1722
|
||||
mappings=snapshot_20151212
|
||||
|
||||
CCLIB_version=1.1.2.133
|
||||
ccc_version=1.0.5.36
|
||||
NEI_version=1.0.5.104
|
||||
jei_version=2.24.+
|
||||
configurate_version=2.0
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,6 +40,10 @@ public abstract class GuiModule extends GuiContainer {
|
||||
return guiTop + ySize;
|
||||
}
|
||||
|
||||
public Rectangle getArea() {
|
||||
return new Rectangle(guiLeft, guiTop, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
this.guiLeft = (this.width - this.xSize) / 2;
|
||||
|
||||
@@ -14,8 +14,10 @@ import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -57,6 +59,14 @@ public class GuiMultiModule extends GuiContainer { //implements INEIGuiHandler {
|
||||
modules.add(module);
|
||||
}
|
||||
|
||||
public List<Rectangle> getModuleAreas() {
|
||||
List<Rectangle> areas = new ArrayList<>(modules.size());
|
||||
for (GuiModule module : modules) {
|
||||
areas.add(module.getArea());
|
||||
}
|
||||
return areas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
if(realWidth > -1) {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package slimeknights.mantle.util;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import mezz.jei.api.IItemRegistry;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IJeiRuntime;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.IRecipeRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.gui.IAdvancedGuiHandler;
|
||||
import slimeknights.mantle.client.gui.GuiMultiModule;
|
||||
|
||||
@JEIPlugin
|
||||
public class JeiPlugin implements IModPlugin {
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
registry.addAdvancedGuiHandlers(new IAdvancedGuiHandler<GuiMultiModule>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<GuiMultiModule> getGuiContainerClass() {
|
||||
return GuiMultiModule.class;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<Rectangle> getGuiExtraAreas(@Nonnull GuiMultiModule guiContainer) {
|
||||
return guiContainer.getModuleAreas();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {}
|
||||
}
|
||||
Reference in new issue
Block a user