Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 41 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ buildscript {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url = "https://jitpack.io"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
}
}

plugins {
id 'idea'
}

apply plugin: 'forge'

ext.buildnumber=""
Expand All @@ -33,17 +44,25 @@ minecraft {

repositories {
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
}
maven {
name = "OpenComputers mirror for ChickenBones mods"
url = "https://maven.cil.li/"
metadataSources {
mavenPom()
artifact()
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compileOnly fileTree(dir: 'libs', include: '*.jar')

compile "codechicken:CodeChickenLib:${minecraft_version}-1.1.3.127:dev"
compile "codechicken:CodeChickenCore:${minecraft_version}-1.0.4.35:dev"
compile "codechicken:NotEnoughItems:${minecraft_version}-1.0.4.90:dev"
compileOnly "codechicken:CodeChickenLib:${minecraft_version}-1.1.3.136:dev"
compileOnly "codechicken:CodeChickenCore:${minecraft_version}-1.0.4.35:dev"
compileOnly "codechicken:NotEnoughItems:${minecraft_version}-1.0.4.107:dev"
}

processResources {
Expand All @@ -70,6 +89,13 @@ processResources {
}
}

runClient {
jvmArgs '-Dfml.coreMods.load=mariculture.fishery.VanillaOverride'
}
runServer {
jvmArgs '-Dfml.coreMods.load=mariculture.fishery.VanillaOverride'
}

jar {
manifest {
attributes 'FMLCorePlugin': 'mariculture.fishery.VanillaOverride'
Expand Down Expand Up @@ -118,4 +144,11 @@ artifacts {
archives marinotechJar
archives deobfJar
archives sourceJar
}
}

// this is needed for IntelliJ so we don't have to copy over the assets manually every time
idea {
module {
inheritOutputDirs = true
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
minecraft_version=1.7.10
forge_version=10.13.2.1291
mod_version=1.2.4.2a
forge_version=10.13.4.1614-1.7.10
mod_version=1.2.5.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jul 02 15:54:47 CDT 2014
#Mon Sep 14 16:20:35 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
Empty file modified gradlew
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/api/java/cofh/api/CoFHAPIProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ private CoFHAPIProps() {

}

public static final String VERSION = "1.7.10R1.0.2";
public static final String VERSION = "1.7.10R1.3.1";

}
8 changes: 4 additions & 4 deletions src/api/java/cofh/api/energy/EnergyStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/**
* Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own.
*
*
* @author King Lemming
*
*
*/
public class EnergyStorage implements IEnergyStorage {

Expand Down Expand Up @@ -89,7 +89,7 @@ public int getMaxExtract() {
/**
* This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers
* are guaranteed to have it.
*
*
* @param energy
*/
public void setEnergyStored(int energy) {
Expand All @@ -106,7 +106,7 @@ public void setEnergyStored(int energy) {
/**
* This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this
* externally, as not all IEnergyHandlers are guaranteed to have it.
*
*
* @param energy
*/
public void modifyEnergyStored(int energy) {
Expand Down
4 changes: 2 additions & 2 deletions src/api/java/cofh/api/energy/IEnergyConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* accept it; otherwise just use IEnergyHandler.
* <p>
* Note that {@link IEnergyHandler} is an extension of this.
*
*
* @author King Lemming
*
*
*/
public interface IEnergyConnection {

Expand Down
8 changes: 4 additions & 4 deletions src/api/java/cofh/api/energy/IEnergyContainerItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* Implement this interface on Item classes that support external manipulation of their internal energy storages.
* <p>
* A reference implementation is provided {@link ItemEnergyContainer}.
*
*
* @author King Lemming
*
*
*/
public interface IEnergyContainerItem {

/**
* Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
*
*
* @param container
* ItemStack to be charged.
* @param maxReceive
Expand All @@ -28,7 +28,7 @@ public interface IEnergyContainerItem {
/**
* Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally
* discharged.
*
*
* @param container
* ItemStack to be discharged.
* @param maxExtract
Expand Down
1 change: 0 additions & 1 deletion src/api/java/cofh/api/energy/IEnergyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public interface IEnergyHandler extends IEnergyProvider, IEnergyReceiver {
@Override
int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate);


/**
* Returns the amount of energy currently stored.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/api/java/cofh/api/energy/IEnergyStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* This is not to be implemented on TileEntities. This is for internal use only.
* <p>
* A reference implementation can be found at {@link EnergyStorage}.
*
*
* @author King Lemming
*
*
*/
public interface IEnergyStorage {

/**
* Adds energy to the storage. Returns quantity of energy that was accepted.
*
*
* @param maxReceive
* Maximum amount of energy to be inserted.
* @param simulate
Expand All @@ -24,7 +24,7 @@ public interface IEnergyStorage {

/**
* Removes energy from the storage. Returns quantity of energy that was removed.
*
*
* @param maxExtract
* Maximum amount of energy to be extracted.
* @param simulate
Expand Down
109 changes: 109 additions & 0 deletions src/api/java/cofh/api/energy/IEnergyTransport.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package cofh.api.energy;

import net.minecraftforge.common.util.ForgeDirection;

/**
* Implement this interface on Tile Entities which transport energy.
* <p>
* This is used to "negotiate" connection types between two separate IEnergyTransports, allowing users to set flow direction and allowing for networks Of
* IEnergyTransports to intelligently transfer energy to other networks.
*/
public interface IEnergyTransport extends IEnergyProvider, IEnergyReceiver {

/**
* The type of interface for a given side of a {@link IEnergyTransport}.
* <p>
* Values are:<br>
* {@link SEND} for sending only<br>
* {@link RECEIVE} for receiving only<br>
* {@link BALANCE} for sending and receiving, and the default state
*/
public enum InterfaceType {
/**
* Indicates that this {@link IEnergyTransport} is only sending power on this side.
*/
SEND,
/**
* Indicates that this {@link IEnergyTransport} is only receiving power on this side.
*/
RECEIVE,
/**
* Indicates that this {@link IEnergyTransport} wants to balance power between itself and the
* senders/receivers on this side. This is the default state.<br>
* To block any connection, use {@link IEnergyConnection#canConnectEnergy}
* <p>
* IEnergyTransport based senders should check that the total power in the destination IEnergyTransport is less than the power in themselves before sending.
* <br>
* Active IEnergyTransport receivers (i.e., those that call {@link IEnergyProvider#extractEnergy}) should check that they contain less power than the
* source IEnergyTransport.
*/
BALANCE;

/**
* Returns the opposite state to this InterfaceType.
* <p>
* {@link #BALANCE} is considered its own opposite.<br>
* {@link #SEND} is the opposite of {@link #RECEIVE} and visa versa.
*/
public InterfaceType getOpposite() {

return this == BALANCE ? BALANCE : this == SEND ? RECEIVE : SEND;
}

/**
* Returns the next InterfaceType as described in {@link IEnergyTransport#getTransportState}
*/
public InterfaceType rotate() {

return rotate(true);
}

/**
* Returns the next InterfaceType as described in {@link IEnergyTransport#getTransportState}
*
* @param forward
* Whether to step in the order specified by {@link IEnergyTransport#getTransportState} (<tt>true</tt>) or to step in the opposite direction
*/
public InterfaceType rotate(boolean forward) {

if (forward) {
return this == BALANCE ? RECEIVE : this == RECEIVE ? SEND : BALANCE;
} else {
return this == BALANCE ? SEND : this == SEND ? RECEIVE : BALANCE;
}
}
}

/**
* {@inheritDoc}<br>
* This method <b>cannot</b> be a no-op for IEnergyTransport.
*/
@Override
int getEnergyStored(ForgeDirection from);

/**
* Indicates to other IEnergyTransports the state of the given side. See {@link #InterfaceType} for details.
* <p>
* For clarity of state tracking, on a tile update from another IEnergyTransport, if its mode has changed from the opposite of your own mode on that side, you
* should change your mode to the opposite of its mode.
* <p>
* When the user alters your mode and your state is:<br>
* BALANCE, your mode should change to {@link InterFaceType#RECEIVE}.<br>
* RECEIVE, your mode should change to {@link InterFaceType#SEND}.<br>
* SEND, your mode should change to {@link InterFaceType#BALANCE}.<br>
* This is not required, but will be easier for users.
*
* @return The type of connection to establish on this side. <b>null is NOT a valid value</b>
*/
InterfaceType getTransportState(ForgeDirection from);

/**
* This method is provided primarily for the purposes of automation tools, and should not need to be called by another IEnergyTransport.
* <p>
* Calls to this method may fail if this IEnergyTransport has been secured by a user.
*
* @return Whether or not state was successfully altered.
*/
boolean setTransportState(InterfaceType state, ForgeDirection from);

}
4 changes: 2 additions & 2 deletions src/api/java/cofh/api/energy/ItemEnergyContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

/**
* Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own.
*
*
* @author King Lemming
*
*
*/
public class ItemEnergyContainer extends Item implements IEnergyContainerItem {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cofh/api/CoFHAPIProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ private CoFHAPIProps() {

}

public static final String VERSION = "1.7.10R1.0.2";
public static final String VERSION = "1.7.10R1.3.1";

}
8 changes: 4 additions & 4 deletions src/main/java/cofh/api/energy/EnergyStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/**
* Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own.
*
*
* @author King Lemming
*
*
*/
public class EnergyStorage implements IEnergyStorage {

Expand Down Expand Up @@ -89,7 +89,7 @@ public int getMaxExtract() {
/**
* This function is included to allow for server -&gt; client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers
* are guaranteed to have it.
*
*
* @param energy
*/
public void setEnergyStored(int energy) {
Expand All @@ -106,7 +106,7 @@ public void setEnergyStored(int energy) {
/**
* This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this
* externally, as not all IEnergyHandlers are guaranteed to have it.
*
*
* @param energy
*/
public void modifyEnergyStored(int energy) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cofh/api/energy/IEnergyConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* accept it; otherwise just use IEnergyHandler.
* <p>
* Note that {@link IEnergyHandler} is an extension of this.
*
*
* @author King Lemming
*
*
*/
public interface IEnergyConnection {

Expand Down
Loading