mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-16 18:54:47 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5df84d108d | ||
|
|
749ea96c62 | ||
|
|
f4dfa9e6cf | ||
|
|
989c99aaad | ||
|
|
c88cc8fa98 | ||
|
|
07b44d03ca |
No files matched your search
+1
-2
@@ -3,7 +3,7 @@
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.15:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.37:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.130-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.148-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.45:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
@@ -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}
|
||||
|
||||
@@ -58,7 +58,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;
|
||||
@@ -402,9 +401,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);
|
||||
|
||||
@@ -192,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 {
|
||||
@@ -220,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;
|
||||
|
||||
@@ -145,6 +145,7 @@ public final class Config {
|
||||
public static int travelAnchorCooldown = 0;
|
||||
public static boolean travelAnchorSneak = true;
|
||||
public static boolean travelAnchorSkipWarning = true;
|
||||
public static double travelAnchorSnapAngle = 0.175;
|
||||
|
||||
public static int travelStaffMaxDistance = 128;
|
||||
public static float travelStaffPowerPerBlockRF = 250;
|
||||
@@ -1167,6 +1168,14 @@ public final class Config {
|
||||
"Travel Anchors send a chat warning when skipping inaccessible anchors")
|
||||
.getBoolean(travelAnchorSkipWarning);
|
||||
|
||||
travelAnchorSnapAngle = Math.toRadians(
|
||||
config.get(
|
||||
sectionAnchor.name,
|
||||
"travelAnchorSnapAngle",
|
||||
Math.round(Math.toDegrees(travelAnchorSnapAngle)),
|
||||
"The maximum angle to snap to an anchor when selecting target")
|
||||
.getDouble(Math.toDegrees(travelAnchorSnapAngle)));
|
||||
|
||||
travelStaffMaxDistance = config
|
||||
.get(
|
||||
sectionStaff.name,
|
||||
|
||||
@@ -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 - 23, screenHeight - modeCount * 18 - 6, 23, 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;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TileAlloySmelter extends AbstractPoweredTaskEntity {
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Alloy Smelter";
|
||||
return "tile.blockAlloySmelter.name";
|
||||
}
|
||||
|
||||
public Mode getMode() {
|
||||
|
||||
@@ -33,6 +33,12 @@ public class TileBuffer extends AbstractPowerConsumerEntity implements IPaintabl
|
||||
super(new SlotDefinition(9, 0, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
// getMachineName will return the key without the suffix ".name"
|
||||
return getMachineName() + ".name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return BlockItemBuffer.Type.get(this).getUnlocalizedName();
|
||||
|
||||
@@ -54,6 +54,11 @@ public class TileCrafter extends AbstractPowerConsumerEntity implements IItemBuf
|
||||
setCapacitor(new BasicCapacitor(0, io * 4, refCap.getMaxEnergyStored(), io));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockCrafter.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockCrafter.unlocalisedName;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TileCrusher extends AbstractPoweredTaskEntity {
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockSagMill.unlocalisedName;
|
||||
return "tile.blockSagMill.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.gtnewhorizon.gtnhlib.geometry.CubeIterator;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.obelisk.xp.TileExperienceObelisk;
|
||||
@@ -300,7 +299,7 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockEnchanter.unlocalisedName;
|
||||
return "tile.blockEnchanter.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -822,7 +822,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return EnderIO.blockFarmStation.getLocalizedName();
|
||||
return "tile.blockFarmStation.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -90,6 +90,11 @@ public class TileCombustionGenerator extends AbstractGeneratorEntity implements
|
||||
return mode != IoMode.PUSH && mode != IoMode.PUSH_PULL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockCombustionGenerator.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockCombustionGenerator.unlocalisedName;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Stirling Generator";
|
||||
return "tile.blockStirlingGenerator.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -93,6 +93,11 @@ public class TileZombieGenerator extends AbstractGeneratorEntity
|
||||
minimumTankLevel = (int) (fuelTank.getCapacity() * 0.7F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockZombieGenerator.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockZombieGenerator.unlocalisedName;
|
||||
|
||||
@@ -11,8 +11,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.InventoryWrapper;
|
||||
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class CompositeInventory implements ISidedInventory {
|
||||
|
||||
private final List<InvEntry> inventories = new ArrayList<>();
|
||||
@@ -157,7 +155,7 @@ public class CompositeInventory implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockHyperCube.unlocalisedName;
|
||||
return "tile.blockHyperCube.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.enderio.core.common.util.PlayerUtil;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
@@ -769,7 +768,7 @@ public class TileHyperCube extends TileEntityEio
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockHyperCube.unlocalisedName;
|
||||
return "tile.blockHyperCube.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -369,6 +369,11 @@ public class TileInventoryPanel extends AbstractMachineEntity implements IFluidH
|
||||
nbtRoot.setBoolean("active", active);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockInventoryPanel.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockInventoryPanel.unlocalisedName;
|
||||
|
||||
@@ -157,6 +157,11 @@ public class TileKillerJoe extends AbstractMachineEntity
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockKillerJoe.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockKillerJoe.unlocalisedName;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class TilePowerMonitor extends AbstractPowerConsumerEntity implements IIn
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return EnderIO.blockPowerMonitor.getUnlocalizedName();
|
||||
return "tile.blockPowerMonitor.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -126,6 +126,11 @@ public class TileAttractor extends AbstractPowerConsumerEntity implements IRange
|
||||
setCapacitor(new BasicCapacitor(powerPerTick * 8, getCapacitor().getMaxEnergyStored(), powerPerTick));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockAttractor.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockAttractor.unlocalisedName;
|
||||
|
||||
@@ -106,6 +106,11 @@ public class TileAversionObelisk extends AbstractPowerConsumerEntity implements
|
||||
bounds = AxisAlignedBB.getBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockSpawnGuard.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockSpawnGuard.unlocalisedName;
|
||||
|
||||
@@ -19,6 +19,11 @@ public class TileInhibitorObelisk extends AbstractPowerConsumerEntity implements
|
||||
super(new SlotDefinition(0, 0, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockInhibitorObelisk.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockInhibitorObelisk.unlocalisedName;
|
||||
|
||||
@@ -121,6 +121,11 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
setCapacitor(Capacitors.ACTIVATED_CAPACITOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockWeatherObelisk.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockWeatherObelisk.unlocalisedName;
|
||||
|
||||
@@ -32,6 +32,11 @@ public class TileExperienceObelisk extends AbstractMachineEntity
|
||||
super(new SlotDefinition(0, 0, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockExperienceObelisk.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockExperienceObelisk.unlocalisedName;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Auto Painter";
|
||||
return "tile.blockPainter.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,6 +100,11 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
super(new SlotDefinition(8, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockSliceAndSplice.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockSliceAndSplice.unlocalisedName;
|
||||
|
||||
@@ -113,6 +113,11 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
return xpCont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockSoulBinder.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockSoulBinder.unlocalisedName;
|
||||
|
||||
@@ -197,6 +197,11 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity implements IRa
|
||||
forceClientUpdate = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockPoweredSpawner.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockPoweredSpawner.unlocalisedName;
|
||||
|
||||
@@ -225,6 +225,11 @@ public class TileTank extends AbstractMachineEntity implements IFluidHandler, IT
|
||||
this.voidMode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockTank.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return "tank";
|
||||
|
||||
@@ -157,6 +157,11 @@ public class TileTransceiver extends AbstractPoweredTaskEntity
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "tile.blockTransceiver.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockTransceiver.unlocalisedName;
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.enderio.core.common.vecmath.Vector3d;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.conduit.item.FilterRegister;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
@@ -212,7 +211,7 @@ public class TileVacuumChest extends TileEntityEio
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockVacuumChest.unlocalisedName;
|
||||
return "tile.blockVacuumChest.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class TileVat extends AbstractPoweredTaskEntity implements IFluidHandler,
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return ModObject.blockVat.unlocalisedName;
|
||||
return "tile.blockVat.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,6 +78,16 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(EnderIO.itemGasConduit));
|
||||
}
|
||||
API.hideItem(new ItemStack(EnderIO.blockHyperCube));
|
||||
|
||||
API.hideItem(new ItemStack(EnderIO.blockNutrientDistillation));
|
||||
API.hideItem(new ItemStack(EnderIO.blockHootch));
|
||||
API.hideItem(new ItemStack(EnderIO.blockRocketFuel));
|
||||
API.hideItem(new ItemStack(EnderIO.blockFireWater));
|
||||
API.hideItem(new ItemStack(EnderIO.blockLiquidSunshine));
|
||||
API.hideItem(new ItemStack(EnderIO.blockCloudSeed));
|
||||
API.hideItem(new ItemStack(EnderIO.blockCloudSeedConcentrated));
|
||||
API.hideItem(new ItemStack(EnderIO.blockEnderDistillation));
|
||||
API.hideItem(new ItemStack(EnderIO.blockVapourOfLevity));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.nei;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -9,7 +8,6 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -17,17 +15,13 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemStackMap;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
@@ -38,9 +32,6 @@ import crazypants.util.ColorUtils;
|
||||
|
||||
public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
private final Rectangle inTankBounds = new Rectangle(25, 1, 15, 47);
|
||||
private final Rectangle outTankBounds = new Rectangle(127, 1, 15, 47);
|
||||
|
||||
public VatRecipeHandler() {}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +85,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
FluidStack fluid = FluidUtil.getFluidFromItem(result);
|
||||
FluidStack fluid = getFluidFromNeiItem(result);
|
||||
if (fluid != null) {
|
||||
loadCraftingRecipes(fluid);
|
||||
}
|
||||
@@ -122,7 +113,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
FluidStack fluid = FluidUtil.getFluidFromItem(ingredient);
|
||||
FluidStack fluid = getFluidFromNeiItem(ingredient);
|
||||
if (fluid != null) {
|
||||
loadUsageRecipes(fluid);
|
||||
}
|
||||
@@ -159,109 +150,37 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void drawExtras(int recipeIndex) {
|
||||
InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
if (rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
RenderUtil.renderGuiTank(
|
||||
rec.inFluid,
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 8,
|
||||
rec.getInputFluidAmount(),
|
||||
inTankBounds.x,
|
||||
inTankBounds.y,
|
||||
0,
|
||||
inTankBounds.width,
|
||||
inTankBounds.height);
|
||||
}
|
||||
|
||||
if (rec.result != null && rec.result.getFluid() != null) {
|
||||
RenderUtil.renderGuiTank(
|
||||
rec.result,
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 8,
|
||||
rec.getResultFluidAmount(),
|
||||
outTankBounds.x,
|
||||
outTankBounds.y,
|
||||
0,
|
||||
outTankBounds.width,
|
||||
outTankBounds.height);
|
||||
}
|
||||
|
||||
String energyString = PowerDisplayUtil.formatPower(rec.energy) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawStringC(energyString, 86, 54, ColorUtils.neiEnergyString.getColor(), false);
|
||||
|
||||
Fluid outputFluid = rec.result.getFluid();
|
||||
Fluid outputFluid = rec.resultFluid.getFluid();
|
||||
List<PositionedStack> stacks = rec.getIngredients();
|
||||
for (PositionedStack ps : stacks) {
|
||||
if (ps instanceof PositionedStack.Tank) {
|
||||
continue;
|
||||
}
|
||||
float mult = VatRecipeManager.getInstance()
|
||||
.getMultiplierForInput(rec.inFluid.getFluid(), ps.item, outputFluid);
|
||||
String str = "x" + mult;
|
||||
GuiDraw.drawStringC(str, ps.relx + 8, ps.rely + 19, ColorUtils.neiMultiplierString.getColor(), false);
|
||||
GuiDraw.drawStringC(
|
||||
"x" + mult,
|
||||
ps.relx + 8,
|
||||
ps.rely + 19,
|
||||
ColorUtils.neiMultiplierString.getColor(),
|
||||
false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipeIndex) {
|
||||
return currenttip;
|
||||
private static FluidStack getFluidFromNeiItem(ItemStack stack) {
|
||||
FluidStack fluid = StackInfo.getFluid(stack);
|
||||
return fluid != null ? fluid : FluidUtil.getFluidFromItem(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int recipeIndex) {
|
||||
final InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
final Point pos = GuiDraw.getMousePosition();
|
||||
final Point offset = gui.getRecipePosition(recipeIndex);
|
||||
final Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
|
||||
if (inTankBounds.contains(relMouse) && rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
currenttip.add(rec.inFluid.getFluid().getLocalizedName(rec.inFluid));
|
||||
currenttip.add(EnumChatFormatting.GRAY.toString() + rec.getInputFluidAmount() + " " + Fluids.MB());
|
||||
} else if (outTankBounds.contains(relMouse) && rec.result != null && rec.result.getFluid() != null) {
|
||||
currenttip.add(rec.result.getFluid().getLocalizedName(rec.result));
|
||||
currenttip.add(EnumChatFormatting.GRAY.toString() + rec.getResultFluidAmount() + " " + Fluids.MB());
|
||||
}
|
||||
|
||||
return super.handleTooltip(gui, currenttip, recipeIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiRecipe<?> gui, int button, int recipeIndex) {
|
||||
if (button == 0) {
|
||||
if (this.transferFluidTanks(gui, recipeIndex, false)) {
|
||||
return true;
|
||||
}
|
||||
} else if (button == 1) {
|
||||
if (this.transferFluidTanks(gui, recipeIndex, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.mouseClicked(gui, button, recipeIndex);
|
||||
}
|
||||
|
||||
private boolean transferFluidTanks(GuiRecipe<?> gui, int recipeIndex, boolean usage) {
|
||||
InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point offset = gui.getRecipePosition(recipeIndex);
|
||||
Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
|
||||
if (inTankBounds.contains(relMouse)) {
|
||||
transferFluidTank(rec.inFluid, usage);
|
||||
} else if (outTankBounds.contains(relMouse)) {
|
||||
transferFluidTank(rec.result, usage);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean transferFluidTank(FluidStack tank, boolean usage) {
|
||||
if (tank != null && tank.amount > 0) {
|
||||
if (usage) {
|
||||
if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[] { tank.copy() })) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[] { tank.copy() })) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
private static FluidStack withAmount(FluidStack fluid, int amount) {
|
||||
FluidStack copy = fluid.copy();
|
||||
copy.amount = amount;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
@@ -279,20 +198,32 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
public class InnerVatRecipe extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
private final List<PositionedStack> inputs = new ArrayList<>();
|
||||
private final ItemStackMap<Float> firstItemMultiplier = new ItemStackMap();
|
||||
private final ItemStackMap<Float> secondItemMultiplier = new ItemStackMap();
|
||||
private final ItemStackMap<Float> firstItemMultiplier = new ItemStackMap<Float>();
|
||||
private final ItemStackMap<Float> secondItemMultiplier = new ItemStackMap<Float>();
|
||||
private final Map<FluidStack, Float> fluidMultiplier = new HashMap<>();
|
||||
private final FluidStack resultFluid;
|
||||
private final int energy;
|
||||
private final FluidStack result;
|
||||
private FluidStack inFluid;
|
||||
|
||||
private int inTankIndex = -1;
|
||||
private int lastInputAmount;
|
||||
private PositionedStack resultTank;
|
||||
private int lastResultAmount;
|
||||
|
||||
public int getEnergy() {
|
||||
return energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 30, this.inputs);
|
||||
if (this.inTankIndex >= 0) {
|
||||
int amount = getInputFluidAmount();
|
||||
if (amount != this.lastInputAmount) {
|
||||
this.lastInputAmount = amount;
|
||||
this.inputs.set(this.inTankIndex, createTank(withAmount(this.inFluid, amount), 25, 1));
|
||||
}
|
||||
}
|
||||
return this.inputs;
|
||||
}
|
||||
|
||||
public int getInputFluidAmount() {
|
||||
@@ -321,7 +252,12 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
int amount = getResultFluidAmount();
|
||||
if (amount != this.lastResultAmount || this.resultTank == null) {
|
||||
this.lastResultAmount = amount;
|
||||
this.resultTank = createTank(withAmount(this.resultFluid, amount), 127, 1);
|
||||
}
|
||||
return this.resultTank;
|
||||
}
|
||||
|
||||
public InnerVatRecipe(int energy, RecipeInput[] ingredients, FluidStack result) {
|
||||
@@ -355,15 +291,28 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
}
|
||||
|
||||
// Item stacks must stay at indices 0/1: getFirstItemMultiplier()/getSecondItemMultiplier() rely on it.
|
||||
if (!inputsOne.isEmpty()) {
|
||||
this.inputs.add(new PositionedStack(inputsOne, 51, 1));
|
||||
}
|
||||
if (!inputsTwo.isEmpty()) {
|
||||
this.inputs.add(new PositionedStack(inputsTwo, 100, 1));
|
||||
}
|
||||
|
||||
this.energy = energy;
|
||||
this.result = result;
|
||||
this.resultFluid = result;
|
||||
|
||||
if (this.inFluid != null) {
|
||||
this.inTankIndex = this.inputs.size();
|
||||
this.lastInputAmount = getInputFluidAmount();
|
||||
this.inputs.add(createTank(withAmount(this.inFluid, this.lastInputAmount), 25, 1));
|
||||
}
|
||||
|
||||
this.lastResultAmount = getResultFluidAmount();
|
||||
this.resultTank = createTank(withAmount(this.resultFluid, this.lastResultAmount), 127, 1);
|
||||
}
|
||||
|
||||
private static PositionedStack.Tank createTank(FluidStack fluid, int x, int y) {
|
||||
return new PositionedStack.Tank(fluid, x, y, 15, 47, FluidContainerRegistry.BUCKET_VOLUME * 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -741,7 +741,10 @@ public class TravelController {
|
||||
|
||||
for (Table.Cell<Double, Double, BlockCoord> cell : possibleDestinations.cellSet()) {
|
||||
if (cell.getColumnKey() <= maxDistance) {
|
||||
return Optional.of(cell.getValue());
|
||||
// If the client hasn't selected a target, the server shouldn't try to force one,
|
||||
// but checking if there is one just outside of range (below message) might still
|
||||
// be useful.
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1066,9 +1069,12 @@ public class TravelController {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the nearest travel anchor within roughly 10 degrees.
|
||||
Optional<BlockCoord> selectedBlock = findBlocksWithinAngle(player, candidates.keySet(), 0.175, Double.MAX_VALUE)
|
||||
.values().stream().findFirst();
|
||||
// Find the nearest travel anchor within the configured angle (default ~10 degrees).
|
||||
Optional<BlockCoord> selectedBlock = findBlocksWithinAngle(
|
||||
player,
|
||||
candidates.keySet(),
|
||||
Config.travelAnchorSnapAngle,
|
||||
Double.MAX_VALUE).values().stream().findFirst();
|
||||
selectedCoord = selectedBlock.orElse(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -651,6 +651,8 @@ tile.blockWeatherObelisk.tooltip.detailed.line4=Liquid Sunshine: Sun
|
||||
tile.blockWeatherObelisk.tooltip.detailed.line5=Cloud Seed: Rain
|
||||
tile.blockWeatherObelisk.tooltip.detailed.line6=Concentrated Cloud Seed: Thunder
|
||||
|
||||
tile.blockInhibitorObelisk.name=Inhibitor Obelisk
|
||||
|
||||
tile.blockBuffer.name=Buffer
|
||||
tile.blockBuffer.item.name=Item Buffer
|
||||
tile.blockBuffer.power.name=Power Buffer
|
||||
|
||||
@@ -608,6 +608,8 @@ tile.blockExperienceObelisk.tooltip.detailed.line3=至相邻的储罐中
|
||||
tile.blockWeatherObelisk.name=气象方尖碑
|
||||
tile.blockWeatherObelisk.tooltip.detailed.line1=改变当前天气
|
||||
|
||||
tile.blockInhibitorObelisk.name=传送抑制方尖碑
|
||||
|
||||
tile.blockBuffer.item.name=物品缓存器
|
||||
tile.blockBuffer.power.name=能量缓存器
|
||||
tile.blockBuffer.omni.name=多功能缓存器
|
||||
|
||||
Reference in new issue
Block a user