mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88725a144d | ||
|
|
123f22f20e | ||
|
|
0b0f7a4f1a | ||
|
|
b00c5996f7 | ||
|
|
83f52d15c7 | ||
|
|
287c4498d2 | ||
|
|
2470e81f0e | ||
|
|
1af6fcae0b | ||
|
|
f44111da96 | ||
|
|
4ae9ff2d77 | ||
|
|
71f79536a7 | ||
|
|
0920bf28d6 | ||
|
|
8e4107d11e | ||
|
|
349bcc0926 | ||
|
|
070660efe4 | ||
|
|
0dd56b62ab | ||
|
|
54d61f5251 | ||
|
|
ebcbef851a | ||
|
|
1717d38632 | ||
|
|
5fdd24293a | ||
|
|
2629076937 | ||
|
|
63cbe6e562 | ||
|
|
3194ecf6e8 | ||
|
|
638f04a58e | ||
|
|
e5e6e2fdba | ||
|
|
5b46f376eb | ||
|
|
1a14946abb | ||
|
|
8ca820f71c | ||
|
|
4e40230bf3 | ||
|
|
76708883c0 | ||
|
|
0a1ee81780 | ||
|
|
1fd7ae7567 | ||
|
|
251fcc26b0 | ||
|
|
b22915cc9c | ||
|
|
0bf8d3f568 | ||
|
|
35e6667da5 | ||
|
|
73cb43a761 | ||
|
|
d32a8e88a3 | ||
|
|
447450d541 | ||
|
|
7f6a0a6a4c | ||
|
|
28df6fa938 |
No files matched your search
@@ -18,9 +18,5 @@ end_of_line = crlf
|
||||
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.java]
|
||||
indent_size = 2
|
||||
ij_java_space_before_if_parentheses = false
|
||||
|
||||
[*.lang]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RUNDIR="run"
|
||||
CRASH="crash-reports"
|
||||
SERVERLOG="server.log"
|
||||
|
||||
if [[ -d $RUNDIR/$CRASH ]]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $RUNDIR/$CRASH/crash*.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
|
||||
echo "Fatal errors detected:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
|
||||
echo "Server force stopped:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
|
||||
echo "Server didn't finish startup:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "No crash reports detected"
|
||||
exit 0
|
||||
|
||||
+399
-211
File diff suppressed because it is too large.
Load diff
+17
-15
@@ -1,24 +1,26 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:EnderCore:0.2.9:dev')
|
||||
compile('com.github.GTNewHorizons:ForestryMC:4.4.6:dev')
|
||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.7-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:BuildCraft:7.1.27:dev')
|
||||
compile('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
api('com.github.GTNewHorizons:EnderCore:0.2.18:dev')
|
||||
implementation('com.github.GTNewHorizons:ForestryMC:4.7.0:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev')
|
||||
implementation("com.github.GTNewHorizons:GTNHLib:0.0.13:dev")
|
||||
api('com.github.GTNewHorizons:BuildCraft:7.1.36:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.5.19:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-85-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.13.6:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-GTNH:api') {transitive = false}
|
||||
compile('com.github.GTNewHorizons:Chisel:2.10.8-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.25-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.6.3:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-282-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.83:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.1:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.12.1-GTNH:api') {transitive = false}
|
||||
implementation('com.github.GTNewHorizons:Chisel:2.12.2-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
compileOnly(deobf('https://media.forgecdn.net/files/2269/339/ComputerCraft1.75.jar')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
|
||||
compileOnly(deobf('https://media.forgecdn.net/files/2426/270/Mekanism-1.7.10-9.1.0.281.jar')) // https://aidancbrady.com/mekanism/download/
|
||||
compileOnly(deobf('https://immibis.com/mcmoddl/files/immibis-microblocks-59.1.2.jar'))
|
||||
compileOnly(rfg.deobf('curse.maven:computercraft-67504:2269339')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -85,9 +85,6 @@ done
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
|
||||
@@ -1,26 +1,4 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol
|
||||
}
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'http://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup 'curse.maven'
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url = 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
@@ -206,6 +206,9 @@ public class EnderIO {
|
||||
|
||||
public static final Lang lang = new Lang("enderio");
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi_post");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
public static ItemAlloy itemAlloy;
|
||||
@@ -785,7 +788,7 @@ public class EnderIO {
|
||||
@EventHandler
|
||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||
processImc(FMLInterModComms.fetchRuntimeMessages(this)); // Some mods send IMCs during PostInit, so we catch
|
||||
// them here.
|
||||
// them here.
|
||||
}
|
||||
|
||||
private static String getXPJuiceName() {
|
||||
|
||||
@@ -2,10 +2,13 @@ package crazypants.enderio;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.Marker;
|
||||
import org.apache.logging.log4j.MarkerManager;
|
||||
|
||||
public final class Log {
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger(EnderIO.MODID);
|
||||
public static final Marker securityMarker = MarkerManager.getMarker("SuspiciousPackets");
|
||||
|
||||
public static void warn(String msg) {
|
||||
LOGGER.warn(msg);
|
||||
|
||||
@@ -4,10 +4,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public interface IItemOfTravel extends IEnergyContainerItem {
|
||||
|
||||
boolean isActive(EntityPlayer ep, ItemStack equipped);
|
||||
|
||||
void extractInternal(ItemStack equipped, int power);
|
||||
|
||||
/**
|
||||
* @param equipped player who is currently holding this item. caller will ensure the item held has your Item as item
|
||||
* type
|
||||
* @return -1 if method not supported, or max(can extract, power), e.g. 0 if item is empty.
|
||||
*/
|
||||
default int canExtractInternal(ItemStack equipped, int power) {
|
||||
return Config.strictTPItemChecking ? 0 : -1;
|
||||
}
|
||||
}
|
||||
@@ -94,11 +94,10 @@ public interface ITelePad extends ITravelAccessable {
|
||||
/**
|
||||
* Util method to set all coords using a {@link BlockCoord} object.
|
||||
*
|
||||
* @param coords The coords to set this telepad to.
|
||||
* @see #setX(int)
|
||||
* @see #setY(int)
|
||||
* @see #setZ(int)
|
||||
*
|
||||
* @param coords The coords to set this telepad to.
|
||||
*/
|
||||
void setCoords(BlockCoord coords);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.util.UserIdent;
|
||||
|
||||
public interface ITravelAccessable {
|
||||
|
||||
@@ -14,9 +14,8 @@ import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
* <li>Staff of travelling</li>
|
||||
* <li>Telepad</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>
|
||||
* As well as any externally added teleports, assuming they fire this event manually.
|
||||
*
|
||||
*/
|
||||
@Cancelable
|
||||
public class TeleportEntityEvent extends EntityEvent {
|
||||
|
||||
@@ -9,11 +9,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -52,6 +47,10 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneConduitNetwork;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
@@ -84,6 +83,18 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
protected boolean connectionsDirty = true;
|
||||
|
||||
/**
|
||||
* This shows if the currently running connection update should not finish with settings connectionsDirty to false.
|
||||
* If this is true, it will trigger a reconnection on the next Tick.
|
||||
* <p>
|
||||
* Use the method needUpdateConnections() instead of setting this to true.
|
||||
*
|
||||
* @see needUpdateConnections()
|
||||
*/
|
||||
private boolean needUpdateConnections = false;
|
||||
|
||||
private boolean isUpdatingConnections = false;
|
||||
|
||||
protected AbstractConduit() {}
|
||||
|
||||
@Override
|
||||
@@ -434,10 +445,13 @@ public abstract class AbstractConduit implements IConduit {
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
if (!connectionsDirty) {
|
||||
if (!connectionsDirty && !needUpdateConnections) {
|
||||
return;
|
||||
}
|
||||
|
||||
isUpdatingConnections = true;
|
||||
needUpdateConnections = false;
|
||||
|
||||
boolean externalConnectionsChanged = false;
|
||||
List<ForgeDirection> copy = new ArrayList<ForgeDirection>(externalConnections);
|
||||
// remove any no longer valid connections
|
||||
@@ -462,6 +476,21 @@ public abstract class AbstractConduit implements IConduit {
|
||||
}
|
||||
|
||||
connectionsDirty = false;
|
||||
isUpdatingConnections = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prevents connection update from getting completed successfully by not settings connectionsDirty to
|
||||
* false. This will trigger an connection update at the next Tick.
|
||||
* <p>
|
||||
* Only use this while executing updateConnections().
|
||||
* <p>
|
||||
* See this PR for more info: https://github.com/GTNewHorizons/EnderIO/pull/111
|
||||
*/
|
||||
protected void needUpdateConnections() {
|
||||
if (isUpdatingConnections) {
|
||||
needUpdateConnections = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,11 +2,6 @@ package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -29,6 +24,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
|
||||
public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
@@ -31,9 +28,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
@@ -53,7 +47,13 @@ import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.gui.*;
|
||||
import crazypants.enderio.conduit.gui.ExternalConnectionContainer;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnectionSelector;
|
||||
import crazypants.enderio.conduit.gui.PacketFluidChannel;
|
||||
import crazypants.enderio.conduit.gui.PacketFluidFilter;
|
||||
import crazypants.enderio.conduit.gui.PacketOpenConduitUI;
|
||||
import crazypants.enderio.conduit.gui.PacketSlotVisibility;
|
||||
import crazypants.enderio.conduit.gui.item.PacketExistingItemFilterSnapshot;
|
||||
import crazypants.enderio.conduit.gui.item.PacketModItemFilter;
|
||||
import crazypants.enderio.conduit.liquid.PacketFluidLevel;
|
||||
@@ -73,6 +73,10 @@ import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.util.IFacade;
|
||||
import mods.immibis.core.api.multipart.IMultipartRenderingBlockMarker;
|
||||
import mods.immibis.core.api.multipart.IMultipartSystem;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOmniNode;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Interface(
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.gui.IconEIO.*;
|
||||
import static crazypants.enderio.gui.IconEIO.CROSS;
|
||||
import static crazypants.enderio.gui.IconEIO.TICK;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER_OFF;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE;
|
||||
import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE_OFF;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -55,11 +64,10 @@ public class ConduitDisplayMode {
|
||||
* Use this constructor if you have custom display logic, it will use {@code IConduit.class} as the conduitType, and
|
||||
* the passed name as the override name.
|
||||
*
|
||||
* @see #ConduitDisplayMode(Class, IWidgetIcon, IWidgetIcon)
|
||||
*
|
||||
* @param name The override name.
|
||||
* @param widgetSelected The widget to render when this type is selected.
|
||||
* @param widgetUnselected The widget to render when this type is unselected.
|
||||
* @see #ConduitDisplayMode(Class, IWidgetIcon, IWidgetIcon)
|
||||
*/
|
||||
public ConduitDisplayMode(String name, IWidgetIcon widgetSelected, IWidgetIcon widgetUnselected) {
|
||||
this(IConduit.class, widgetSelected, widgetUnselected);
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.ModObject.blockPainter;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_GOLD;
|
||||
import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRUDE_STEEL;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_ALLOY;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_PINK_SLIME;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.ENERGETIC_SILVER;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.MELODIC_ALLOY;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -682,6 +693,11 @@ public class ConduitRecipes {
|
||||
addShaped(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', pureFluix, 'q', quartzFiber);
|
||||
|
||||
res.stackSize = 1;
|
||||
addShaped(new ItemStack(EnderIO.itemMEConduit, 1, 1), "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
|
||||
ItemStack resDense = new ItemStack(EnderIO.itemMEConduit, 1, 1);
|
||||
ItemStack resUltra = new ItemStack(EnderIO.itemMEConduit, 1, 2);
|
||||
addShaped(resDense, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', res);
|
||||
if (Config.enableMEUltraDenseConduits) {
|
||||
addShaped(resUltra, "bCb", "CbC", "bCb", 'b', conduitBinder, 'C', resDense);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class ConduitUtil {
|
||||
}
|
||||
}
|
||||
if (con.getNetwork() != null) { // this should have been destroyed when destroying the neighbours network but
|
||||
// lets just make
|
||||
// lets just make
|
||||
// sure
|
||||
con.getNetwork().destroyNetwork();
|
||||
}
|
||||
@@ -248,7 +248,7 @@ public class ConduitUtil {
|
||||
|
||||
public static <T extends IConduit> Collection<T> getConnectedConduits(World world, int x, int y, int z,
|
||||
Class<T> type) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
TileEntity te = world.blockExists(x, y, z) ? world.getTileEntity(x, y, z) : null;
|
||||
if (!(te instanceof IConduitBundle)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,6 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -16,11 +11,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.networking.IGridHost;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -29,6 +23,10 @@ import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.power.IInternalPowerHandler;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mods.immibis.microblocks.api.IMicroblockSupporterTile;
|
||||
|
||||
@InterfaceList({ @Interface(iface = "appeng.api.networking.IGridHost", modid = "appliedenergistics2"),
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = "MekanismAPI|gas"),
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
|
||||
public interface IExtractor extends IConduit {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
|
||||
public class MicroblocksUtil {
|
||||
|
||||
|
||||
@@ -7,19 +7,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.*;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSystem;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import mods.immibis.microblocks.api.PartType;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -37,11 +24,10 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AECableType;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -64,6 +50,17 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.redstone.IRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.config.Config;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mods.immibis.microblocks.api.EnumPartClass;
|
||||
import mods.immibis.microblocks.api.EnumPosition;
|
||||
import mods.immibis.microblocks.api.IMicroblockCoverSystem;
|
||||
import mods.immibis.microblocks.api.IMicroblockSystem;
|
||||
import mods.immibis.microblocks.api.MicroblockAPIUtils;
|
||||
import mods.immibis.microblocks.api.Part;
|
||||
import mods.immibis.microblocks.api.PartType;
|
||||
|
||||
public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -23,6 +21,7 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public abstract class AbstractGasConduit extends AbstractConduit implements IGasConduit {
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@ package crazypants.enderio.conduit.gas;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -17,6 +14,8 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public abstract class AbstractGasTankConduit extends AbstractGasConduit {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class AbstractGasTankConduitNetwork<T extends AbstractGasTankConduit>
|
||||
extends AbstractConduitNetwork<IGasConduit, T> {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
|
||||
public class ConduitGasTank extends GasTank {
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ package crazypants.enderio.conduit.gas;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -24,6 +21,8 @@ import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.config.Config;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class GasConduit extends AbstractGasTankConduit {
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit> {
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -25,6 +23,7 @@ import crazypants.enderio.conduit.geom.ConnectionModeGeometry;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
import mekanism.api.gas.GasStack;
|
||||
|
||||
public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -12,6 +9,8 @@ import cpw.mods.fml.common.ModAPIManager;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.config.Config;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
public final class GasUtil {
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package crazypants.enderio.conduit.gas;
|
||||
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
|
||||
@Interface(iface = "mekanism.api.gas.IGasHandler", modid = GasUtil.API_NAME)
|
||||
public interface IGasConduit extends IConduit, IGasHandler, IExtractor {
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit.geom;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class CollidableComponent {
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class ConduitGeometryUtil {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -24,12 +25,14 @@ import crazypants.enderio.conduit.gui.item.InventoryUpgrades;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.SpeedUpgrade;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.enderio.machine.gui.IContainerWithTileEntity;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrades> {
|
||||
public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrades> implements IContainerWithTileEntity {
|
||||
|
||||
private final IItemConduit itemConduit;
|
||||
private final ForgeDirection direction;
|
||||
private final TileEntity te;
|
||||
|
||||
private int speedUpgradeSlotLimit = 15;
|
||||
|
||||
@@ -52,6 +55,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
super(playerInv, new InventoryUpgrades(bundle.getConduit(IItemConduit.class), dir));
|
||||
this.direction = dir;
|
||||
this.itemConduit = bundle.getConduit(IItemConduit.class);
|
||||
this.te = (TileEntity) bundle;
|
||||
slotLocations.addAll(playerSlotLocations.values());
|
||||
|
||||
int x;
|
||||
@@ -280,6 +284,11 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
return copystack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return te;
|
||||
}
|
||||
|
||||
private class FilterSlot extends Slot {
|
||||
|
||||
public FilterSlot(IInventory par1iInventory, int par2, int par3, int par4) {
|
||||
|
||||
@@ -2,8 +2,6 @@ package crazypants.enderio.conduit.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
@@ -22,6 +20,7 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import mekanism.api.gas.Gas;
|
||||
|
||||
public class GasSettings extends BaseSettingsPanel {
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ public class PacketFluidChannel extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketFluidChannel message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (!(conduit instanceof AbstractEnderLiquidConduit)) {
|
||||
return null;
|
||||
|
||||
@@ -53,6 +53,7 @@ public class PacketFluidFilter extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketFluidFilter message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (!(conduit instanceof AbstractEnderLiquidConduit)) {
|
||||
return null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -213,9 +213,11 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
} else if (guiButton.id == ID_EXTRACT_CHANNEL) {
|
||||
DyeColor col = DyeColor.fromIndex(extractChannelB.getColorIndex());
|
||||
itemConduit.setInputColor(gui.getDir(), col);
|
||||
} else {
|
||||
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
|
||||
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
|
||||
return;
|
||||
}
|
||||
if (insertFilterGui != null) insertFilterGui.actionPerformed(guiButton);
|
||||
if (extractFilterGui != null) extractFilterGui.actionPerformed(guiButton);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketItemConduitFilter(itemConduit, gui.getDir()));
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -58,6 +58,7 @@ public class PacketExistingItemFilterSnapshot extends AbstractConduitPacket<IIte
|
||||
|
||||
@Override
|
||||
public PacketExistingItemFilterSnapshot onMessage(PacketExistingItemFilterSnapshot message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IItemConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit == null) {
|
||||
return null;
|
||||
|
||||
@@ -58,6 +58,7 @@ public class PacketModItemFilter extends AbstractConduitPacket<IItemConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketModItemFilter message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IItemConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit == null) {
|
||||
return null;
|
||||
|
||||
@@ -5,10 +5,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.transport.IItemDuct;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cofh.api.transport.IItemDuct;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IExtractor;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
|
||||
@@ -18,12 +18,11 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.inventory.IInventoryConnection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cofh.api.inventory.IInventoryConnection;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
@@ -613,8 +612,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
ItemStack result = new ItemStack(EnderIO.itemItemConduit, 1, metaData);
|
||||
return result;
|
||||
return new ItemStack(EnderIO.itemItemConduit, 1, metaData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface IItemFilter {
|
||||
|
||||
/**
|
||||
* Checks if the given item passes the filter or not.
|
||||
*
|
||||
*
|
||||
* @param inv the attached inventory - or null when used without an inventory (eg for a GUI)
|
||||
* @param item the item to check
|
||||
* @return true if the item is allowed to pass
|
||||
|
||||
@@ -13,7 +13,6 @@ import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author matthias
|
||||
*/
|
||||
public class ItemPowerItemFilter extends Item implements IItemFilterUpgrade, IResourceTooltipProvider {
|
||||
|
||||
@@ -5,11 +5,10 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.network.NetworkUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
@@ -20,7 +19,6 @@ import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author matthias
|
||||
*/
|
||||
public class PowerItemFilter implements IItemFilter {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
@@ -23,6 +24,8 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.reservoir.TileReservoir;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
|
||||
public abstract class AbstractLiquidConduit extends AbstractConduit implements ILiquidConduit {
|
||||
|
||||
@@ -54,6 +57,12 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
if (h == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (EnderIO.hasGT5 && h instanceof IGregTechTileEntity) {
|
||||
IMetaTileEntity mte = ((IGregTechTileEntity) h).getMetaTileEntity();
|
||||
return mte != null && mte.getCapacity() > 0;
|
||||
}
|
||||
|
||||
// TODO: This check was added to work around a bug in dynamic tanks, but
|
||||
// it causes issues with not conecting to empty tanks such as dim. trans +
|
||||
// BC fluid pipes, so I am removing it for now.
|
||||
@@ -148,11 +157,11 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal)
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
&& (col != DyeColor.RED || isConditionMetByExternalSignal(dir, mode, col));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal)
|
||||
res = RedstoneControlMode.isConditionMet(mode, signal)
|
||||
|| (col == DyeColor.RED && isConditionMetByExternalSignal(dir, mode, col));
|
||||
}
|
||||
return res;
|
||||
@@ -171,7 +180,12 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
}
|
||||
}
|
||||
|
||||
return mode.isConditionMet(mode, externalSignal);
|
||||
return RedstoneControlMode.isConditionMet(mode, externalSignal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectionMode getDefaultConnectionMode() {
|
||||
return ConnectionMode.INPUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<AdvancedLiquidConduit> {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
|
||||
public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidConduit> {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -19,6 +17,7 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
@@ -96,12 +95,12 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
List<Vertex> corners = component.bound
|
||||
.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
for (Vertex c : corners) {
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
CubeRenderer.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
// back face
|
||||
for (int i = corners.size() - 1; i >= 0; i--) {
|
||||
Vertex c = corners.get(i);
|
||||
addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
CubeRenderer.addVecWithUV(c.xyz, c.uv.x, c.uv.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,7 +303,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer implements IRe
|
||||
float transY = (bound.sizeY() - sizeY) / 2;
|
||||
|
||||
Vector3d translation = new Vector3d(0, transY, 0);
|
||||
setupVertices(bound.translate(translation));
|
||||
CubeRenderer.setupVertices(bound.translate(translation));
|
||||
}
|
||||
|
||||
private void calculateRatios(LiquidConduit conduit) {
|
||||
|
||||
@@ -14,5 +14,7 @@ public interface IMEConduit extends IConduit {
|
||||
|
||||
boolean isDense();
|
||||
|
||||
boolean isDenseUltra();
|
||||
|
||||
int getChannelsInUse();
|
||||
}
|
||||
@@ -15,7 +15,8 @@ public class ItemMEConduit extends AbstractItemConduit {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name(), "enderio:itemMeConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense") };
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "Dense", "enderio:itemMeConduitDense"),
|
||||
new ItemConduitSubtype(ModObject.itemMEConduit.name() + "DenseUltra", "enderio:itemMeConduitDenseUltra") };
|
||||
|
||||
public static ItemMEConduit create() {
|
||||
ItemMEConduit result = new ItemMEConduit();
|
||||
|
||||
@@ -12,16 +12,16 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
@@ -44,6 +44,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public static IIcon[] longTextures;
|
||||
|
||||
private boolean isDense;
|
||||
private boolean isDenseUltra;
|
||||
private int playerID = -1;
|
||||
|
||||
public MEConduit() {
|
||||
@@ -51,6 +52,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
}
|
||||
|
||||
public MEConduit(int itemDamage) {
|
||||
isDenseUltra = itemDamage == 2;
|
||||
isDense = itemDamage == 1;
|
||||
}
|
||||
|
||||
@@ -59,14 +61,16 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
coreTextures = new IIcon[2];
|
||||
longTextures = new IIcon[2];
|
||||
coreTextures = new IIcon[3];
|
||||
longTextures = new IIcon[3];
|
||||
|
||||
coreTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCore");
|
||||
coreTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDense");
|
||||
coreTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitCoreDenseUltra");
|
||||
|
||||
longTextures[0] = register.registerIcon(EnderIO.DOMAIN + ":meConduit");
|
||||
longTextures[1] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDense");
|
||||
longTextures[2] = register.registerIcon(EnderIO.DOMAIN + ":meConduitDenseUltra");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,8 +80,14 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
});
|
||||
}
|
||||
|
||||
public static int getDamageForState(boolean isDense) {
|
||||
return isDense ? 1 : 0;
|
||||
public static int getDamageForState(boolean isDense, boolean isDenseUltra) {
|
||||
if (isDenseUltra) {
|
||||
return 2;
|
||||
}
|
||||
if (isDense) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,7 +97,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense));
|
||||
return new ItemStack(EnderIO.itemMEConduit, 1, getDamageForState(isDense, isDenseUltra));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,6 +115,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setBoolean("isDense", isDense);
|
||||
nbtRoot.setBoolean("isDenseUltra", isDenseUltra);
|
||||
nbtRoot.setInteger("playerID", playerID);
|
||||
}
|
||||
|
||||
@@ -117,6 +128,9 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
} else {
|
||||
playerID = -1;
|
||||
}
|
||||
if (nbtRoot.hasKey("isDenseUltra")) {
|
||||
isDenseUltra = nbtRoot.getBoolean("isDenseUltra");
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerID(int playerID) {
|
||||
@@ -140,7 +154,16 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public boolean canConnectToExternal(ForgeDirection dir, boolean ignoreDisabled) {
|
||||
World world = getBundle().getWorld();
|
||||
BlockCoord pos = getLocation();
|
||||
TileEntity te = world.getTileEntity(pos.x + dir.offsetX, pos.y + dir.offsetY, pos.z + dir.offsetZ);
|
||||
|
||||
final int exactPosX = pos.x + dir.offsetX;
|
||||
final int exactPosY = pos.y + dir.offsetY;
|
||||
final int exactPosZ = pos.z + dir.offsetZ;
|
||||
|
||||
if (!world.blockExists(exactPosX, exactPosY, exactPosZ)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity te = world.getTileEntity(exactPosX, exactPosY, exactPosZ);
|
||||
|
||||
if (te instanceof TileConduitBundle) {
|
||||
return false;
|
||||
@@ -148,26 +171,44 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
// because the AE2 API doesn't allow an easy query like "which side can connect to an ME cable" it needs this
|
||||
// mess
|
||||
IGridNode node = null;
|
||||
if (te instanceof IPartHost) {
|
||||
IPart part = ((IPartHost) te).getPart(dir.getOpposite());
|
||||
if (part == null) {
|
||||
part = ((IPartHost) te).getPart(ForgeDirection.UNKNOWN);
|
||||
return part != null;
|
||||
}
|
||||
if (part.getExternalFacingNode() != null) {
|
||||
return true;
|
||||
if (part != null) {
|
||||
node = part.getExternalFacingNode();
|
||||
if (node == null) {
|
||||
node = part.getGridNode();
|
||||
}
|
||||
if (node == null) {
|
||||
// The GridNode has not been initialized yet, let's try on the next Tick.
|
||||
needUpdateConnections();
|
||||
}
|
||||
}
|
||||
String name = part.getClass().getSimpleName();
|
||||
return "PartP2PTunnelME".equals(name) || "PartQuartzFiber".endsWith(name)
|
||||
|| "PartToggleBus".equals(name)
|
||||
|| "PartInvertedToggleBus".equals(name);
|
||||
} else if (te instanceof IGridHost) {
|
||||
IGridNode node = ((IGridHost) te).getGridNode(dir.getOpposite());
|
||||
node = ((IGridHost) te).getGridNode(dir.getOpposite());
|
||||
if (node == null) {
|
||||
node = ((IGridHost) te).getGridNode(ForgeDirection.UNKNOWN);
|
||||
}
|
||||
if (node != null) {
|
||||
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
|
||||
}
|
||||
if (node != null) {
|
||||
return canConnectToGridNode(node, dir);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Method(modid = "appliedenergistics2")
|
||||
private Boolean canConnectToGridNode(IGridNode node, ForgeDirection dir) {
|
||||
if (node.getGridBlock().getConnectableSides().contains(dir.getOpposite())) {
|
||||
if (isDenseUltra()) {
|
||||
return node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)
|
||||
|| ((node.hasFlag(GridFlags.DENSE_CAPACITY)) && !node.hasFlag(GridFlags.CANNOT_CARRY));
|
||||
} else if (isDense()) {
|
||||
return true;
|
||||
} else {
|
||||
return !node.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -175,7 +216,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
int state = getDamageForState(isDense);
|
||||
int state = getDamageForState(isDense, isDenseUltra);
|
||||
if (component.dir == ForgeDirection.UNKNOWN) {
|
||||
return coreTextures[state];
|
||||
} else {
|
||||
@@ -272,7 +313,11 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
private void onNodeChanged(BlockCoord location) {
|
||||
World world = getBundle().getWorld();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity te = location.getLocation(dir).getTileEntity(world);
|
||||
BlockCoord dirLocation = location.getLocation(dir);
|
||||
TileEntity te = null;
|
||||
if (world.blockExists(dirLocation.x, dirLocation.y, dirLocation.z)) {
|
||||
te = location.getLocation(dir).getTileEntity(world);
|
||||
}
|
||||
if (te != null && te instanceof IGridHost && !(te instanceof IConduitBundle)) {
|
||||
IGridNode node = ((IGridHost) te).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (node == null) {
|
||||
@@ -288,7 +333,12 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
@Override
|
||||
public void onAddedToBundle() {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity te = getLocation().getLocation(dir).getTileEntity(getBundle().getWorld());
|
||||
World world = getBundle().getWorld();
|
||||
BlockCoord dirLocation = getLocation().getLocation(dir);
|
||||
TileEntity te = null;
|
||||
if (world.blockExists(dirLocation.x, dirLocation.y, dirLocation.z)) {
|
||||
te = dirLocation.getTileEntity(world);
|
||||
}
|
||||
if (te instanceof TileConduitBundle) {
|
||||
IMEConduit cond = ((TileConduitBundle) te).getConduit(IMEConduit.class);
|
||||
if (cond != null) {
|
||||
@@ -343,4 +393,9 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public boolean isDense() {
|
||||
return isDense;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDenseUltra() {
|
||||
return isDenseUltra;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,13 @@ public class MEConduitGrid implements IGridBlock {
|
||||
|
||||
@Override
|
||||
public EnumSet<GridFlags> getFlags() {
|
||||
return conduit.isDense() ? EnumSet.of(GridFlags.DENSE_CAPACITY) : EnumSet.noneOf(GridFlags.class);
|
||||
if (conduit.isDenseUltra()) {
|
||||
return EnumSet.of(GridFlags.ULTRA_DENSE_CAPACITY);
|
||||
}
|
||||
if (conduit.isDense()) {
|
||||
return EnumSet.of(GridFlags.DENSE_CAPACITY);
|
||||
}
|
||||
return EnumSet.noneOf(GridFlags.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package crazypants.enderio.conduit.oc;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
@@ -10,6 +7,8 @@ import com.enderio.core.common.util.DyeColor;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
@InterfaceList({ @Interface(iface = "li.cil.oc.api.network.Environment", modid = "OpenComputersAPI|Network"),
|
||||
@Interface(iface = "li.cil.oc.api.network.SidedEnvironment", modid = "OpenComputersAPI|Network") })
|
||||
|
||||
@@ -9,11 +9,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -45,6 +40,10 @@ import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
|
||||
public class OCConduit extends AbstractConduit implements IOCConduit {
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package crazypants.enderio.conduit.oc;
|
||||
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
@@ -13,6 +7,11 @@ import com.enderio.core.common.util.DyeColor;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Message;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
|
||||
@Interface(iface = "li.cil.oc.api.network.ManagedEnvironment", modid = "OpenComputersAPI|Network")
|
||||
public class OCConduitNetwork extends AbstractConduitNetwork<IOCConduit, IOCConduit> implements ManagedEnvironment {
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class AbstractConduitPacket<T extends IConduit> extends AbstractConduitBundlePacket {
|
||||
@@ -50,4 +51,12 @@ public class AbstractConduitPacket<T extends IConduit> extends AbstractConduitBu
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
return (T) bundle.getConduit(getConType());
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates if TileEntity received from client is actually the one player is interacting with. It prevents
|
||||
* malicious user disturbing random machine settings etc.
|
||||
*/
|
||||
protected static boolean isInvalidPacketForGui(AbstractConduitPacket<?> message, MessageContext ctx) {
|
||||
return PacketUtil.isInvalidPacketForGui(ctx, message.getTileEntity(message.getWorld(ctx)), message.getClass());
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ public class PacketConnectionMode extends AbstractConduitPacket<IConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketConnectionMode message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit == null) {
|
||||
return null;
|
||||
|
||||
@@ -45,6 +45,7 @@ public class PacketExtractMode extends AbstractConduitPacket<IExtractor>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketExtractMode message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
message.getTileCasted(ctx).setExtractionRedstoneMode(message.mode, message.dir);
|
||||
message.getTileCasted(ctx).setExtractionSignalColor(message.dir, message.color);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
|
||||
@@ -68,6 +68,7 @@ public class PacketItemConduitFilter extends AbstractConduitPacket<IItemConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketItemConduitFilter message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IItemConduit conduit = message.getTileCasted(ctx);
|
||||
conduit.setSelfFeedEnabled(message.dir, message.loopMode);
|
||||
conduit.setRoundRobinEnabled(message.dir, message.roundRobin);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class PacketOCConduitSignalColor extends AbstractConduitPacket<IOCConduit
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketOCConduitSignalColor message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
message.getTileCasted(ctx).setSignalColor(message.dir, message.col);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
return null;
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ public class PacketRedstoneConduitOutputStrength extends AbstractConduitPacket<I
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketRedstoneConduitOutputStrength message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
IInsulatedRedstoneConduit tile = message.getTileCasted(ctx);
|
||||
if (tile != null) {
|
||||
tile.setOutputStrength(message.dir, message.isStrong);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class PacketRedstoneConduitSignalColor extends AbstractConduitPacket<IIns
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketRedstoneConduitSignalColor message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
message.getTileCasted(ctx).setSignalColor(message.dir, message.col);
|
||||
message.getWorld(ctx).markBlockForUpdate(message.x, message.y, message.z);
|
||||
return null;
|
||||
|
||||
@@ -39,6 +39,7 @@ public class PacketRoundRobinMode extends AbstractConduitPacket<ILiquidConduit>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketRoundRobinMode message, MessageContext ctx) {
|
||||
if (isInvalidPacketForGui(message, ctx)) return null;
|
||||
final ILiquidConduit conduit = message.getTileCasted(ctx);
|
||||
if (conduit instanceof AbstractEnderLiquidConduit) {
|
||||
((AbstractEnderLiquidConduit) conduit).setRoundRobin(message.dir, message.roundRobin);
|
||||
|
||||
@@ -68,17 +68,21 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
public static void initIcons() {
|
||||
initIcons(POSTFIX, ICONS);
|
||||
}
|
||||
|
||||
protected static void initIcons(String[] postfix, Map<String, IIcon> icons) {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (String pf : POSTFIX) {
|
||||
ICONS.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
for (String pf : postfix) {
|
||||
icons.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
icons.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
icons.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
icons.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
}
|
||||
ICONS.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
icons.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,6 +123,10 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
this.subtype = meta;
|
||||
}
|
||||
|
||||
protected int getSubtype() {
|
||||
return subtype;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectionsDirty() {
|
||||
return connectionsDirty;
|
||||
|
||||
@@ -2,51 +2,20 @@ package crazypants.enderio.conduit.power.endergy;
|
||||
|
||||
import static crazypants.enderio.config.Config.powerConduitEndergyTiers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.geom.CollidableCache.CacheKey;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketConduitProbe;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.IPowerInterface;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
public class PowerConduitEndergy extends PowerConduit {
|
||||
|
||||
@@ -76,487 +45,51 @@ public class PowerConduitEndergy extends PowerConduit {
|
||||
}
|
||||
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (String pf : POSTFIX) {
|
||||
ICONS.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
}
|
||||
ICONS.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextureType() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
initIcons(POSTFIX, ICONS);
|
||||
}
|
||||
|
||||
public static final float WIDTH = 0.075f;
|
||||
public static final float HEIGHT = 0.075f;
|
||||
|
||||
public static final Vector3d MIN = new Vector3d(0.5f - WIDTH, 0.5 - HEIGHT, 0.5 - WIDTH);
|
||||
public static final Vector3d MAX = new Vector3d(MIN.x + WIDTH, MIN.y + HEIGHT, MIN.z + WIDTH);
|
||||
|
||||
public static final BoundingBox BOUNDS = new BoundingBox(MIN, MAX);
|
||||
|
||||
protected PowerConduitNetwork network;
|
||||
|
||||
private int energyStoredRF;
|
||||
|
||||
private int subtype;
|
||||
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> rsModes = new EnumMap<ForgeDirection, RedstoneControlMode>(
|
||||
ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> rsColors = new EnumMap<ForgeDirection, DyeColor>(
|
||||
ForgeDirection.class);
|
||||
|
||||
protected EnumMap<ForgeDirection, Long> recievedTicks;
|
||||
|
||||
private final Map<ForgeDirection, Integer> externalRedstoneSignals = new HashMap<ForgeDirection, Integer>();
|
||||
|
||||
private boolean redstoneStateDirty = true;
|
||||
|
||||
public PowerConduitEndergy() {}
|
||||
public PowerConduitEndergy() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PowerConduitEndergy(int meta) {
|
||||
this.subtype = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectionsDirty() {
|
||||
return connectionsDirty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
DyeColor col = DyeColor.getColorFromDye(player.getCurrentEquippedItem());
|
||||
if (ConduitUtil.isProbeEquipped(player)) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
new PacketConduitProbe().sendInfoMessage(player, this);
|
||||
}
|
||||
return true;
|
||||
} else if (col != null && res.component != null && isColorBandRendered(res.component.dir)) {
|
||||
setExtractionSignalColor(res.component.dir, col);
|
||||
return true;
|
||||
} else if (ToolUtil.isToolEquipped(player)) {
|
||||
if (!getBundle().getEntity().getWorldObj().isRemote) {
|
||||
if (res != null && res.component != null) {
|
||||
ForgeDirection connDir = res.component.dir;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);
|
||||
if (connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
if (getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
|
||||
setConnectionMode(faceHit, getNextConnectionMode(faceHit));
|
||||
return true;
|
||||
}
|
||||
// Attempt to join networks
|
||||
return ConduitUtil.joinConduits(this, faceHit);
|
||||
} else if (externalConnections.contains(connDir)) {
|
||||
setConnectionMode(connDir, getNextConnectionMode(connDir));
|
||||
return true;
|
||||
} else if (containsConduitConnection(connDir)) {
|
||||
ConduitUtil.disconectConduits(this, connDir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isColorBandRendered(ForgeDirection dir) {
|
||||
return getConnectionMode(dir) != ConnectionMode.DISABLED
|
||||
&& getExtractionRedstoneMode(dir) != RedstoneControlMode.IGNORE;
|
||||
super(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor() {
|
||||
return getCapacitors()[subtype];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
rsModes.put(dir, mode);
|
||||
setClientStateDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getExtractionRedstoneMode(ForgeDirection dir) {
|
||||
RedstoneControlMode res = rsModes.get(dir);
|
||||
if (res == null) {
|
||||
res = RedstoneControlMode.IGNORE;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionSignalColor(ForgeDirection dir, DyeColor col) {
|
||||
rsColors.put(dir, col);
|
||||
setClientStateDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DyeColor getExtractionSignalColor(ForgeDirection dir) {
|
||||
DyeColor res = rsColors.get(dir);
|
||||
if (res == null) {
|
||||
res = DyeColor.RED;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
dataRoot.setShort("extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal());
|
||||
dataRoot.setShort("extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setShort("subtype", (short) subtype);
|
||||
nbtRoot.setInteger("energyStoredRF", energyStoredRF);
|
||||
|
||||
for (Entry<ForgeDirection, RedstoneControlMode> entry : rsModes.entrySet()) {
|
||||
if (entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("pRsMode." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
|
||||
for (Entry<ForgeDirection, DyeColor> entry : rsColors.entrySet()) {
|
||||
if (entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("pRsCol." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
subtype = nbtRoot.getShort("subtype");
|
||||
|
||||
if (nbtRoot.hasKey("energyStored")) {
|
||||
nbtRoot.setInteger("energyStoredRF", (int) (nbtRoot.getFloat("energyStored") * 10));
|
||||
}
|
||||
setEnergyStored(nbtRoot.getInteger("energyStoredRF"));
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "pRsMode." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
rsModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
}
|
||||
}
|
||||
key = "pRsCol." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < DyeColor.values().length) {
|
||||
rsColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
return energyStoredRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(int energyStored) {
|
||||
energyStoredRF = MathHelper.clamp_int(energyStored, 0, getMaxEnergyStored());
|
||||
}
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
if (mode == RedstoneControlMode.NEVER) {
|
||||
return false;
|
||||
}
|
||||
if (mode == RedstoneControlMode.IGNORE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DyeColor col = getExtractionSignalColor(dir);
|
||||
int signal = ConduitUtil.getInternalSignalForColor(getBundle(), col);
|
||||
int exSig = getExternalRedstoneSignalForDir(dir);
|
||||
boolean res;
|
||||
if (mode == RedstoneControlMode.OFF) {
|
||||
// if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
// if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int getExternalRedstoneSignalForDir(ForgeDirection dir) {
|
||||
if (redstoneStateDirty) {
|
||||
externalRedstoneSignals.clear();
|
||||
redstoneStateDirty = false;
|
||||
}
|
||||
Integer cached = externalRedstoneSignals.get(dir);
|
||||
int result;
|
||||
if (cached == null) {
|
||||
TileEntity te = getBundle().getEntity();
|
||||
result = te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord);
|
||||
externalRedstoneSignals.put(dir, result);
|
||||
} else {
|
||||
result = cached;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConnectionMode(dir);
|
||||
if (mode == ConnectionMode.OUTPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
}
|
||||
return getCapacitor().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyExtracted(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConnectionMode(dir);
|
||||
if (mode == ConnectionMode.INPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
}
|
||||
if (recievedRfThisTick(dir)) {
|
||||
return 0;
|
||||
}
|
||||
return getCapacitor().getMaxEnergyExtracted();
|
||||
}
|
||||
|
||||
private boolean recievedRfThisTick(ForgeDirection dir) {
|
||||
if (recievedTicks == null || dir == null
|
||||
|| recievedTicks.get(dir) == null
|
||||
|| getBundle() == null
|
||||
|| getBundle().getWorld() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long curTick = getBundle().getWorld().getTotalWorldTime();
|
||||
long recT = recievedTicks.get(dir);
|
||||
if (curTick - recT <= 5) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNeighborBlockChange(Block blockId) {
|
||||
redstoneStateDirty = true;
|
||||
if (network != null && network.powerManager != null) {
|
||||
network.powerManager.receptorsChanged();
|
||||
}
|
||||
return super.onNeighborBlockChange(blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConnectionMode(ForgeDirection dir, ConnectionMode mode) {
|
||||
super.setConnectionMode(dir, mode);
|
||||
recievedTicks = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
if (getMaxEnergyRecieved(from) == 0 || maxReceive <= 0) {
|
||||
return 0;
|
||||
}
|
||||
int freeSpace = getMaxEnergyStored() - getEnergyStored();
|
||||
int result = (int) Math.min(maxReceive, freeSpace);
|
||||
if (!simulate && result > 0) {
|
||||
setEnergyStored(getEnergyStored() + result);
|
||||
|
||||
if (getBundle() != null) {
|
||||
if (recievedTicks == null) {
|
||||
recievedTicks = new EnumMap<ForgeDirection, Long>(ForgeDirection.class);
|
||||
}
|
||||
recievedTicks.put(from, getBundle().getWorld().getTotalWorldTime());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConduitNetwork<?, ?> getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
|
||||
this.network = (PowerConduitNetwork) network;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToExternal(ForgeDirection direction, boolean ignoreDisabled) {
|
||||
IPowerInterface rec = getExternalPowerReceptor(direction);
|
||||
|
||||
return rec != null && rec.canConduitConnect(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit conduit) {
|
||||
boolean res = super.canConnectToConduit(direction, conduit);
|
||||
if (!res) {
|
||||
return false;
|
||||
}
|
||||
if (Config.powerConduitCanDifferentTiersConnect) {
|
||||
return res;
|
||||
}
|
||||
if (!(conduit instanceof IPowerConduit)) {
|
||||
return false;
|
||||
}
|
||||
IPowerConduit pc = (IPowerConduit) conduit;
|
||||
return pc.getMaxEnergyStored() == getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionAdded(ForgeDirection direction) {
|
||||
super.externalConnectionAdded(direction);
|
||||
if (network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.powerReceptorAdded(
|
||||
this,
|
||||
direction,
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ,
|
||||
getExternalPowerReceptor(direction));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionRemoved(ForgeDirection direction) {
|
||||
super.externalConnectionRemoved(direction);
|
||||
if (network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.powerReceptorRemoved(
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerInterface getExternalPowerReceptor(ForgeDirection direction) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
World world = te.getWorldObj();
|
||||
if (world == null) {
|
||||
return null;
|
||||
}
|
||||
TileEntity test = world.getTileEntity(
|
||||
te.xCoord + direction.offsetX,
|
||||
te.yCoord + direction.offsetY,
|
||||
te.zCoord + direction.offsetZ);
|
||||
if (test == null) {
|
||||
return null;
|
||||
}
|
||||
if (test instanceof IConduitBundle) {
|
||||
return null;
|
||||
}
|
||||
return PowerHandlerUtil.create(test);
|
||||
return getCapacitors()[getSubtype()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return createItemStackForSubtype(subtype);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IPowerConduit.class;
|
||||
return createItemStackForSubtype(getSubtype());
|
||||
}
|
||||
|
||||
// Rendering
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
if (component.dir == ForgeDirection.UNKNOWN) {
|
||||
return ICONS.get(ICON_CORE_KEY + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_CORE_KEY + POSTFIX[getSubtype()]);
|
||||
}
|
||||
if (COLOR_CONTROLLER_ID.equals(component.data)) {
|
||||
return IconUtil.whiteTexture;
|
||||
}
|
||||
return ICONS.get(ICON_KEY + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_KEY + POSTFIX[getSubtype()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_KEY_INPUT + POSTFIX[getSubtype()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT + POSTFIX[subtype]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTransmitionTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<CollidableComponent> createCollidables(CacheKey key) {
|
||||
Collection<CollidableComponent> baseCollidables = super.createCollidables(key);
|
||||
if (key.dir == ForgeDirection.UNKNOWN) {
|
||||
return baseCollidables;
|
||||
}
|
||||
|
||||
BoundingBox bb = ConduitGeometryUtil.instance.createBoundsForConnectionController(key.dir, key.offset);
|
||||
CollidableComponent cc = new CollidableComponent(IPowerConduit.class, bb, key.dir, COLOR_CONTROLLER_ID);
|
||||
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
result.addAll(baseCollidables);
|
||||
result.add(cc);
|
||||
|
||||
return result;
|
||||
return ICONS.get(ICON_KEY_OUTPUT + POSTFIX[getSubtype()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return getCapacitors()[subtype].getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displayPower() {
|
||||
return true;
|
||||
return getCapacitors()[getSubtype()].getMaxEnergyStored();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.conduit.redstone;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
|
||||
public interface IInsulatedRedstoneConduit extends IRedstoneConduit {
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
|
||||
public interface IRedstoneConduit extends IConduit {
|
||||
|
||||
@@ -21,13 +21,12 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.tileentity.IRedstoneControl;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
|
||||
import cofh.api.tileentity.IRedstoneControl;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOutputNode;
|
||||
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
@@ -36,6 +34,7 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetOutputNode;
|
||||
|
||||
public class RedstoneConduit extends AbstractConduit implements IRedstoneConduit {
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.enderio.core.api.client.render.VertexTransform;
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.VertexRotation;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class RedstoneSwitchBounds {
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package crazypants.enderio.conduit.render;
|
||||
|
||||
import static com.enderio.core.client.render.CubeRenderer.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
import static com.enderio.core.client.render.CubeRenderer.addVecWithUV;
|
||||
import static com.enderio.core.client.render.CubeRenderer.setupVertices;
|
||||
import static com.enderio.core.client.render.CubeRenderer.verts;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -101,6 +101,7 @@ public final class Config {
|
||||
public static int transceiverUpkeepCostRF = 10;
|
||||
public static int transceiverBucketTransmissionCostRF = 100;
|
||||
public static int transceiverMaxIoRF = 20480;
|
||||
public static int transceiverInternalBuffer = 500000;
|
||||
public static boolean transceiverUseEasyRecipe = false;
|
||||
|
||||
public static File configDirectory;
|
||||
@@ -320,6 +321,8 @@ public final class Config {
|
||||
public static boolean addFuelTooltipsToAllFluidContainers = true;
|
||||
public static boolean addFurnaceFuelTootip = true;
|
||||
public static boolean addDurabilityTootip = true;
|
||||
public static boolean renderDurabilityBar = true;
|
||||
public static boolean renderChargeBar = true;
|
||||
|
||||
public static int farmContinuousEnergyUseRF = 40;
|
||||
public static int farmActionEnergyUseRF = 500;
|
||||
@@ -438,6 +441,7 @@ public final class Config {
|
||||
|
||||
public static boolean isGasConduitEnabled = true;
|
||||
public static boolean enableMEConduits = true;
|
||||
public static boolean enableMEUltraDenseConduits = false;
|
||||
public static boolean enableOCConduits = true;
|
||||
public static boolean enableOCConduitsAnimatedTexture = true;
|
||||
|
||||
@@ -559,6 +563,8 @@ public final class Config {
|
||||
public static float inventoryPanelExtractCostPerItem = 12.0f;
|
||||
public static float inventoryPanelExtractCostPerOperation = 32.0f;
|
||||
|
||||
public static boolean strictTPItemChecking = true;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -1001,6 +1007,13 @@ public final class Config {
|
||||
transceiverMaxIoRF,
|
||||
"Maximum RF/t sent and received by a Dimensional Transceiver per tick. Input and output limits are not cumulative")
|
||||
.getInt(transceiverMaxIoRF);
|
||||
transceiverInternalBuffer = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"transceiverInternalBuffer",
|
||||
transceiverInternalBuffer,
|
||||
"Maximum RF for the send/receive buffer. Need to be at least transceiverMaxIoRF.")
|
||||
.getInt(transceiverInternalBuffer);
|
||||
transceiverBucketTransmissionCostRF = config
|
||||
.get(
|
||||
sectionEfficiency.name,
|
||||
@@ -1907,6 +1920,16 @@ public final class Config {
|
||||
"addFurnaceFuelTootip",
|
||||
addFuelTooltipsToAllFluidContainers,
|
||||
"If true, adds burn duration tooltips to furnace fuels").getBoolean(addFurnaceFuelTootip);
|
||||
renderChargeBar = config.get(
|
||||
sectionPersonal.name,
|
||||
"renderChargeBar",
|
||||
renderChargeBar,
|
||||
"If true, render the bar when an item has RF").getBoolean(renderChargeBar);
|
||||
renderDurabilityBar = config.get(
|
||||
sectionPersonal.name,
|
||||
"renderDurabilityBar",
|
||||
renderDurabilityBar,
|
||||
"If true, render the bar when an item is damaged").getBoolean(renderDurabilityBar);
|
||||
|
||||
farmContinuousEnergyUseRF = config.get(
|
||||
sectionFarm.name,
|
||||
@@ -2298,6 +2321,11 @@ public final class Config {
|
||||
sectionItems.name,
|
||||
enableMEConduits,
|
||||
"Allows ME conduits. Only has an effect with AE2 installed.");
|
||||
enableMEUltraDenseConduits = config.getBoolean(
|
||||
"enableMEUltraDenseConduits",
|
||||
sectionItems.name,
|
||||
enableMEUltraDenseConduits,
|
||||
"Allows ME Ultra Dense conduits. Only has an effect with AE2 installed.");
|
||||
enableOCConduits = config.getBoolean(
|
||||
"enableOCConduits",
|
||||
sectionItems.name,
|
||||
@@ -2858,6 +2886,12 @@ public final class Config {
|
||||
0.0f,
|
||||
10000.0f,
|
||||
"Internal power used per extract operation (independent of stack size)");
|
||||
strictTPItemChecking = config.get(
|
||||
sectionMisc.name,
|
||||
"strictTPItemChecking",
|
||||
strictTPItemChecking,
|
||||
"If true, turn on strict checking of item energy checking. This might cause traveling tools from third party mods to fire fake security warnings on server side and not function correctly.")
|
||||
.getBoolean(strictTPItemChecking);
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -22,6 +22,9 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
|
||||
buf.writeInt(Config.travelStaffMaxDistance);
|
||||
buf.writeInt(Config.travelStaffMaxBlinkDistance);
|
||||
buf.writeFloat(Config.travelStaffPowerPerBlockRF);
|
||||
buf.writeInt(Config.teleportStaffMaxDistance);
|
||||
buf.writeInt(Config.teleportStaffMaxBlinkDistance);
|
||||
buf.writeInt(Config.teleportStaffFailedBlinkDistance);
|
||||
buf.writeBoolean(Config.telepadLockCoords);
|
||||
buf.writeBoolean(Config.telepadLockDimension);
|
||||
}
|
||||
@@ -38,6 +41,9 @@ public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigS
|
||||
Config.travelStaffMaxDistance = data.readInt();
|
||||
Config.travelStaffMaxBlinkDistance = data.readInt();
|
||||
Config.travelStaffPowerPerBlockRF = data.readFloat();
|
||||
Config.teleportStaffMaxDistance = data.readInt();
|
||||
Config.teleportStaffMaxBlinkDistance = data.readInt();
|
||||
Config.teleportStaffFailedBlinkDistance = data.readInt();
|
||||
Config.telepadLockCoords = data.readBoolean();
|
||||
Config.telepadLockDimension = data.readBoolean();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
@@ -180,7 +181,11 @@ public class GuiEnderface extends GuiScreen {
|
||||
}
|
||||
}
|
||||
|
||||
distance -= Mouse.getDWheel() * 0.01;
|
||||
int wheelD = Mouse.getEventDWheel();
|
||||
if (!EnderIO.hasLwjgl3) {
|
||||
wheelD = MathHelper.clamp_int(wheelD, -1, 1);
|
||||
}
|
||||
distance -= wheelD;
|
||||
distance = VecmathUtil.clamp(distance, 0.1, 20);
|
||||
|
||||
long elapsed = EnderIO.proxy.getTickCount() - initTime;
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.util.EntityUtil;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class EntityWitherSkeleton extends EntitySkeleton {
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.enderio.core.client.gui.GuiContainerBase;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public abstract class GuiContainerBaseEIO extends GuiContainerBase {
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
@@ -156,7 +157,11 @@ public class IoConfigRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
distance -= Mouse.getEventDWheel() * 0.01;
|
||||
int wheelD = Mouse.getEventDWheel();
|
||||
if (!EnderIO.hasLwjgl3) {
|
||||
wheelD = MathHelper.clamp_int(wheelD, -1, 1);
|
||||
}
|
||||
distance -= wheelD;
|
||||
distance = VecmathUtil.clamp(distance, 0.01, 200);
|
||||
|
||||
long elapsed = System.currentTimeMillis() - initTime;
|
||||
|
||||
@@ -12,13 +12,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cofh.api.energy.ItemEnergyContainer;
|
||||
|
||||
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cofh.api.energy.ItemEnergyContainer;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
@@ -131,6 +130,10 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
if (maxReceive < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int res = super.receiveEnergy(container, maxReceive, simulate);
|
||||
if (res != 0 && !simulate) {
|
||||
updateDamage(container);
|
||||
@@ -148,6 +151,10 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
}
|
||||
|
||||
public int extractEnergyInternal(ItemStack container, int maxExtract, boolean simulate) {
|
||||
if (maxExtract < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int res = super.extractEnergy(container, maxExtract, simulate);
|
||||
if (res != 0 && !simulate) {
|
||||
updateDamage(container);
|
||||
@@ -229,4 +236,9 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return Config.renderDurabilityBar && super.showDurabilityBar(stack);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package crazypants.enderio.item;
|
||||
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.SOULARIUM;
|
||||
import static crazypants.enderio.material.Material.VIBRANT_CYSTAL;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@@ -20,11 +20,10 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cofh.api.block.IDismantleable;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
|
||||
import cofh.api.block.IDismantleable;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -27,14 +27,13 @@ import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.common.util.Util;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
@@ -16,15 +16,10 @@ import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
@@ -42,6 +37,10 @@ import crazypants.enderio.item.darksteel.upgrade.NaturalistEyeUpgrade;
|
||||
import crazypants.enderio.thaumcraft.GogglesOfRevealingUpgrade;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.core.IArmorNaturalist;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
|
||||
@InterfaceList({ @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||
@Interface(iface = "thaumcraft.api.IVisDiscountGear", modid = "Thaumcraft"),
|
||||
|
||||
@@ -24,12 +24,11 @@ import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -18,12 +18,11 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -332,6 +331,11 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
extractEnergy(equipped, power, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int canExtractInternal(ItemStack equipped, int power) {
|
||||
return Math.min(getEnergyStored(equipped), power);
|
||||
}
|
||||
|
||||
private boolean isTravelUpgradeActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return isEquipped(ep) && ep.isSneaking() && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,11 @@ import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -24,12 +24,11 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -395,6 +394,11 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
extractEnergy(equipped, power, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int canExtractInternal(ItemStack equipped, int power) {
|
||||
return Math.min(getEnergyStored(equipped), power);
|
||||
}
|
||||
|
||||
private boolean isTravelUpgradeActive(EntityPlayer ep, ItemStack equipped) {
|
||||
return isEquipped(ep) && ep.isSneaking() && TravelUpgrade.loadFromItem(equipped) != null;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,12 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
|
||||
public class PoweredItemRenderer implements IItemRenderer {
|
||||
@@ -44,26 +45,29 @@ public class PoweredItemRenderer implements IItemRenderer {
|
||||
ri.renderItemIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, 0, 0, true);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
if (isJustCrafted(item)) {
|
||||
if (isJustCrafted(item) || (!Config.renderChargeBar && !Config.renderDurabilityBar)) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean hasEnergyUpgrade = EnergyUpgrade.loadFromItem(item) != null;
|
||||
int y = hasEnergyUpgrade ? 12 : 13;
|
||||
int bgH = hasEnergyUpgrade ? 4 : 2;
|
||||
int y = (Config.renderDurabilityBar ^ Config.renderChargeBar) || !hasEnergyUpgrade ? 13 : 12;
|
||||
int bgH = (Config.renderDurabilityBar ^ Config.renderChargeBar) || !hasEnergyUpgrade ? 2 : 4;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderUtil.renderQuad2D(2, y, 0, 13, bgH, ColorUtil.getRGB(Color.black));
|
||||
|
||||
double maxDam = item.getMaxDamage();
|
||||
double dispDamage = item.getItemDamageForDisplay();
|
||||
y = hasEnergyUpgrade ? 14 : 13;
|
||||
renderBar(y, maxDam, dispDamage, Color.green, Color.red);
|
||||
double maxDam, dispDamage;
|
||||
if (Config.renderDurabilityBar) {
|
||||
maxDam = item.getMaxDamage();
|
||||
dispDamage = item.getItemDamageForDisplay();
|
||||
y = Config.renderChargeBar && hasEnergyUpgrade ? 14 : 13;
|
||||
renderBar(y, maxDam, dispDamage, Color.green, Color.red);
|
||||
}
|
||||
|
||||
if (hasEnergyUpgrade) {
|
||||
if (Config.renderChargeBar && hasEnergyUpgrade) {
|
||||
IEnergyContainerItem armor = (IEnergyContainerItem) item.getItem();
|
||||
maxDam = armor.getMaxEnergyStored(item);
|
||||
dispDamage = armor.getEnergyStored(item);
|
||||
y = 12;
|
||||
y = Config.renderDurabilityBar ? 12 : 13;
|
||||
Color color = new Color(0x2D, 0xCE, 0xFA); // electric blue
|
||||
renderBar2(y, maxDam, maxDam - dispDamage, color, color);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class SoundEntity extends Entity {
|
||||
|
||||
@@ -9,13 +9,13 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
|
||||
@Optional.Interface(iface = "thaumcraft.api.crafting.IInfusionStabiliser", modid = "Thaumcraft")
|
||||
public class BlockEndermanSkull extends BlockEio implements IInfusionStabiliser {
|
||||
|
||||
@@ -41,9 +41,9 @@ public class AbstractMachineRenderer implements ISimpleBlockRenderingHandler, II
|
||||
private CustomCubeRenderer ccr = new CustomCubeRenderer();
|
||||
|
||||
private PaintedBlockRenderer paintedRenderer = new PaintedBlockRenderer(this.getRenderId(), null); // passthrough
|
||||
// renderer for
|
||||
// paintable
|
||||
// machines
|
||||
// renderer for
|
||||
// paintable
|
||||
// machines
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
|
||||
@@ -9,7 +9,10 @@ import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.*;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity implements IInternalPoweredTile {
|
||||
|
||||
|
||||
@@ -2,19 +2,25 @@ package crazypants.enderio.machine;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class ContainerNoInv extends Container {
|
||||
import crazypants.enderio.machine.gui.IContainerWithTileEntity;
|
||||
|
||||
private IInventory inv;
|
||||
public class ContainerNoInv extends Container implements IContainerWithTileEntity {
|
||||
|
||||
public ContainerNoInv(IInventory inv) {
|
||||
super();
|
||||
this.inv = inv;
|
||||
private final AbstractMachineEntity tile;
|
||||
|
||||
public ContainerNoInv(AbstractMachineEntity tile) {
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return inv.isUseableByPlayer(player);
|
||||
return tile.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return tile;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import crazypants.enderio.machine.farm.FakeNetHandlerPlayServer;
|
||||
|
||||
public class FakePlayerEIO extends FakePlayer {
|
||||
|
||||
@@ -12,7 +12,6 @@ import crazypants.enderio.machine.recipe.RecipeBonusType;
|
||||
* progress' recipe for a machine is stored to and retrieved from a machines TileEntity soley based on its UID.
|
||||
*
|
||||
* @author cp
|
||||
*
|
||||
*/
|
||||
public interface IMachineRecipe {
|
||||
|
||||
@@ -50,7 +49,7 @@ public interface IMachineRecipe {
|
||||
/**
|
||||
* Returns the output from a single 'cycle' of the recipe (even if the inputs would allow the recipe to be crafted
|
||||
* several times).
|
||||
*
|
||||
* <p>
|
||||
* This method must not return null. If no output is generated an empty array should be returned.
|
||||
*
|
||||
* @param randomChance a random number to be used as a seed for determining whether '% chance' outputs are returned.
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import static crazypants.enderio.EnderIO.itemBasicCapacitor;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.util.RecipeUtil.*;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_GOLD;
|
||||
import static crazypants.enderio.material.Alloy.PHASED_IRON;
|
||||
import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY;
|
||||
import static crazypants.enderio.material.Alloy.SOULARIUM;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.ENDER_CRYSTAL;
|
||||
import static crazypants.enderio.material.Material.PULSATING_CYSTAL;
|
||||
import static crazypants.enderio.material.Material.SILICON;
|
||||
import static crazypants.enderio.material.Material.VIBRANT_CYSTAL;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -24,6 +34,7 @@ import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.util.RecipeUtil;
|
||||
|
||||
public class MachineRecipes {
|
||||
|
||||
@@ -62,13 +73,24 @@ public class MachineRecipes {
|
||||
String silicon = SILICON.oreDict;
|
||||
|
||||
if (Config.addPeacefulRecipes) {
|
||||
addShaped(frankenZombie, "gdg", "dzd", "gdg", 'g', "ingotGold", 'd', "gemDiamond", 'z', zombieController);
|
||||
addShaped(sentientEnder, "ddd", "ded", "dgd", 'g', "blockGold", 'd', "gemDiamond", 'e', enderRes);
|
||||
RecipeUtil.addShaped(
|
||||
frankenZombie,
|
||||
"gdg",
|
||||
"dzd",
|
||||
"gdg",
|
||||
'g',
|
||||
"ingotGold",
|
||||
'd',
|
||||
"gemDiamond",
|
||||
'z',
|
||||
zombieController);
|
||||
RecipeUtil
|
||||
.addShaped(sentientEnder, "ddd", "ded", "dgd", 'g', "blockGold", 'd', "gemDiamond", 'e', enderRes);
|
||||
}
|
||||
|
||||
// stirling gen
|
||||
ItemStack stirlingGen = new ItemStack(EnderIO.blockStirlingGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
stirlingGen,
|
||||
"bbb",
|
||||
"bfb",
|
||||
@@ -85,7 +107,7 @@ public class MachineRecipes {
|
||||
// Combustion Gen
|
||||
ItemStack res = new ItemStack(EnderIO.blockTank, 1, 0);
|
||||
ItemStack comGen = new ItemStack(EnderIO.blockCombustionGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
comGen,
|
||||
"eee",
|
||||
"rmr",
|
||||
@@ -103,7 +125,7 @@ public class MachineRecipes {
|
||||
|
||||
// ZombieGen
|
||||
ItemStack zg = new ItemStack(EnderIO.blockZombieGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
zg,
|
||||
"eee",
|
||||
"qzq",
|
||||
@@ -117,7 +139,7 @@ public class MachineRecipes {
|
||||
|
||||
// FrankenzombieGen
|
||||
ItemStack fg = new ItemStack(EnderIO.blockFrankenZombieGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
fg,
|
||||
"eee",
|
||||
"qzq",
|
||||
@@ -131,7 +153,7 @@ public class MachineRecipes {
|
||||
|
||||
// EnderGen
|
||||
ItemStack eg = new ItemStack(EnderIO.blockEnderGenerator, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
eg,
|
||||
"eee",
|
||||
"qzq",
|
||||
@@ -145,17 +167,18 @@ public class MachineRecipes {
|
||||
|
||||
// KillerJoe
|
||||
ItemStack kj = new ItemStack(EnderIO.blockKillerJoe, 1, 0);
|
||||
addShaped(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', frankenZombie);
|
||||
RecipeUtil.addShaped(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', frankenZombie);
|
||||
|
||||
// Wireless charger
|
||||
ItemStack wirelessCharger = new ItemStack(EnderIO.blockWirelessCharger);
|
||||
// addShaped(wirelessCharger, "svs", "imi", "scs", 's', electricSteel, 'i', silicon, 'm', machineChassi, 'c',
|
||||
// capacitor3, 'v', vibCry);
|
||||
addShaped(wirelessCharger, "sss", "ses", "scs", 's', electricalSteel, 'c', capacitor3, 'e', enderRes);
|
||||
RecipeUtil
|
||||
.addShaped(wirelessCharger, "sss", "ses", "scs", 's', electricalSteel, 'c', capacitor3, 'e', enderRes);
|
||||
|
||||
// Crafter
|
||||
ItemStack crafter = new ItemStack(EnderIO.blockCrafter, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
crafter,
|
||||
"iti",
|
||||
"imi",
|
||||
@@ -177,7 +200,7 @@ public class MachineRecipes {
|
||||
} else {
|
||||
zombieBit = zombieController;
|
||||
}
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
poweredSpawner,
|
||||
"ese",
|
||||
"eme",
|
||||
@@ -202,15 +225,16 @@ public class MachineRecipes {
|
||||
} else {
|
||||
glassSides = "glass";
|
||||
}
|
||||
addShaped(reservoir, "gfg", "gcg", "gfg", 'g', glassSides, 'c', Items.cauldron, 'f', fusedQuartz);
|
||||
RecipeUtil
|
||||
.addShaped(reservoir, "gfg", "gcg", "gfg", 'g', glassSides, 'c', Items.cauldron, 'f', fusedQuartz);
|
||||
}
|
||||
|
||||
// Tanks
|
||||
ItemStack basicTank = new ItemStack(EnderIO.blockTank, 1, 0);
|
||||
addShaped(basicTank, "ibi", "bgb", "ibi", 'g', "glass", 'i', "ingotIron", 'b', Blocks.iron_bars);
|
||||
RecipeUtil.addShaped(basicTank, "ibi", "bgb", "ibi", 'g', "glass", 'i', "ingotIron", 'b', Blocks.iron_bars);
|
||||
|
||||
ItemStack advTank = new ItemStack(EnderIO.blockTank, 1, 1);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
advTank,
|
||||
"ibi",
|
||||
"bgb",
|
||||
@@ -225,7 +249,7 @@ public class MachineRecipes {
|
||||
// mill
|
||||
ItemStack crusher = new ItemStack(EnderIO.blockCrusher, 1, 0);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
crusher,
|
||||
"ooo",
|
||||
"fmf",
|
||||
@@ -241,7 +265,7 @@ public class MachineRecipes {
|
||||
'o',
|
||||
Blocks.obsidian);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
crusher,
|
||||
"fff",
|
||||
"imi",
|
||||
@@ -259,7 +283,7 @@ public class MachineRecipes {
|
||||
// alloy smelter
|
||||
ItemStack alloySmelter = new ItemStack(EnderIO.blockAlloySmelter, 1, 0);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
alloySmelter,
|
||||
"bfb",
|
||||
"fmf",
|
||||
@@ -273,7 +297,7 @@ public class MachineRecipes {
|
||||
'f',
|
||||
Blocks.furnace);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
alloySmelter,
|
||||
"bfb",
|
||||
"fmf",
|
||||
@@ -290,7 +314,7 @@ public class MachineRecipes {
|
||||
|
||||
// Vat
|
||||
ItemStack still = new ItemStack(EnderIO.blockVat, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
still,
|
||||
"eve",
|
||||
"tmt",
|
||||
@@ -310,13 +334,14 @@ public class MachineRecipes {
|
||||
|
||||
ItemStack capBank1 = BlockItemCapBank
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.SIMPLE), 0);
|
||||
addShaped(capBank1, "bcb", "cmc", "bcb", 'b', "ingotIron", 'c', capacitor, 'm', "blockRedstone");
|
||||
RecipeUtil.addShaped(capBank1, "bcb", "cmc", "bcb", 'b', "ingotIron", 'c', capacitor, 'm', "blockRedstone");
|
||||
ItemStack capBank2 = BlockItemCapBank
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.ACTIVATED), 0);
|
||||
addShaped(capBank2, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor2, 'm', "blockRedstone");
|
||||
RecipeUtil
|
||||
.addShaped(capBank2, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor2, 'm', "blockRedstone");
|
||||
ItemStack capBank3 = BlockItemCapBank
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
RecipeUtil.addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
|
||||
ConvertOldRecipe convertRecipe = new ConvertOldRecipe();
|
||||
GameRegistry.addRecipe(convertRecipe);
|
||||
@@ -351,7 +376,7 @@ public class MachineRecipes {
|
||||
// painter
|
||||
ItemStack painter = new ItemStack(EnderIO.blockPainter, 1, 0);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
painter,
|
||||
"qqq",
|
||||
"mdm",
|
||||
@@ -367,7 +392,7 @@ public class MachineRecipes {
|
||||
'd',
|
||||
"gemDiamond");
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
painter,
|
||||
"qdq",
|
||||
"mMm",
|
||||
@@ -391,7 +416,7 @@ public class MachineRecipes {
|
||||
} else {
|
||||
zombieBit = zombieController;
|
||||
}
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
farm,
|
||||
"ehe",
|
||||
"eme",
|
||||
@@ -411,7 +436,7 @@ public class MachineRecipes {
|
||||
// transceiver
|
||||
ItemStack transceiver = new ItemStack(EnderIO.blockTransceiver, 1, 0);
|
||||
if (Config.transceiverUseEasyRecipe) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
transceiver,
|
||||
"oeo",
|
||||
"pdp",
|
||||
@@ -427,7 +452,7 @@ public class MachineRecipes {
|
||||
'd',
|
||||
Items.diamond);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
transceiver,
|
||||
"oeo",
|
||||
"pdp",
|
||||
@@ -442,7 +467,7 @@ public class MachineRecipes {
|
||||
fusedQuartz,
|
||||
'd',
|
||||
endCry);
|
||||
addShapeless(transceiver, new ItemStack(EnderIO.blockHyperCube, 1, 0));
|
||||
RecipeUtil.addShapeless(transceiver, new ItemStack(EnderIO.blockHyperCube, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +479,7 @@ public class MachineRecipes {
|
||||
ItemStack vibSolarPanel = new ItemStack(EnderIO.blockSolarPanel, 1, 2);
|
||||
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
solarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -469,7 +494,7 @@ public class MachineRecipes {
|
||||
energeticAlloy,
|
||||
'p',
|
||||
phasedGold);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
advSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -484,7 +509,7 @@ public class MachineRecipes {
|
||||
phasedIron,
|
||||
'p',
|
||||
phasedGold);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
vibSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -500,7 +525,7 @@ public class MachineRecipes {
|
||||
'p',
|
||||
phasedGold);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
solarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -515,7 +540,7 @@ public class MachineRecipes {
|
||||
energeticAlloy,
|
||||
'c',
|
||||
redstoneAlloy);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
advSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -530,7 +555,7 @@ public class MachineRecipes {
|
||||
phasedIron,
|
||||
'c',
|
||||
electricalSteel);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
vibSolarPanel,
|
||||
"efe",
|
||||
"pfp",
|
||||
@@ -553,7 +578,7 @@ public class MachineRecipes {
|
||||
ItemStack powerConduit = new ItemStack(EnderIO.itemPowerConduit, 1, 0);
|
||||
ItemStack redstoneConduit = new ItemStack(EnderIO.itemRedstoneConduit, 1, 2);
|
||||
ItemStack mJMonitor = new ItemStack(EnderIO.blockPowerMonitor, 1, 0);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
mJMonitor,
|
||||
"sms",
|
||||
"sMs",
|
||||
@@ -571,11 +596,11 @@ public class MachineRecipes {
|
||||
|
||||
// Enchanter
|
||||
ItemStack enchanter = new ItemStack(EnderIO.blockEnchanter);
|
||||
addShaped(enchanter, "dbd", "sss", " s ", 'd', "gemDiamond", 'b', Items.book, 's', darkSteel);
|
||||
RecipeUtil.addShaped(enchanter, "dbd", "sss", " s ", 'd', "gemDiamond", 'b', Items.book, 's', darkSteel);
|
||||
|
||||
// Vacuum Chest
|
||||
ItemStack vacuumChest = new ItemStack(EnderIO.blockVacuumChest);
|
||||
addShaped(vacuumChest, "iii", "ici", "ipi", 'i', "ingotIron", 'c', "chestWood", 'p', pulCry);
|
||||
RecipeUtil.addShaped(vacuumChest, "iii", "ici", "ipi", 'i', "ingotIron", 'c', "chestWood", 'p', pulCry);
|
||||
|
||||
// Soul Binder
|
||||
Object enderBit;
|
||||
@@ -588,7 +613,7 @@ public class MachineRecipes {
|
||||
ItemStack zombieSkull = new ItemStack(Items.skull, 1, 4);
|
||||
ItemStack skeletonSkull = new ItemStack(Items.skull, 1, 0);
|
||||
ItemStack soulBinder = new ItemStack(EnderIO.blockSoulFuser);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
soulBinder,
|
||||
"ses",
|
||||
"zmc",
|
||||
@@ -609,7 +634,7 @@ public class MachineRecipes {
|
||||
// Attractor
|
||||
ItemStack attractor = new ItemStack(EnderIO.blockAttractor);
|
||||
ItemStack attractorCrystal = new ItemStack(EnderIO.itemMaterial, 1, Material.ATTRACTOR_CRYSTAL.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
attractor,
|
||||
" c ",
|
||||
"ese",
|
||||
@@ -629,7 +654,7 @@ public class MachineRecipes {
|
||||
EnderIO.blockEndermanSkull,
|
||||
1,
|
||||
BlockEndermanSkull.SkullType.TORMENTED.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
aversion,
|
||||
" c ",
|
||||
"ese",
|
||||
@@ -646,12 +671,12 @@ public class MachineRecipes {
|
||||
// Experience
|
||||
ItemStack xp = new ItemStack(EnderIO.blockExperianceOblisk);
|
||||
ItemStack xpItem = new ItemStack(EnderIO.itemXpTransfer);
|
||||
addShaped(xp, " x ", " s ", "sms", 's', soularium, 'm', machineChassi, 'x', xpItem);
|
||||
RecipeUtil.addShaped(xp, " x ", " s ", "sms", 's', soularium, 'm', machineChassi, 'x', xpItem);
|
||||
|
||||
// Weather
|
||||
ItemStack weather = new ItemStack(EnderIO.blockWeatherObelisk);
|
||||
ItemStack weatherItem = new ItemStack(EnderIO.itemMaterial, 1, Material.WEATHER_CRYSTAL.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
weather,
|
||||
" x ",
|
||||
"ese",
|
||||
@@ -686,14 +711,14 @@ public class MachineRecipes {
|
||||
EnderIO.blockElectricLight,
|
||||
1,
|
||||
BlockItemElectricLight.Type.WIRELESS_INV.ordinal());
|
||||
addShapeless(wirelessLamp, poweredLamp, enderRes);
|
||||
addShapeless(wirelessLamp, wirelessLampInv, Blocks.redstone_torch);
|
||||
addShapeless(wirelessLampInv, poweredLampInv, enderRes);
|
||||
addShapeless(wirelessLampInv, wirelessLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(wirelessLamp, poweredLamp, enderRes);
|
||||
RecipeUtil.addShapeless(wirelessLamp, wirelessLampInv, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(wirelessLampInv, poweredLampInv, enderRes);
|
||||
RecipeUtil.addShapeless(wirelessLampInv, wirelessLamp, Blocks.redstone_torch);
|
||||
|
||||
// inventory panel
|
||||
ItemStack awareness = new ItemStack(EnderIO.itemFunctionUpgrade, 1, FunctionUpgrade.INVENTORY_PANEL.ordinal());
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
awareness,
|
||||
"bsb",
|
||||
"ses",
|
||||
@@ -707,7 +732,7 @@ public class MachineRecipes {
|
||||
'i',
|
||||
electricalSteel);
|
||||
ItemStack invPanel = new ItemStack(EnderIO.blockInventoryPanel);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
invPanel,
|
||||
"dad",
|
||||
"psp",
|
||||
@@ -727,7 +752,7 @@ public class MachineRecipes {
|
||||
|
||||
// powered light
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
poweredLamp,
|
||||
"ggg",
|
||||
"sds",
|
||||
@@ -741,7 +766,7 @@ public class MachineRecipes {
|
||||
'c',
|
||||
capacitor);
|
||||
} else {
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
poweredLamp,
|
||||
"ggg",
|
||||
"sds",
|
||||
@@ -756,19 +781,19 @@ public class MachineRecipes {
|
||||
capacitor);
|
||||
}
|
||||
ItemStack invPoweredLamp = new ItemStack(EnderIO.blockElectricLight, 1, 1);
|
||||
addShapeless(invPoweredLamp, poweredLamp, Blocks.redstone_torch);
|
||||
addShapeless(poweredLamp, invPoweredLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(invPoweredLamp, poweredLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(poweredLamp, invPoweredLamp, Blocks.redstone_torch);
|
||||
|
||||
// light
|
||||
ItemStack lamp = new ItemStack(EnderIO.blockElectricLight, 1, 2);
|
||||
addShaped(lamp, " ", "ggg", "isi", 'g', "glass", 's', "glowstone", 'i', "ingotIron");
|
||||
RecipeUtil.addShaped(lamp, " ", "ggg", "isi", 'g', "glass", 's', "glowstone", 'i', "ingotIron");
|
||||
ItemStack invLamp = new ItemStack(EnderIO.blockElectricLight, 1, 3);
|
||||
addShapeless(invLamp, lamp, Blocks.redstone_torch);
|
||||
addShapeless(lamp, invLamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(invLamp, lamp, Blocks.redstone_torch);
|
||||
RecipeUtil.addShapeless(lamp, invLamp, Blocks.redstone_torch);
|
||||
|
||||
// MJ Reader
|
||||
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
mJReader,
|
||||
"epe",
|
||||
"gcg",
|
||||
@@ -788,7 +813,7 @@ public class MachineRecipes {
|
||||
|
||||
// Slice'N'Splice
|
||||
ItemStack sns = new ItemStack(EnderIO.blockSliceAndSplice);
|
||||
addShaped(
|
||||
RecipeUtil.addShaped(
|
||||
sns,
|
||||
"iki",
|
||||
"ams",
|
||||
@@ -808,8 +833,28 @@ public class MachineRecipes {
|
||||
ItemStack itemBuffer = Type.getStack(Type.ITEM);
|
||||
ItemStack powerBuffer = Type.getStack(Type.POWER);
|
||||
ItemStack omniBuffer = Type.getStack(Type.OMNI);
|
||||
addShaped(itemBuffer, "isi", "scs", "isi", 'i', "ingotIron", 's', "ingotElectricalSteel", 'c', "chestWood");
|
||||
addShaped(powerBuffer, "isi", "sfs", "isi", 'i', "ingotIron", 's', "ingotElectricalSteel", 'f', machineChassis);
|
||||
addShapeless(omniBuffer, itemBuffer, powerBuffer);
|
||||
RecipeUtil.addShaped(
|
||||
itemBuffer,
|
||||
"isi",
|
||||
"scs",
|
||||
"isi",
|
||||
'i',
|
||||
"ingotIron",
|
||||
's',
|
||||
"ingotElectricalSteel",
|
||||
'c',
|
||||
"chestWood");
|
||||
RecipeUtil.addShaped(
|
||||
powerBuffer,
|
||||
"isi",
|
||||
"sfs",
|
||||
"isi",
|
||||
'i',
|
||||
"ingotIron",
|
||||
's',
|
||||
"ingotElectricalSteel",
|
||||
'f',
|
||||
machineChassis);
|
||||
RecipeUtil.addShapeless(omniBuffer, itemBuffer, powerBuffer);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 216 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user