mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
18
Commits
2.9.23
...
2.10.9-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c03f2055ae | ||
|
|
49327a7830 | ||
|
|
044f8a95de | ||
|
|
6ffd54baf6 | ||
|
|
ffe4296ef6 | ||
|
|
48beb6e2fc | ||
|
|
5083fb2a60 | ||
|
|
918b219413 | ||
|
|
fe95c2795c | ||
|
|
05ee12955d | ||
|
|
a7acc7e224 | ||
|
|
a59bb21e59 | ||
|
|
5b6c13ff0a | ||
|
|
6f8b6e2a9c | ||
|
|
479c8328b4 | ||
|
|
0c23f4937d | ||
|
|
cde2e4fa60 | ||
|
|
abbb6dc151 |
No files matched your search
+17
-16
@@ -1,24 +1,24 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.8:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.17:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.90-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.39:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.0:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.8.27:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.47: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')
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.13.54-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.14.14-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.14:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-688-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.464:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.18-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.33:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.7-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.13-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.19-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.9.15:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-752-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.4-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.138:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.22-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.6:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.4-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.17.7-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.6-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
|
||||
@@ -26,5 +26,6 @@ dependencies {
|
||||
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
|
||||
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta56:api') {transitive = false}
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta68:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.23:dev")
|
||||
}
|
||||
+9
-1
@@ -96,7 +96,9 @@ usesMixinDebug = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
@@ -172,6 +174,12 @@ curseForgeRelations =
|
||||
# projects. New projects should not use this parameter.
|
||||
# customArchiveBaseName =
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
|
||||
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-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+2
-2
@@ -70,11 +70,11 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -9,20 +7,27 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
import crazypants.enderio.machine.transceiver.ServerChannelRegister;
|
||||
import crazypants.enderio.machine.wireless.WirelessChargerController;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
private static final DecimalFormat FORMAT = new DecimalFormat("########0.000");
|
||||
|
||||
protected long serverTickCount = 0;
|
||||
protected long clientTickCount = 0;
|
||||
protected final TickTimer tickTimer = new TickTimer();
|
||||
public ConduitNetworkTickHandler conduitNetworkTickHandler = null;
|
||||
public WirelessChargerController wirelessChargerController = null;
|
||||
|
||||
public CommonProxy() {}
|
||||
|
||||
@@ -44,7 +49,7 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void loadIcons() {
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
public void load() {
|
||||
@@ -76,6 +81,26 @@ public class CommonProxy {
|
||||
return new ResourceLocation(EnderIO.DOMAIN + TEXTURE_PATH + name + TEXTURE_EXT);
|
||||
}
|
||||
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
conduitNetworkTickHandler = new ConduitNetworkTickHandler();
|
||||
FMLCommonHandler.instance().bus().register(conduitNetworkTickHandler);
|
||||
wirelessChargerController = new WirelessChargerController();
|
||||
FMLCommonHandler.instance().bus().register(wirelessChargerController);
|
||||
}
|
||||
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
HyperCubeRegister.load();
|
||||
ServerChannelRegister.load();
|
||||
}
|
||||
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
HyperCubeRegister.unload();
|
||||
FMLCommonHandler.instance().bus().unregister(conduitNetworkTickHandler);
|
||||
conduitNetworkTickHandler = null;
|
||||
FMLCommonHandler.instance().bus().unregister(wirelessChargerController);
|
||||
wirelessChargerController = null;
|
||||
}
|
||||
|
||||
public final class TickTimer {
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -38,6 +38,7 @@ import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -111,7 +112,6 @@ import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockEnd
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockFrankenZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.PacketNutrientTank;
|
||||
import crazypants.enderio.machine.hypercube.BlockHyperCube;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
import crazypants.enderio.machine.invpanel.BlockInventoryPanel;
|
||||
import crazypants.enderio.machine.killera.BlockKillerJoe;
|
||||
import crazypants.enderio.machine.light.BlockElectricLight;
|
||||
@@ -213,6 +213,7 @@ public class EnderIO {
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
public static final boolean hasHP = Loader.isModLoaded("hodgepodge");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -486,7 +487,9 @@ public class EnderIO {
|
||||
itemGrindingBall = ItemGrindingBall.create();
|
||||
itemAlloyEndergy = ItemAlloyEndergy.create();
|
||||
itemGrindingBallEndergy = ItemGrindingBallEndergy.create();
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
if (!hasGT5) {
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
}
|
||||
|
||||
registerFluids();
|
||||
|
||||
@@ -726,7 +729,9 @@ public class EnderIO {
|
||||
SkeletonHandler.registerSkeleton(this);
|
||||
}
|
||||
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
if (!hasGT5) {
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
}
|
||||
|
||||
EnderfaceRecipes.addRecipes();
|
||||
MaterialRecipes.addRecipes();
|
||||
@@ -889,22 +894,18 @@ public class EnderIO {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarted(FMLServerStartedEvent event) {
|
||||
HyperCubeRegister.load();
|
||||
ServerChannelRegister.load();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldSaved(WorldEvent.Save event) {
|
||||
// Only save together with the overworld, because this gets called for every dimension separately
|
||||
if (event.world.provider != null && event.world.provider.dimensionId == 0) {
|
||||
ServerChannelRegister.store();
|
||||
}
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
proxy.onServerAboutToStart(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
HyperCubeRegister.unload();
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
proxy.onServerStarted(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
proxy.onServerStopped(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -916,4 +917,12 @@ public class EnderIO {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldSaved(WorldEvent.Save event) {
|
||||
// Only save together with the overworld, because this gets called for every dimension separately
|
||||
if (event.world.provider != null && event.world.provider.dimensionId == 0) {
|
||||
ServerChannelRegister.store();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import java.util.List;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
// I=base type, I is the base class of the implementations accepted by the network
|
||||
public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
|
||||
@@ -64,7 +66,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
public void addConduit(I con) {
|
||||
if (!conduits.contains(con)) {
|
||||
if (conduits.isEmpty()) {
|
||||
ConduitNetworkTickHandler.instance.registerNetwork(this);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.registerNetwork(this);
|
||||
}
|
||||
conduits.add(con);
|
||||
}
|
||||
@@ -75,7 +77,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
con.setNetwork(null);
|
||||
}
|
||||
conduits.clear();
|
||||
ConduitNetworkTickHandler.instance.unregisterNetwork(this);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.unregisterNetwork(this);
|
||||
}
|
||||
|
||||
public List<I> getConduits() {
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -93,9 +92,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
public static BlockConduitBundle create() {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(ConduitNetworkTickHandler.instance);
|
||||
FMLCommonHandler.instance().bus().register(ConduitNetworkTickHandler.instance);
|
||||
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketFluidLevel.class, PacketFluidLevel.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketHandler.INSTANCE
|
||||
|
||||
@@ -10,18 +10,15 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
public class ConduitNetworkTickHandler {
|
||||
|
||||
public static final ConduitNetworkTickHandler instance = new ConduitNetworkTickHandler();
|
||||
public interface TickListener {
|
||||
|
||||
public static interface TickListener {
|
||||
void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
}
|
||||
|
||||
private final List<TickListener> listeners = new ArrayList<TickListener>();
|
||||
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean>();
|
||||
private final List<TickListener> listeners = new ArrayList<>();
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<>();
|
||||
|
||||
public void addListener(TickListener listener) {
|
||||
listeners.add(listener);
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -41,8 +40,8 @@ public class NetworkedInventory {
|
||||
|
||||
int tickDeficit;
|
||||
|
||||
// work around for a vanilla chest changing into a double chest without doing unneeded checks all the time
|
||||
boolean recheckInv = false;
|
||||
private TileEntity connectedTileEntity;
|
||||
|
||||
// Hack for TiC crafting station not working correctly when setting output slot to null
|
||||
boolean ticHack = false;
|
||||
|
||||
@@ -61,19 +60,13 @@ public class NetworkedInventory {
|
||||
this.location = location;
|
||||
world = con.getBundle().getWorld();
|
||||
|
||||
TileEntity te = world.getTileEntity(location.x, location.y, location.z);
|
||||
if (te.getClass().getName().equals("tconstruct.tools.logic.CraftingStationLogic")) {
|
||||
ticHack = true;
|
||||
} else if (te.getClass().getName().contains("cpw.mods.ironchest")) {
|
||||
recheckInv = true;
|
||||
} else if (te instanceof TileEntityChest) {
|
||||
recheckInv = true;
|
||||
} else if (te instanceof TileInventoryPanel) {
|
||||
inventoryPanel = true;
|
||||
}
|
||||
updateInventory();
|
||||
}
|
||||
|
||||
public boolean isInvalid() {
|
||||
return connectedTileEntity == null || connectedTileEntity.isInvalid();
|
||||
}
|
||||
|
||||
public boolean hasTarget(IItemConduit conduit, ForgeDirection dir) {
|
||||
for (Target t : sendPriority) {
|
||||
if (t.inv.con == conduit && t.inv.conDir == dir) {
|
||||
@@ -110,6 +103,13 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
if (isInvalid()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (tickDeficit > 0 || !canExtract() || !con.isExtractionRedstoneConditionMet(conDir)) {
|
||||
// do nothing
|
||||
} else {
|
||||
@@ -144,11 +144,6 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
private boolean transferItems() {
|
||||
|
||||
if (recheckInv) {
|
||||
updateInventory();
|
||||
}
|
||||
|
||||
int[] slotIndices = getInventory().getAccessibleSlotsFromSide(inventorySide);
|
||||
if (slotIndices == null) {
|
||||
return false;
|
||||
@@ -257,9 +252,6 @@ public class NetworkedInventory {
|
||||
matchedStickyInput = of != null && of.isValid() && of.doesItemPassFilter(this, toExtract);
|
||||
}
|
||||
if (target.stickyInput || !matchedStickyInput) {
|
||||
if (target.inv.recheckInv) {
|
||||
target.inv.updateInventory();
|
||||
}
|
||||
int inserted = target.inv.insertItem(toExtract);
|
||||
if (inserted > 0) {
|
||||
toExtract.stackSize -= inserted;
|
||||
@@ -281,15 +273,38 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public final void updateInventory() {
|
||||
TileEntity te = world.getTileEntity(location.x, location.y, location.z);
|
||||
if (te instanceof ISidedInventory) {
|
||||
inv = (ISidedInventory) te;
|
||||
} else if (te instanceof IInventory) {
|
||||
inv = new InventoryWrapper((IInventory) te);
|
||||
TileEntity newTe = world.getTileEntity(location.x, location.y, location.z);
|
||||
if (newTe != connectedTileEntity) {
|
||||
connectedTileEntity = newTe;
|
||||
ticHack = false;
|
||||
inventoryPanel = false;
|
||||
if (connectedTileEntity != null) {
|
||||
if (connectedTileEntity.getClass().getName().equals("tconstruct.tools.logic.CraftingStationLogic")) {
|
||||
ticHack = true;
|
||||
} else if (connectedTileEntity instanceof TileInventoryPanel) {
|
||||
inventoryPanel = true;
|
||||
}
|
||||
}
|
||||
network.routesChanged();
|
||||
}
|
||||
|
||||
if (connectedTileEntity instanceof ISidedInventory) {
|
||||
inv = (ISidedInventory) connectedTileEntity;
|
||||
} else if (connectedTileEntity instanceof IInventory) {
|
||||
inv = new InventoryWrapper((IInventory) connectedTileEntity);
|
||||
} else {
|
||||
inv = null;
|
||||
}
|
||||
}
|
||||
|
||||
private int insertItem(ItemStack item) {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
if (isInvalid()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!canInsert() || item == null) {
|
||||
return 0;
|
||||
}
|
||||
@@ -410,7 +425,7 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public ISidedInventory getInventoryRecheck() {
|
||||
if (recheckInv) {
|
||||
if (isInvalid()) {
|
||||
updateInventory();
|
||||
}
|
||||
return inv;
|
||||
|
||||
@@ -11,12 +11,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.enderio.core.common.util.ChatUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.MouseInputEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
@@ -134,6 +136,18 @@ public class KeyTracker {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(KeyInputEvent event) {
|
||||
handleInput();
|
||||
}
|
||||
|
||||
// mouse button presses arrive on a separate event
|
||||
@SubscribeEvent
|
||||
public void onMouseInput(MouseInputEvent event) {
|
||||
if (Mouse.getEventButton() >= 0) {
|
||||
handleInput();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleInput() {
|
||||
handleGlide();
|
||||
handleSoundDetector();
|
||||
handleNightVision();
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.enderio.core.common.util.RoundRobinIterator;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
@@ -212,7 +212,7 @@ public class CapBankNetwork implements ICapBankNetwork {
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if (curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
ConduitNetworkTickHandler.instance.addListener(tickListener);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.addListener(tickListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package crazypants.enderio.machine.farm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
@@ -31,7 +33,6 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractPoweredTaskEntity;
|
||||
import crazypants.enderio.machine.ContinuousTask;
|
||||
import crazypants.enderio.machine.IMachineRecipe.ResultStack;
|
||||
import crazypants.enderio.machine.IPoweredTask;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.machine.farm.farmers.FarmersCommune;
|
||||
@@ -48,6 +49,8 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
private static final int TICKS_PER_WORK = 20;
|
||||
private boolean showingRange;
|
||||
|
||||
private final List<ItemStack> harvestBuffer = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
@@ -424,6 +427,38 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
wasActive = isActive();
|
||||
worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
|
||||
}
|
||||
tryMoveFromBuffer();
|
||||
}
|
||||
|
||||
private void tryMoveFromBuffer() {
|
||||
if (harvestBuffer.isEmpty() || worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ItemStack> toRemove = new ArrayList<>();
|
||||
for (ItemStack stack : harvestBuffer) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
toRemove.add(stack);
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack remaining = tryInsertToInputSlots(stack);
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
remaining = tryInsertToOutputSlots(remaining);
|
||||
}
|
||||
|
||||
if (remaining == null || remaining.stackSize == 0) {
|
||||
toRemove.add(stack);
|
||||
} else {
|
||||
stack.stackSize = remaining.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
harvestBuffer.removeAll(toRemove);
|
||||
|
||||
if (!toRemove.isEmpty()) {
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -445,9 +480,18 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
setNotification("noPower");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isBufferNotEmpty() || isOutputFull()) {
|
||||
setNotification("outputFull");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isBufferNotEmpty() {
|
||||
return !harvestBuffer.isEmpty();
|
||||
}
|
||||
|
||||
protected void doTick() {
|
||||
|
||||
if (sendNotification && shouldDoWorkThisTick(TICKS_PER_WORK)) {
|
||||
@@ -488,7 +532,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
block = worldObj.getBlock(bc.x, bc.y, bc.z);
|
||||
}
|
||||
|
||||
if (isOutputFull()) {
|
||||
if (isOutputFull() || isBufferNotEmpty()) {
|
||||
setNotification("outputFull");
|
||||
return;
|
||||
}
|
||||
@@ -507,10 +551,8 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
new TargetPoint(worldObj.provider.dimensionId, bc.x, bc.y, bc.z, Config.farmParticlesMaxRange));
|
||||
for (EntityItem ei : harvest.getDrops()) {
|
||||
if (ei != null) {
|
||||
insertHarvestDrop(ei, bc);
|
||||
if (!ei.isDead) {
|
||||
worldObj.spawnEntityInWorld(ei);
|
||||
}
|
||||
addToBuffer(ei.getEntityItem().copy());
|
||||
ei.setDead();
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -552,6 +594,99 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
}
|
||||
}
|
||||
|
||||
private void addToBuffer(ItemStack stack) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ItemStack bufStack : harvestBuffer) {
|
||||
if (bufStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(bufStack, stack)) {
|
||||
int canAdd = bufStack.stackSize;
|
||||
if (canAdd > 0) {
|
||||
int addAmount = Math.min(canAdd, stack.stackSize);
|
||||
bufStack.stackSize += addAmount;
|
||||
stack.stackSize -= addAmount;
|
||||
|
||||
if (stack.stackSize <= 0) {
|
||||
markDirty();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
harvestBuffer.add(stack.copy());
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private ItemStack tryInsertToInputSlots(ItemStack stack) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
for (int i = minSupSlot; i <= maxSupSlot; i++) {
|
||||
if (stack.stackSize <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
ItemStack slotStack = inventory[i];
|
||||
int stackLimit = getInventoryStackLimit(i);
|
||||
|
||||
if (isItemValidForSlot(i, stack)) {
|
||||
if (slotStack == null) {
|
||||
if (!isSlotLocked(i) || (inventory[i] != null && inventory[i].isItemEqual(stack))) {
|
||||
int amount = Math.min(stack.stackSize, stackLimit);
|
||||
inventory[i] = stack.copy();
|
||||
inventory[i].stackSize = amount;
|
||||
stack.stackSize -= amount;
|
||||
markDirty();
|
||||
}
|
||||
} else if (slotStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(slotStack, stack)) {
|
||||
int canAdd = Math.min(stackLimit - slotStack.stackSize, stack.stackSize);
|
||||
if (canAdd > 0) {
|
||||
slotStack.stackSize += canAdd;
|
||||
stack.stackSize -= canAdd;
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack.stackSize > 0 ? stack : null;
|
||||
}
|
||||
|
||||
private ItemStack tryInsertToOutputSlots(ItemStack stack) {
|
||||
if (stack == null || stack.stackSize <= 0) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
for (int i = slotDefinition.minOutputSlot; i <= slotDefinition.maxOutputSlot; i++) {
|
||||
if (stack.stackSize <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
ItemStack slotStack = inventory[i];
|
||||
int stackLimit = 64;
|
||||
|
||||
if (slotStack == null) {
|
||||
int amount = Math.min(stack.stackSize, stackLimit);
|
||||
inventory[i] = stack.copy();
|
||||
inventory[i].stackSize = amount;
|
||||
stack.stackSize -= amount;
|
||||
markDirty();
|
||||
} else if (slotStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(slotStack, stack)) {
|
||||
int canAdd = Math.min(stackLimit - slotStack.stackSize, stack.stackSize);
|
||||
if (canAdd > 0) {
|
||||
slotStack.stackSize += canAdd;
|
||||
stack.stackSize -= canAdd;
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack.stackSize > 0 ? stack : null;
|
||||
}
|
||||
|
||||
private int bonemealCooldown = 5; // no need to persist this
|
||||
|
||||
private boolean hasBonemeal() {
|
||||
@@ -652,68 +787,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
return minSupSlot + 3;
|
||||
}
|
||||
|
||||
private void insertHarvestDrop(Entity entity, BlockCoord bc) {
|
||||
if (!worldObj.isRemote) {
|
||||
if (entity instanceof EntityItem && !entity.isDead) {
|
||||
EntityItem item = (EntityItem) entity;
|
||||
ItemStack stack = item.getEntityItem().copy();
|
||||
int numInserted = insertResult(stack, bc);
|
||||
stack.stackSize -= numInserted;
|
||||
item.setEntityItemStack(stack);
|
||||
if (stack.stackSize == 0) {
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int insertResult(ItemStack stack, BlockCoord bc) {
|
||||
|
||||
int slot = bc != null ? getSupplySlotForCoord(bc) : minSupSlot;
|
||||
int[] slots = new int[NUM_SUPPLY_SLOTS];
|
||||
int k = 0;
|
||||
for (int j = slot; j <= maxSupSlot; j++) {
|
||||
slots[k++] = j;
|
||||
}
|
||||
for (int j = minSupSlot; j < slot; j++) {
|
||||
slots[k++] = j;
|
||||
}
|
||||
|
||||
int origSize = stack.stackSize;
|
||||
stack = stack.copy();
|
||||
|
||||
int inserted = 0;
|
||||
for (int j = 0; j < slots.length && inserted < stack.stackSize; j++) {
|
||||
int i = slots[j];
|
||||
ItemStack curStack = inventory[i];
|
||||
int inventoryStackLimit = getInventoryStackLimit(i);
|
||||
if (isItemValidForSlot(i, stack) && (curStack == null || curStack.stackSize < inventoryStackLimit)) {
|
||||
if (curStack == null) {
|
||||
if (stack.stackSize < inventoryStackLimit) {
|
||||
inventory[i] = stack.copy();
|
||||
inserted = stack.stackSize;
|
||||
} else {
|
||||
inventory[i] = stack.copy();
|
||||
inserted = inventoryStackLimit;
|
||||
inventory[i].stackSize = inserted;
|
||||
}
|
||||
} else if (curStack.isItemEqual(stack)) {
|
||||
inserted = Math.min(inventoryStackLimit - curStack.stackSize, stack.stackSize);
|
||||
inventory[i].stackSize += inserted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack.stackSize -= inserted;
|
||||
if (inserted >= origSize) {
|
||||
return origSize;
|
||||
}
|
||||
|
||||
ResultStack[] in = new ResultStack[] { new ResultStack(stack) };
|
||||
mergeResults(in);
|
||||
return origSize - (in[0].item == null ? 0 : in[0].item.stackSize);
|
||||
}
|
||||
|
||||
private @Nonnull BlockCoord getNextCoord() {
|
||||
|
||||
int size = getFarmSize();
|
||||
@@ -752,11 +825,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
return EnderIO.blockFarmStation.getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockFarmStation.unlocalisedName;
|
||||
@@ -811,6 +879,17 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
} else if (slotLayoutVersion == 2) {
|
||||
inventory = (new ArrayMappingTool<ItemStack>("TTTSSSSOOOOOOC", "TTTBBSSSSOOOOOOC")).map(inventory);
|
||||
}
|
||||
|
||||
if (nbtRoot.hasKey("HarvestBuffer")) {
|
||||
NBTTagList bufferList = nbtRoot.getTagList("HarvestBuffer", 10);
|
||||
for (int i = 0; i < bufferList.tagCount(); i++) {
|
||||
NBTTagCompound itemTag = bufferList.getCompoundTagAt(i);
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(itemTag);
|
||||
if (stack != null && stack.stackSize > 0) {
|
||||
harvestBuffer.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IPoweredTask createTask() {
|
||||
@@ -834,6 +913,18 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IRange
|
||||
nbtRoot.setIntArray("lockedSlots", locked);
|
||||
}
|
||||
nbtRoot.setInteger("slotLayoutVersion", 3);
|
||||
|
||||
if (!harvestBuffer.isEmpty()) {
|
||||
NBTTagList bufferList = new NBTTagList();
|
||||
for (ItemStack stack : harvestBuffer) {
|
||||
if (stack != null && stack.stackSize > 0) {
|
||||
NBTTagCompound itemTag = new NBTTagCompound();
|
||||
stack.writeToNBT(itemTag);
|
||||
bufferList.appendTag(itemTag);
|
||||
}
|
||||
}
|
||||
nbtRoot.setTag("HarvestBuffer", bufferList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,9 @@ import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.mitchej123.hodgepodge.mixins.interfaces.INetherSeed;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.farm.TileFarmStation;
|
||||
|
||||
public class PlantableFarmer implements IFarmerJoe {
|
||||
@@ -109,7 +111,13 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
|
||||
protected boolean plant(TileFarmStation farm, World worldObj, BlockCoord bc, IPlantable plantable) {
|
||||
worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
|
||||
Block target = plantable.getPlant(null, 0, 0, 0);
|
||||
Block target;
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
target = netherSeed.hodgepodge$getPlant(null, 0, 0, 0);
|
||||
} else {
|
||||
target = plantable.getPlant(null, 0, 0, 0);
|
||||
}
|
||||
int meta = plantable.getPlantMetadata(null, 0, 0, 0);
|
||||
worldObj.setBlock(bc.x, bc.y, bc.z, target, meta, 1 | 2);
|
||||
farm.actionPerformed(false);
|
||||
@@ -117,7 +125,13 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
protected boolean canPlant(World worldObj, BlockCoord bc, IPlantable plantable) {
|
||||
Block target = plantable.getPlant(null, 0, 0, 0);
|
||||
Block target;
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
target = netherSeed.hodgepodge$getPlant(null, 0, 0, 0);
|
||||
} else {
|
||||
target = plantable.getPlant(null, 0, 0, 0);
|
||||
}
|
||||
Block ground = worldObj.getBlock(bc.x, bc.y - 1, bc.z);
|
||||
if (target != null && target.canPlaceBlockAt(worldObj, bc.x, bc.y, bc.z)
|
||||
&& target.canBlockStay(worldObj, bc.x, bc.y, bc.z)
|
||||
@@ -182,10 +196,14 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
private boolean isPlantableForBlock(ItemStack stack, Block block) {
|
||||
if (!(stack.getItem() instanceof IPlantable)) {
|
||||
return false;
|
||||
if (stack.getItem() instanceof IPlantable plantable) {
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
return netherSeed.hodgepodge$getPlant(null, 0, 0, 0) == block;
|
||||
} else {
|
||||
return plantable.getPlant(null, 0, 0, 0) == block;
|
||||
}
|
||||
}
|
||||
IPlantable plantable = (IPlantable) stack.getItem();
|
||||
return plantable.getPlant(null, 0, 0, 0) == block;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class BlockPaintedGlowstone extends BlockEio
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:conduitConnector");
|
||||
blockIcon = IIconRegister.registerIcon("glowstone");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,10 +231,12 @@ public class BlockPaintedGlowstone extends BlockEio
|
||||
|
||||
@Override
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEnder te, ItemStack drop) {
|
||||
TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
|
||||
if (tef != null) {
|
||||
if (te instanceof TileEntityPaintedBlock tef) {
|
||||
ItemStack itemStack = createItemStackForSourceBlock(tef.getSourceBlock(), tef.getSourceBlockMetadata());
|
||||
drop.stackTagCompound = (NBTTagCompound) itemStack.stackTagCompound.copy();
|
||||
NBTTagCompound tag = itemStack.stackTagCompound;
|
||||
if (tag != null) {
|
||||
drop.stackTagCompound = (NBTTagCompound) tag.copy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ public final class PainterUtil {
|
||||
sourceName = is.getDisplayName();
|
||||
}
|
||||
}
|
||||
return EnderIO.lang.localize("blockPainter.paintedWith") + " " + sourceName;
|
||||
return EnderIO.lang.localize("blockPainter.paintedWith") + " "
|
||||
+ (sourceName.isEmpty() ? EnderIO.lang.localize("blockPainter.paintedWith.none") : sourceName);
|
||||
}
|
||||
|
||||
public static void setSourceBlock(ItemStack item, Block source, int meta) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
@@ -28,7 +29,7 @@ public class TileWirelessCharger extends TileEntityEio implements IInternalPower
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
WirelessChargerController.instance.deregisterCharger(this);
|
||||
EnderIO.proxy.wirelessChargerController.deregisterCharger(this);
|
||||
registered = false;
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ public class TileWirelessCharger extends TileEntityEio implements IInternalPower
|
||||
}
|
||||
|
||||
if (!registered) {
|
||||
WirelessChargerController.instance.registerCharger(this);
|
||||
EnderIO.proxy.wirelessChargerController.registerCharger(this);
|
||||
registered = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package crazypants.enderio.machine.wireless;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -10,6 +8,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public class WirelessChargedLocation {
|
||||
|
||||
private final TileEntity te;
|
||||
@@ -18,34 +18,30 @@ public class WirelessChargedLocation {
|
||||
|
||||
public WirelessChargedLocation(TileEntity te) {
|
||||
this.te = te;
|
||||
this.chargers = new ArrayList<IWirelessCharger>();
|
||||
this.chargers = new ArrayList<>();
|
||||
/*
|
||||
* Set lastChangeCount to one less than the current change count so that the charger list is updated on first
|
||||
* use (unless ~4B changes happen in between). Do this instead directly updating so that WirelessChargedLocation
|
||||
* can be used while the TileEntity is still in construction (or loading).
|
||||
*/
|
||||
this.lastChangeCount = WirelessChargerController.instance.getChangeCount() - 1;
|
||||
this.lastChangeCount = EnderIO.proxy.wirelessChargerController.getChangeCount() - 1;
|
||||
}
|
||||
|
||||
private void updateChargers() {
|
||||
WirelessChargerController wcc = WirelessChargerController.instance;
|
||||
WirelessChargerController wcc = EnderIO.proxy.wirelessChargerController;
|
||||
chargers.clear();
|
||||
lastChangeCount = wcc.getChangeCount();
|
||||
final BlockCoord bc = new BlockCoord(te);
|
||||
wcc.getChargers(te.getWorldObj(), bc, chargers);
|
||||
Collections.sort(chargers, new Comparator<IWirelessCharger>() {
|
||||
|
||||
@Override
|
||||
public int compare(IWirelessCharger o1, IWirelessCharger o2) {
|
||||
int dist1 = o1.getLocation().getDistSq(bc);
|
||||
int dist2 = o2.getLocation().getDistSq(bc);
|
||||
return dist1 - dist2;
|
||||
}
|
||||
chargers.sort((o1, o2) -> {
|
||||
int dist1 = o1.getLocation().getDistSq(bc);
|
||||
int dist2 = o2.getLocation().getDistSq(bc);
|
||||
return dist1 - dist2;
|
||||
});
|
||||
}
|
||||
|
||||
private void checkChangeCount() {
|
||||
if (lastChangeCount != WirelessChargerController.instance.getChangeCount()) {
|
||||
if (lastChangeCount != EnderIO.proxy.wirelessChargerController.getChangeCount()) {
|
||||
updateChargers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -21,20 +19,17 @@ import crazypants.util.BaublesUtil;
|
||||
|
||||
public class WirelessChargerController {
|
||||
|
||||
public static WirelessChargerController instance = new WirelessChargerController();
|
||||
|
||||
public static final int RANGE = Config.wirelessChargerRange;
|
||||
public static final int RANGE_SQ = RANGE * RANGE;
|
||||
|
||||
static {
|
||||
FMLCommonHandler.instance().bus().register(WirelessChargerController.instance);
|
||||
MinecraftForge.EVENT_BUS.register(WirelessChargerController.instance);
|
||||
}
|
||||
|
||||
private static final int RANGE = Config.wirelessChargerRange;
|
||||
private static final int RANGE_SQ = RANGE * RANGE;
|
||||
private final Map<Integer, Map<BlockCoord, IWirelessCharger>> perWorldChargers = new HashMap<Integer, Map<BlockCoord, IWirelessCharger>>();
|
||||
private int changeCount;
|
||||
|
||||
private WirelessChargerController() {}
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
if (event.side != Side.CLIENT && event.phase == TickEvent.Phase.END) {
|
||||
chargePlayersItems(event.player);
|
||||
}
|
||||
}
|
||||
|
||||
public void registerCharger(IWirelessCharger charger) {
|
||||
if (charger == null) {
|
||||
@@ -54,28 +49,7 @@ public class WirelessChargerController {
|
||||
changeCount++;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
if (event.side == Side.CLIENT || event.phase != TickEvent.Phase.END) {
|
||||
return;
|
||||
}
|
||||
chargePlayersItems(event.player);
|
||||
}
|
||||
|
||||
public int getChangeCount() {
|
||||
return changeCount;
|
||||
}
|
||||
|
||||
public void getChargers(World world, BlockCoord bc, Collection<IWirelessCharger> res) {
|
||||
Map<BlockCoord, IWirelessCharger> chargers = getChargersForWorld(world);
|
||||
for (IWirelessCharger wc : chargers.values()) {
|
||||
if (wc.getLocation().getDistSq(bc) <= RANGE_SQ) {
|
||||
res.add(wc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void chargePlayersItems(EntityPlayer player) {
|
||||
private void chargePlayersItems(EntityPlayer player) {
|
||||
Map<BlockCoord, IWirelessCharger> chargers = getChargersForWorld(player.worldObj);
|
||||
if (chargers.isEmpty()) {
|
||||
return;
|
||||
@@ -108,13 +82,21 @@ public class WirelessChargerController {
|
||||
return res;
|
||||
}
|
||||
|
||||
private Map<BlockCoord, IWirelessCharger> getChargersForWorld(World world) {
|
||||
Map<BlockCoord, IWirelessCharger> res = perWorldChargers.get(world.provider.dimensionId);
|
||||
if (res == null) {
|
||||
res = new HashMap<BlockCoord, IWirelessCharger>();
|
||||
perWorldChargers.put(world.provider.dimensionId, res);
|
||||
public int getChangeCount() {
|
||||
return changeCount;
|
||||
}
|
||||
|
||||
public void getChargers(World world, BlockCoord bc, Collection<IWirelessCharger> res) {
|
||||
Map<BlockCoord, IWirelessCharger> chargers = getChargersForWorld(world);
|
||||
for (IWirelessCharger wc : chargers.values()) {
|
||||
if (wc.getLocation().getDistSq(bc) <= RANGE_SQ) {
|
||||
res.add(wc);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private Map<BlockCoord, IWirelessCharger> getChargersForWorld(World world) {
|
||||
return perWorldChargers.computeIfAbsent(world.provider.dimensionId, k -> new HashMap<>());
|
||||
}
|
||||
|
||||
public Collection<IWirelessCharger> getChargers(World world) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -9,6 +10,7 @@ import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@@ -20,6 +22,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
@@ -103,13 +106,46 @@ public class ItemCapacitor extends Item implements ICapacitorItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List<String> par3List,
|
||||
boolean par4) {
|
||||
String space = " ";
|
||||
EnumChatFormatting reset = EnumChatFormatting.RESET;
|
||||
if (par1ItemStack != null && par1ItemStack.getItemDamage() > 0 && par1ItemStack.getItemDamage() != 7) {
|
||||
par3List.add(EnderIO.lang.localize("machine.tooltip.upgrade"));
|
||||
ICapacitor capacitor = getCapacitor(par1ItemStack);
|
||||
par3List.add(EnumChatFormatting.GREEN + EnderIO.lang.localize("machine.tooltip.upgrade.name"));
|
||||
if (SpecialTooltipHandler.showAdvancedTooltips()) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(par3List, "enderio.machine.tooltip.upgrade");
|
||||
addUpgrades(par3List, capacitor, space, reset);
|
||||
addRangeUpgrade(par3List, capacitor, space, reset);
|
||||
} else {
|
||||
SpecialTooltipHandler.addShowDetailsTooltip(par3List);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addUpgrades(List<String> list, ICapacitor capacitor, String space, EnumChatFormatting reset) {
|
||||
DecimalFormat formatter = new DecimalFormat("#,###");
|
||||
String tierString = EnumChatFormatting.AQUA + EnderIO.lang.localize("machine.tooltip.upgrade.tier");
|
||||
String maxEnergyStorageString = EnumChatFormatting.AQUA
|
||||
+ EnderIO.lang.localize("machine.tooltip.upgrade.energystorage");
|
||||
String maxEnergyReceivedString = EnumChatFormatting.AQUA
|
||||
+ EnderIO.lang.localize("machine.tooltip.upgrade.energyreceived");
|
||||
String maxEnergyExtractedString = EnumChatFormatting.AQUA
|
||||
+ EnderIO.lang.localize("machine.tooltip.upgrade.energyextracted");
|
||||
String upgrades = EnumChatFormatting.GOLD + EnderIO.lang.localize("machine.tooltip.upgrade");
|
||||
String maxEnergyStorage = formatter.format(capacitor.getMaxEnergyStored());
|
||||
int tier = capacitor.getTier();
|
||||
String maxEnergyReceived = formatter.format(capacitor.getMaxEnergyReceived());
|
||||
String maxEnergyExtracted = formatter.format(capacitor.getMaxEnergyExtracted());
|
||||
list.add(upgrades);
|
||||
list.add(space + tierString + reset + tier);
|
||||
list.add(space + maxEnergyReceivedString + reset + maxEnergyReceived);
|
||||
list.add(space + maxEnergyExtractedString + reset + maxEnergyExtracted);
|
||||
list.add(space + maxEnergyStorageString + reset + maxEnergyStorage);
|
||||
}
|
||||
|
||||
public void addRangeUpgrade(List<String> list, ICapacitor capacitor, String space, EnumChatFormatting reset) {
|
||||
String farmStation = EnumChatFormatting.AQUA + EnderIO.lang.localize("machine.tooltip.upgrade.farmstation");
|
||||
String rangeUpgrade = EnumChatFormatting.GOLD + EnderIO.lang.localize("machine.tooltip.upgrade.range");
|
||||
int range = Config.farmBonusSize * capacitor.getTier() - 1 + 2;
|
||||
list.add(rangeUpgrade);
|
||||
list.add(space + farmStation + reset + range);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasGT5;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
@@ -58,10 +59,13 @@ public class MaterialRecipes {
|
||||
|
||||
public static void registerOresInDictionary() {
|
||||
// Ore Dictionary Registration
|
||||
for (PowderIngot powder : PowderIngot.values()) {
|
||||
if (!powder.hasDependancy()) {
|
||||
OreDictionary
|
||||
.registerOre(powder.oreDictName, new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
if (!hasGT5) {
|
||||
for (PowderIngot powder : PowderIngot.values()) {
|
||||
if (!powder.hasDependancy()) {
|
||||
OreDictionary.registerOre(
|
||||
powder.oreDictName,
|
||||
new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,17 +435,19 @@ public class MaterialRecipes {
|
||||
RecipeUtil.addShaped(vibCry, "nnn", "ngn", "nnn", 'n', vibrantNugget, 'g', "gemEmerald");
|
||||
|
||||
// Smelting
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack ingotIron = new ItemStack(Items.iron_ingot);
|
||||
ItemStack ingotGold = new ItemStack(Items.gold_ingot);
|
||||
if (!hasGT5) {
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack ingotIron = new ItemStack(Items.iron_ingot);
|
||||
ItemStack ingotGold = new ItemStack(Items.gold_ingot);
|
||||
|
||||
GameRegistry.addSmelting(dustIron, ingotIron, 0);
|
||||
GameRegistry.addSmelting(dustGold, ingotGold, 0);
|
||||
GameRegistry.addSmelting(dustIron, ingotIron, 0);
|
||||
GameRegistry.addSmelting(dustGold, ingotGold, 0);
|
||||
|
||||
// Ender Dusts
|
||||
ItemStack enderDust = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
RecipeUtil.addShaped(new ItemStack(Items.ender_pearl), "eee", "eee", "eee", 'e', enderDust);
|
||||
// Ender Dusts
|
||||
ItemStack enderDust = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
RecipeUtil.addShaped(new ItemStack(Items.ender_pearl), "eee", "eee", "eee", 'e', enderDust);
|
||||
}
|
||||
|
||||
// Dark Iron Bars
|
||||
ItemStack diBars = new ItemStack(EnderIO.blockDarkIronBars, 16, 0);
|
||||
@@ -564,24 +570,29 @@ public class MaterialRecipes {
|
||||
ItemStack darkRod = new ItemStack(EnderIO.itemMaterial, 1, Material.DARK_STEEL_ROD.ordinal());
|
||||
RecipeUtil.addShaped(darkRod, " ns", "nsn", "sn ", 's', darkSteel, 'n', endSteelNugget);
|
||||
|
||||
// Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
if (!hasGT5) {
|
||||
// Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
}
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
RecipeUtil.addShapeless(enderios, Items.bowl, Items.milk_bucket, "cropWheat", "dustEnderPearl");
|
||||
|
||||
if (OreDictionaryHelper.hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (OreDictionaryHelper.hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
if (!hasGT5) {
|
||||
if (OreDictionaryHelper.hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance
|
||||
.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (OreDictionaryHelper.hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
@@ -153,19 +152,6 @@ public class ThaumcraftCompat {
|
||||
ThaumcraftApi.registerObjectTag(
|
||||
new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.ENLIGHTENED_GLASS.ordinal()),
|
||||
new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.LIGHT, 8).add(Aspect.SENSES, 2));
|
||||
|
||||
// This is a horrible hack due to the fact that I am assembling my aspects after TC does recipe parsing
|
||||
// Therefore I redo all EIO items
|
||||
for (Object o : Item.itemRegistry.getKeys()) {
|
||||
if (o instanceof String) {
|
||||
String ownermod = ((String) o).substring(0, ((String) o).indexOf(':'));
|
||||
if (EnderIO.MODID.equals(ownermod)) {
|
||||
for (int idx = 0; idx < 16; idx++) {
|
||||
addAspectsFromRecipes((Item) Item.itemRegistry.getObject((String) o), idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static AspectList getAspects(Block block) {
|
||||
@@ -185,10 +171,6 @@ public class ThaumcraftCompat {
|
||||
return new AspectList(item);
|
||||
}
|
||||
|
||||
private static void addAspectsFromRecipes(Item item, int meta) {
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(item, 1, meta), ThaumcraftApiHelper.generateTags(item, meta));
|
||||
}
|
||||
|
||||
public static void loadUpgrades(List<IDarkSteelUpgrade> upgrades) {
|
||||
upgrades.add(GogglesOfRevealingUpgrade.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.util;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasGT5;
|
||||
import static crazypants.enderio.material.Material.BINDER_COMPOSITE;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET;
|
||||
@@ -9,6 +10,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -20,6 +22,7 @@ import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.ItemEnderFood.EnderFood;
|
||||
@@ -93,47 +96,59 @@ public class EE3Util {
|
||||
*/
|
||||
public static void registerMiscRecipes() {
|
||||
if (IS_EE3_LOADED) {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack stick4 = new ItemStack(Items.stick, 4);
|
||||
ItemStack cobble4 = new ItemStack(Blocks.cobblestone, 4);
|
||||
registerRecipe(basicGear, stick4, cobble4);
|
||||
|
||||
ItemStack flour10 = new ItemStack(EnderIO.itemPowderIngot, 10, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack wheat5 = new ItemStack(Items.wheat, 5);
|
||||
ItemStack seeds1 = new ItemStack(Items.wheat_seeds, 1);
|
||||
registerRecipe(flour10, wheat5, seeds1);
|
||||
if (!hasGT5) {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack stick4 = new ItemStack(Items.stick, 4);
|
||||
ItemStack cobble4 = new ItemStack(Blocks.cobblestone, 4);
|
||||
registerRecipe(basicGear, stick4, cobble4);
|
||||
ItemStack flour10 = new ItemStack(EnderIO.itemPowderIngot, 10, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack wheat5 = new ItemStack(Items.wheat, 5);
|
||||
ItemStack seeds1 = new ItemStack(Items.wheat_seeds, 1);
|
||||
registerRecipe(flour10, wheat5, seeds1);
|
||||
}
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
ItemStack bowl = new ItemStack(Items.bowl, 1);
|
||||
ItemStack wheat = new ItemStack(Items.wheat, 1);
|
||||
ItemStack milkb = new ItemStack(Items.milk_bucket, 1);
|
||||
FluidStack milk = FluidContainerRegistry.getFluidForFilledItem(milkb);
|
||||
ItemStack dustEnderPearl = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack dustEnderPearl;
|
||||
if (hasGT5) {
|
||||
dustEnderPearl = GameRegistry.findItemStack("gregtech", "gt.metaitem.01", 1);
|
||||
Items.feather.setDamage(Objects.requireNonNull(dustEnderPearl), 2532);
|
||||
} else {
|
||||
dustEnderPearl = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
}
|
||||
if (milk != null) {
|
||||
registerRecipe(enderios, bowl, milk, wheat, dustEnderPearl);
|
||||
} else {
|
||||
registerRecipe(enderios, bowl, milkb, wheat, dustEnderPearl);
|
||||
}
|
||||
|
||||
ItemStack dustCoal = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COAL.ordinal());
|
||||
ItemStack coal = new ItemStack(Items.coal, 1);
|
||||
registerRecipe(dustCoal, coal);
|
||||
if (!hasGT5) {
|
||||
ItemStack dustCoal = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COAL.ordinal());
|
||||
ItemStack coal = new ItemStack(Items.coal, 1);
|
||||
registerRecipe(dustCoal, coal);
|
||||
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack iron = new ItemStack(Items.iron_ingot, 1);
|
||||
registerRecipe(dustIron, iron);
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack iron = new ItemStack(Items.iron_ingot, 1);
|
||||
registerRecipe(dustIron, iron);
|
||||
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot, 1);
|
||||
registerRecipe(dustGold, gold);
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot, 1);
|
||||
registerRecipe(dustGold, gold);
|
||||
|
||||
ItemStack dustObsidian4 = new ItemStack(EnderIO.itemPowderIngot, 4, PowderIngot.POWDER_OBSIDIAN.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
|
||||
registerRecipe(dustObsidian4, obsidian);
|
||||
ItemStack dustObsidian4 = new ItemStack(
|
||||
EnderIO.itemPowderIngot,
|
||||
4,
|
||||
PowderIngot.POWDER_OBSIDIAN.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
|
||||
registerRecipe(dustObsidian4, obsidian);
|
||||
|
||||
ItemStack enderDust9 = new ItemStack(EnderIO.itemPowderIngot, 9, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack enderPearl = new ItemStack(Items.ender_pearl);
|
||||
registerRecipe(enderDust9, enderPearl);
|
||||
ItemStack enderDust9 = new ItemStack(EnderIO.itemPowderIngot, 9, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack enderPearl = new ItemStack(Items.ender_pearl);
|
||||
registerRecipe(enderDust9, enderPearl);
|
||||
}
|
||||
|
||||
ItemStack cbc8 = BINDER_COMPOSITE.getStack(8);
|
||||
ItemStack sand2 = new ItemStack(Blocks.sand, 2);
|
||||
|
||||
@@ -373,9 +373,14 @@ enderio.endergeticCapacitor.name=Endergetic Capacitor
|
||||
enderio.endergisedCapacitor.name=Endergised Capacitor
|
||||
enderio.totemicCapacitor.name=Totemic Capacitor
|
||||
|
||||
enderio.machine.tooltip.upgrade=Machine Upgrade
|
||||
enderio.machine.tooltip.upgrade.tooltip.detailed.line1=Increases energy storage and
|
||||
enderio.machine.tooltip.upgrade.tooltip.detailed.line2=speed / range of machines
|
||||
enderio.machine.tooltip.upgrade.name=Machine Upgrade
|
||||
enderio.machine.tooltip.upgrade=Upgrades:
|
||||
enderio.machine.tooltip.upgrade.tier=Tier:
|
||||
enderio.machine.tooltip.upgrade.energyreceived=Max Energy Received:
|
||||
enderio.machine.tooltip.upgrade.energyextracted=Max Energy Extracted:
|
||||
enderio.machine.tooltip.upgrade.farmstation=Farming station radius:
|
||||
enderio.machine.tooltip.upgrade.energystorage=Max energy storage:
|
||||
enderio.machine.tooltip.upgrade.range=Range upgrade:
|
||||
enderio.machine.tooltip.clearConfig=This will clear all stored info!
|
||||
|
||||
#Machines
|
||||
@@ -777,6 +782,7 @@ enderio.itemCoordSelector.chat.setDimension=Set Dimension: %s%s
|
||||
#Painter
|
||||
tile.blockPainter.name=Painting Machine
|
||||
enderio.blockPainter.paintedWith=Painted with:
|
||||
enderio.blockPainter.paintedWith.none=§onothing§r
|
||||
tile.blockPaintedFence.name=Painted Fence
|
||||
tile.blockPaintedFenceGate.name=Painted Gate
|
||||
tile.blockPaintedWall.name=Painted Wall
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.9 KiB |
Reference in new issue
Block a user