Cables can now pull energy out of other mods blocks.
This commit is contained in:
parent
7f4fb6d80b
commit
b70a938796
2 changed files with 18 additions and 5 deletions
12
build.gradle
12
build.gradle
|
@ -13,7 +13,7 @@ buildscript {
|
||||||
classpath "net.fabricmc:fabric-loom:0.2.5-SNAPSHOT"
|
classpath "net.fabricmc:fabric-loom:0.2.5-SNAPSHOT"
|
||||||
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
|
||||||
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
||||||
//classpath 'net.covers1624:GradleStuff:1.0-SNAPSHOT'
|
classpath "com.wynprice.cursemaven:CurseMaven:1.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ apply plugin: net.minecrell.gradle.licenser.Licenser
|
||||||
apply plugin: 'de.undercouch.download'
|
apply plugin: 'de.undercouch.download'
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
//apply plugin: 'net.covers1624.contained-deps'
|
apply plugin: "com.wynprice.cursemaven"
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
@ -106,7 +106,15 @@ dependencies {
|
||||||
transitive = false
|
transitive = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
compile 'teamreborn:energy:0.0.7'
|
compile 'teamreborn:energy:0.0.7'
|
||||||
|
|
||||||
|
//Test Generators mod
|
||||||
|
if (false){
|
||||||
|
modCompile curse.resolve("energies", "2771235")
|
||||||
|
modCompile curse.resolve("protos", "2771226")
|
||||||
|
modCompile curse.resolve("generators", "2790134")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|
|
@ -131,12 +131,17 @@ public class CableBlockEntity extends BlockEntity
|
||||||
for (Direction face : Direction.values()) {
|
for (Direction face : Direction.values()) {
|
||||||
BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
|
BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
|
||||||
|
|
||||||
if (blockEntity == null) {
|
if (blockEntity != null && Energy.valid(blockEntity)) {
|
||||||
continue;
|
|
||||||
} else if (Energy.valid(blockEntity)) {
|
|
||||||
if (blockEntity instanceof CableBlockEntity && energy <= Energy.of(blockEntity).side(EnergySide.fromMinecraft(face)).getEnergy()) {
|
if (blockEntity instanceof CableBlockEntity && energy <= Energy.of(blockEntity).side(EnergySide.fromMinecraft(face)).getEnergy()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(!(blockEntity instanceof EnergyStorage)){
|
||||||
|
//Pull energy out of none TR blocks
|
||||||
|
if(Energy.of(blockEntity).getMaxOutput() > 0){
|
||||||
|
Energy.of(blockEntity).into(Energy.of(this)).move();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
acceptors.add(blockEntity);
|
acceptors.add(blockEntity);
|
||||||
if (!sendingFace.contains(face)) {
|
if (!sendingFace.contains(face)) {
|
||||||
sendingFace.add(face);
|
sendingFace.add(face);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue