Cables can now pull energy out of other mods blocks.

This commit is contained in:
modmuss50 2019-09-22 14:17:46 +01:00
parent 7f4fb6d80b
commit b70a938796
2 changed files with 18 additions and 5 deletions

View file

@ -13,7 +13,7 @@ buildscript {
classpath "net.fabricmc:fabric-loom:0.2.5-SNAPSHOT"
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
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: 'idea'
apply plugin: 'eclipse'
//apply plugin: 'net.covers1624.contained-deps'
apply plugin: "com.wynprice.cursemaven"
sourceCompatibility = 1.8
targetCompatibility = 1.8
@ -106,7 +106,15 @@ dependencies {
transitive = false
}
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 {

View file

@ -131,12 +131,17 @@ public class CableBlockEntity extends BlockEntity
for (Direction face : Direction.values()) {
BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
if (blockEntity == null) {
continue;
} else if (Energy.valid(blockEntity)) {
if (blockEntity != null && Energy.valid(blockEntity)) {
if (blockEntity instanceof CableBlockEntity && energy <= Energy.of(blockEntity).side(EnergySide.fromMinecraft(face)).getEnergy()) {
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);
if (!sendingFace.contains(face)) {
sendingFace.add(face);