mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-23 21:49:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
604adfe428 | ||
|
|
1be32d9e64 | ||
|
|
4db0fb818b | ||
|
|
05fde9f2a3 |
No files matched your search
@@ -14,7 +14,6 @@ dependencies {
|
||||
compileOnly('ganymedes01.etfuturum:Et-Futurum-Requiem:2.6.48-GTNH:dev') {transitive = false}
|
||||
runtimeOnlyNonPublishable('com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.14:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Dashboard:1.0.19:api")
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-999-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.22-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.54.129:dev') {transitive = false}
|
||||
@@ -33,5 +32,4 @@ dependencies {
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.2.10:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.196:dev")
|
||||
compileOnly('curse.maven:automagy-222153:2285272')
|
||||
compileOnly('com.ruling_0:MaterialLib:0.24.0-mu:dev')
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
@@ -62,7 +62,6 @@ import crazypants.enderio.gui.TooltipHandlerBurnTime;
|
||||
import crazypants.enderio.gui.TooltipHandlerFluid;
|
||||
import crazypants.enderio.gui.TooltipHandlerGrinding;
|
||||
import crazypants.enderio.item.ConduitProbeOverlayRenderer;
|
||||
import crazypants.enderio.item.DashboardHud;
|
||||
import crazypants.enderio.item.KeyTracker;
|
||||
import crazypants.enderio.item.ToolTickHandler;
|
||||
import crazypants.enderio.item.YetaWrenchOverlayRenderer;
|
||||
@@ -410,9 +409,6 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
new YetaWrenchOverlayRenderer();
|
||||
new ConduitProbeOverlayRenderer();
|
||||
if (EnderIO.hasDashboard) {
|
||||
DashboardHud.register();
|
||||
}
|
||||
if (Config.useSneakMouseWheelYetaWrench) {
|
||||
ToolTickHandler th = new ToolTickHandler();
|
||||
MinecraftForge.EVENT_BUS.register(th);
|
||||
|
||||
@@ -134,7 +134,6 @@ import crazypants.enderio.machine.painter.BlockPaintedWall;
|
||||
import crazypants.enderio.machine.painter.BlockPainter;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.recipe.RecipeConfigParser;
|
||||
import crazypants.enderio.machine.reservoir.BlockReservoir;
|
||||
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.SliceAndSpliceRecipeManager;
|
||||
@@ -193,7 +192,6 @@ import crazypants.util.EE3Util;
|
||||
after:Thaumcraft;\
|
||||
after:appliedenergistics2@[rv2-beta-8,);\
|
||||
after:Railcraft@[9.16.7,);\
|
||||
after:dashboard@[1.0.19,);\
|
||||
after:betterbuilderswands@[0.13.12,)\
|
||||
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
@@ -221,7 +219,6 @@ public class EnderIO {
|
||||
public static final boolean hasEtFuturum = Loader.isModLoaded("etfuturum");
|
||||
public static final boolean hasWailaPlugins = Loader.isModLoaded("wailaplugins");
|
||||
public static final boolean hasAutomagy = Loader.isModLoaded("Automagy");
|
||||
public static final boolean hasDashboard = Loader.isModLoaded("dashboard");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -771,7 +768,6 @@ public class EnderIO {
|
||||
FarmersRegistry.addFarmers();
|
||||
SoulBinderRecipeManager.getInstance().addDefaultRecipes();
|
||||
PaintSourceValidator.instance.loadConfig();
|
||||
RecipeConfigParser.logMaterialLibSummary();
|
||||
|
||||
if (fluidXpJuice == null) { // should have been registered by open blocks
|
||||
fluidXpJuice = FluidRegistry.getFluid(getXPJuiceName());
|
||||
|
||||
@@ -38,24 +38,15 @@ public class ConduitProbeOverlayRenderer {
|
||||
}
|
||||
|
||||
private void doRenderOverlay(RenderGameOverlayEvent event, ItemStack equippedProbe) {
|
||||
if (EnderIO.hasDashboard && !DashboardHud.beginProbe(event.resolution)) {
|
||||
return;
|
||||
}
|
||||
draw(equippedProbe.getItemDamage() == 0, event.resolution);
|
||||
if (EnderIO.hasDashboard) {
|
||||
DashboardHud.endRender();
|
||||
}
|
||||
}
|
||||
|
||||
static void draw(boolean probeMode, ScaledResolution res) {
|
||||
IconEIO icon1, icon2;
|
||||
if (probeMode) {
|
||||
if (equippedProbe.getItemDamage() == 0) {
|
||||
icon1 = IconEIO.PROBE_OVERLAY_PROBE;
|
||||
icon2 = IconEIO.PROBE_OVERLAY_COPY_OFF;
|
||||
} else {
|
||||
icon1 = IconEIO.PROBE_OVERLAY_PROBE_OFF;
|
||||
icon2 = IconEIO.PROBE_OVERLAY_COPY;
|
||||
}
|
||||
ScaledResolution res = event.resolution;
|
||||
|
||||
double offsetX = res.getScaledWidth() - 48;
|
||||
double offsetY = res.getScaledHeight() - 16;
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
package crazypants.enderio.item;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.gtnewhorizons.dashboard.api.HudBounds;
|
||||
import com.gtnewhorizons.dashboard.api.HudElement;
|
||||
import com.gtnewhorizons.dashboard.api.HudRegistry;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
/**
|
||||
* Lets players move, resize and hide the Conduit Probe and Yeta Wrench HUD in Dashboard's HUD editor. The only class
|
||||
* using Dashboard, so only call it while Dashboard is loaded.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class DashboardHud {
|
||||
|
||||
private static final HudElement PROBE = new HudElement(
|
||||
"enderio:conduit_probe",
|
||||
(screenWidth, screenHeight) -> new HudBounds(screenWidth - 80, screenHeight - 48, 64, 32));
|
||||
|
||||
/** Only with the default overlay, which shows it for a moment after switching. */
|
||||
private static final HudElement WRENCH_SELECTOR = new HudElement(
|
||||
"enderio:yeta_wrench_selector",
|
||||
(screenWidth, screenHeight) -> new HudBounds(screenWidth / 2 - 22, screenHeight / 2 - 24, 44, 16))
|
||||
.setActiveCheck(() -> Config.yetaWrenchOverlayMode == 0);
|
||||
|
||||
/** The corner icon, the column or the group of icons, depending on the overlay setting. */
|
||||
private static final HudElement WRENCH_MODE = new HudElement(
|
||||
"enderio:yeta_wrench_mode",
|
||||
DashboardHud::getWrenchModeBounds);
|
||||
|
||||
private DashboardHud() {}
|
||||
|
||||
public static void register() {
|
||||
PROBE.setPreview((screenWidth, screenHeight) -> HudRegistry.render(PROBE, () -> {
|
||||
ConduitProbeOverlayRenderer.draw(true, HudRegistry.getResolution());
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
}));
|
||||
WRENCH_SELECTOR.setPreview(
|
||||
(screenWidth, screenHeight) -> HudRegistry.render(
|
||||
WRENCH_SELECTOR,
|
||||
() -> YetaWrenchOverlayRenderer
|
||||
.draw(ConduitDisplayMode.ALL, HudRegistry.getResolution(), true)));
|
||||
WRENCH_MODE.setPreview(
|
||||
(screenWidth, screenHeight) -> HudRegistry.render(
|
||||
WRENCH_MODE,
|
||||
() -> YetaWrenchOverlayRenderer
|
||||
.draw(ConduitDisplayMode.ALL, HudRegistry.getResolution(), false)));
|
||||
HudRegistry.register(PROBE);
|
||||
HudRegistry.register(WRENCH_SELECTOR);
|
||||
HudRegistry.register(WRENCH_MODE);
|
||||
}
|
||||
|
||||
/** False means the player hid it, so skip drawing it and do not call {@link #endRender()}. */
|
||||
static boolean beginProbe(ScaledResolution resolution) {
|
||||
return HudRegistry.beginRender(PROBE, resolution);
|
||||
}
|
||||
|
||||
/** The selector while it shows, otherwise the corner icon, the column or the group of icons. */
|
||||
static boolean beginWrench(ScaledResolution resolution, boolean showSelector) {
|
||||
return HudRegistry.beginRender(showSelector ? WRENCH_SELECTOR : WRENCH_MODE, resolution);
|
||||
}
|
||||
|
||||
static void endRender() {
|
||||
HudRegistry.endRender();
|
||||
}
|
||||
|
||||
/** Measured like YetaWrenchOverlayRenderer draws each overlay. */
|
||||
private static HudBounds getWrenchModeBounds(int screenWidth, int screenHeight) {
|
||||
int modeCount = ConduitDisplayMode.registrySize();
|
||||
return switch (Config.yetaWrenchOverlayMode) {
|
||||
case 1 -> new HudBounds(screenWidth - 17, screenHeight - modeCount * 18 - 6, 24, modeCount * 18 + 6);
|
||||
case 2 -> new HudBounds(screenWidth - modeCount * 8 - 16, screenHeight - 40, (modeCount + 1) / 2 * 16, 32);
|
||||
default -> new HudBounds(screenWidth - 20, screenHeight - 20, 16, 16);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -58,28 +57,20 @@ public class YetaWrenchOverlayRenderer {
|
||||
lastTick = ClientHandler.getTicksElapsed();
|
||||
}
|
||||
|
||||
boolean showSelector = displayTickCount > 0 && Config.yetaWrenchOverlayMode == 0;
|
||||
if (showSelector && lastTick < ClientHandler.getTicksElapsed()) {
|
||||
lastTick++;
|
||||
displayTickCount--;
|
||||
}
|
||||
if (EnderIO.hasDashboard && !DashboardHud.beginWrench(event.resolution, showSelector)) {
|
||||
return;
|
||||
}
|
||||
draw(mode, event.resolution, showSelector);
|
||||
if (EnderIO.hasDashboard) {
|
||||
DashboardHud.endRender();
|
||||
}
|
||||
}
|
||||
|
||||
static void draw(ConduitDisplayMode mode, ScaledResolution res, boolean showSelector) {
|
||||
ScaledResolution res = event.resolution;
|
||||
Tessellator tess = Tessellator.instance;
|
||||
int modeCount = ConduitDisplayMode.registrySize();
|
||||
Iterable<ConduitDisplayMode> renderable = ConduitDisplayMode.getRenderableModes();
|
||||
|
||||
switch (Config.yetaWrenchOverlayMode) {
|
||||
case 0:
|
||||
if (showSelector) {
|
||||
if (displayTickCount > 0) {
|
||||
|
||||
if (lastTick < ClientHandler.getTicksElapsed()) {
|
||||
lastTick++;
|
||||
displayTickCount--;
|
||||
}
|
||||
|
||||
int x = res.getScaledWidth() / 2 - 8;
|
||||
int y = res.getScaledHeight() / 2 - 24;
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package crazypants.enderio.machine.recipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.ruling_0.materiallib.api.StackResolver;
|
||||
|
||||
/// Resolves the stack a `modID="ml"` config entry names. The only EnderIO class referencing MaterialLib types, so
|
||||
/// the soft dependency classloads only behind a `Loader.isModLoaded` check.
|
||||
final class MaterialLibStacks {
|
||||
|
||||
private MaterialLibStacks() {}
|
||||
|
||||
/// The stack of the named material in the named shape, or null when the pair resolves to nothing.
|
||||
static ItemStack getStack(String materialName, String shapeToken, int stackSize) {
|
||||
return StackResolver.getStack(materialName, shapeToken, stackSize);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
import com.enderio.core.common.util.OreDictionaryHelper;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
|
||||
@@ -64,14 +63,6 @@ public class RecipeConfigParser extends DefaultHandler {
|
||||
public static final String AT_EXP = "exp";
|
||||
public static final String AT_ALLOW_MISSING = "allowMissing";
|
||||
|
||||
/// The `modID` under which an `itemName` of the form `<material>:<shape>` names a MaterialLib stack.
|
||||
private static final String MOD_ID_ML = "ml";
|
||||
|
||||
private static final String MATERIAL_LIB_MODID = "materiallib";
|
||||
|
||||
private static int materialLibResolved = 0;
|
||||
private static int materialLibInvalid = 0;
|
||||
|
||||
// Log prefix
|
||||
private static final String LP = "RecipeParser: ";
|
||||
|
||||
@@ -432,11 +423,7 @@ public class RecipeConfigParser extends DefaultHandler {
|
||||
String modId = getStringValue(AT_MOD_ID, attributes, null);
|
||||
String name = getStringValue(AT_ITEM_NAME, attributes, null);
|
||||
|
||||
if (MOD_ID_ML.equals(modId)) {
|
||||
res = getMaterialLibStack(name, stackSize);
|
||||
// A MaterialLib stack carries its material in the metadata, so itemMeta="*" cannot apply.
|
||||
useMeta = true;
|
||||
} else if (modId != null && name != null) {
|
||||
if (modId != null && name != null) {
|
||||
|
||||
Item i = GameRegistry.findItem(modId, name);
|
||||
if (i != null) {
|
||||
@@ -460,39 +447,6 @@ public class RecipeConfigParser extends DefaultHandler {
|
||||
getIntValue(AT_SLOT, attributes, -1));
|
||||
}
|
||||
|
||||
/// The stack `itemName` names, or null when MaterialLib is absent, the name is malformed, or the pair resolves
|
||||
/// to nothing.
|
||||
private static ItemStack getMaterialLibStack(String itemName, int stackSize) {
|
||||
if (itemName == null || !Loader.isModLoaded(MATERIAL_LIB_MODID)) {
|
||||
return null;
|
||||
}
|
||||
String[] parts = itemName.split(":", -1);
|
||||
if (parts.length != 2 || parts[0].isEmpty() || parts[1].isEmpty()) {
|
||||
Log.warn(LP + "Malformed MaterialLib reference \"" + itemName + "\", expected <material>:<shape>");
|
||||
materialLibInvalid++;
|
||||
return null;
|
||||
}
|
||||
ItemStack res = MaterialLibStacks.getStack(parts[0], parts[1], stackSize);
|
||||
if (res == null) {
|
||||
materialLibInvalid++;
|
||||
} else {
|
||||
materialLibResolved++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Logs how many MaterialLib references the recipe configs named. Call once config loading has finished.
|
||||
public static void logMaterialLibSummary() {
|
||||
if (materialLibResolved + materialLibInvalid > 0) {
|
||||
Log.info(
|
||||
LP + "Resolved "
|
||||
+ materialLibResolved
|
||||
+ " MaterialLib entries ("
|
||||
+ materialLibInvalid
|
||||
+ " invalid)");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean getBooleanValue(String qName, Attributes attributes, boolean def) {
|
||||
String val = attributes.getValue(qName);
|
||||
if (val == null) {
|
||||
|
||||
Reference in new issue
Block a user