From 7d6bf772d3614fe768b701aba9fd58f4de35f5e0 Mon Sep 17 00:00:00 2001 From: ExE Boss Date: Sun, 25 Dec 2016 22:30:31 +0100 Subject: [PATCH] Update to latest snapshot --- build.gradle | 14 ++-- gradle.properties | 2 +- minecraft/.gitignore | 1 + minecraft/1.7/build.gradle | 10 ++- minecraft/1.7/gradle.properties | 2 +- .../minecraft/redstone/ComponentModule.java | 13 --- .../v1_7/depmodules/ComponentModule.java | 15 ++++ .../mc/forge/v1_7/launch}/RedstoneAPI.java | 18 +++-- .../wrapper/redstone/backward/BWRedstone.java | 74 +++++++++++++++++ .../wrapper/redstone/forward/FWRedstone.java} | 5 +- minecraft/1.8/build.gradle | 10 ++- minecraft/1.8/gradle.properties | 4 +- .../minecraft/redstone/ComponentModule.java | 13 --- .../v1_8/depmodules/ComponentModule.java | 15 ++++ .../mc/forge/v1_8/launch}/RedstoneAPI.java | 19 +++-- .../wrapper/redstone/backward/BWRedstone.java | 79 +++++++++++++++++++ .../wrapper/redstone/forward/FWRedstone.java} | 5 +- minecraft/build.gradle | 27 ++++--- 18 files changed, 258 insertions(+), 68 deletions(-) delete mode 100644 minecraft/1.7/src/main/java/nova/minecraft/redstone/ComponentModule.java create mode 100644 minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/depmodules/ComponentModule.java rename minecraft/1.7/src/main/java/nova/minecraft/{redstone => wrapper/mc/forge/v1_7/launch}/RedstoneAPI.java (53%) create mode 100644 minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/backward/BWRedstone.java rename minecraft/1.7/src/main/java/nova/minecraft/{redstone/NodeRedstone.java => wrapper/mc/forge/v1_7/wrapper/redstone/forward/FWRedstone.java} (94%) delete mode 100644 minecraft/1.8/src/main/java/nova/minecraft/redstone/ComponentModule.java create mode 100644 minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/depmodules/ComponentModule.java rename minecraft/1.8/src/main/java/nova/minecraft/{redstone => wrapper/mc/forge/v1_8/launch}/RedstoneAPI.java (57%) mode change 100755 => 100644 create mode 100644 minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/backward/BWRedstone.java rename minecraft/1.8/src/main/java/nova/minecraft/{redstone/NodeRedstone.java => wrapper/mc/forge/v1_8/wrapper/redstone/forward/FWRedstone.java} (94%) mode change 100755 => 100644 diff --git a/build.gradle b/build.gradle index 5647551..f7e6a67 100644 --- a/build.gradle +++ b/build.gradle @@ -1,27 +1,25 @@ plugins { id "java" - id "nova.gradle" version "0.2.5" + id "nova.gradle" version "0.2.6" id "maven-publish" id "com.jfrog.artifactory" version "3.1.1" } - apply from: "https://raw.githubusercontent.com/NOVA-Team/NOVA-Gradle/master/shared-scripts/java.gradle" dependencies { - compile nova(novaVersion) + compile nova(nova_version) } nova { wrappers { "17" { - wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$novaVersion" - runtime project(":minecraft:1.7") + wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$nova_version" + runtime project(":minecraft:NOVA-Minecraft-Wrapper-MC1.7") } - "18" { - wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$novaVersion" - runtime project(":minecraft:1.8") + wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$nova_version" + runtime project(":minecraft:NOVA-Minecraft-Wrapper-MC1.8") } } } diff --git a/gradle.properties b/gradle.properties index 0a47d26..1ab856d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ version = 0.0.1-SNAPSHOT group = nova.minecraft -novaVersion = 0.1.0-SNAPSHOT +nova_version = 0.1.0-SNAPSHOT packaging = jar info.inceptionYear = 2015 diff --git a/minecraft/.gitignore b/minecraft/.gitignore index a4c6e69..896c508 100644 --- a/minecraft/.gitignore +++ b/minecraft/.gitignore @@ -3,5 +3,6 @@ !/build.gradle !/.gitignore +!/1.11 !/1.8 !/1.7 diff --git a/minecraft/1.7/build.gradle b/minecraft/1.7/build.gradle index 825a843..fe2b574 100644 --- a/minecraft/1.7/build.gradle +++ b/minecraft/1.7/build.gradle @@ -29,8 +29,14 @@ artifactory { } } +task deobfJar(type: Jar) { + from sourceSets.main.output + classifier = 'deobf' +} + artifacts { archives jar + archives deobfJar } apply plugin: "forge" @@ -42,8 +48,8 @@ minecraft { dependencies { compile rootProject - compile "nova.core:NOVA-Core:${property("nova.version")}" - compile "nova.core:NOVA-Core-Wrapper-MC1.7:${property("nova.version")}:deobf" + compile group: "nova.core", name: "NOVA-Core", version: property("nova_version"), changing: true + compile "nova.core:NOVA-Core-Wrapper-MC1.7:${nova_version}:deobf" } processResources { diff --git a/minecraft/1.7/gradle.properties b/minecraft/1.7/gradle.properties index c5f17d0..dd35b16 100644 --- a/minecraft/1.7/gradle.properties +++ b/minecraft/1.7/gradle.properties @@ -1,8 +1,8 @@ group = nova.minecraft -nova.version = 0.1.0-SNAPSHOT minecraft.version = 1.7.10 forge.version = 10.13.4.1448-1.7.10 +forgeGradleVersion = 1.2-SNAPSHOT packaging = jar info.inceptionYear = 2015 diff --git a/minecraft/1.7/src/main/java/nova/minecraft/redstone/ComponentModule.java b/minecraft/1.7/src/main/java/nova/minecraft/redstone/ComponentModule.java deleted file mode 100644 index c80b066..0000000 --- a/minecraft/1.7/src/main/java/nova/minecraft/redstone/ComponentModule.java +++ /dev/null @@ -1,13 +0,0 @@ -package nova.minecraft.redstone; - -import se.jbee.inject.bind.BinderModule; - -/** - * @author Calclavia - */ -public class ComponentModule extends BinderModule { - @Override - protected void declare() { - bind(Redstone.class).to(NodeRedstone.class); - } -} diff --git a/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/depmodules/ComponentModule.java b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/depmodules/ComponentModule.java new file mode 100644 index 0000000..af88b38 --- /dev/null +++ b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/depmodules/ComponentModule.java @@ -0,0 +1,15 @@ +package nova.minecraft.wrapper.mc.forge.v1_7.depmodules; + +import nova.minecraft.redstone.Redstone; +import nova.minecraft.wrapper.mc.forge.v1_7.wrapper.redstone.forward.FWRedstone; +import se.jbee.inject.bind.BinderModule; + +/** + * @author Calclavia + */ +public class ComponentModule extends BinderModule { + @Override + protected void declare() { + bind(Redstone.class).to(FWRedstone.class); + } +} diff --git a/minecraft/1.7/src/main/java/nova/minecraft/redstone/RedstoneAPI.java b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/launch/RedstoneAPI.java similarity index 53% rename from minecraft/1.7/src/main/java/nova/minecraft/redstone/RedstoneAPI.java rename to minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/launch/RedstoneAPI.java index a912298..635b2c4 100644 --- a/minecraft/1.7/src/main/java/nova/minecraft/redstone/RedstoneAPI.java +++ b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/launch/RedstoneAPI.java @@ -1,11 +1,13 @@ -package nova.minecraft.redstone; +package nova.minecraft.wrapper.mc.forge.v1_7.launch; +import nova.minecraft.wrapper.mc.forge.v1_7.depmodules.ComponentModule; import nova.core.block.Block; import nova.core.event.bus.GlobalEvents; import nova.core.loader.Loadable; import nova.core.loader.Mod; import nova.core.world.World; import nova.core.wrapper.mc.forge.v17.util.WrapperEvent; +import nova.minecraft.redstone.Redstone; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import java.util.Optional; @@ -14,7 +16,7 @@ * The Minecraft native loader * @author Calclavia */ -@Mod(id = "redstone-minecraft", name = "Redstone Minecraft", version = "0.0.1", novaVersion = "0.0.1", priority = 1, modules = { ComponentModule.class }) +@Mod(id = "nova-minecraft-wrapper", name = "NOVA Minecraft", version = "0.0.1", novaVersion = "0.0.1", priority = 1, modules = { ComponentModule.class }) public class RedstoneAPI implements Loadable { private final GlobalEvents events; @@ -25,11 +27,17 @@ public RedstoneAPI(GlobalEvents events) { @Override public void preInit() { - events.on(WrapperEvent.RedstoneConnect.class).bind(evt -> evt.canConnect = getRedstoneNode(evt.world, evt.position).map(n -> n.canConnect.apply(null)).orElseGet(() -> false)); + events.on(WrapperEvent.RedstoneConnect.class) + .bind(evt -> evt.canConnect = getRedstoneNode(evt.world, evt.position) + .map(n -> n.canConnect.apply(null)).orElseGet(() -> false)); - events.on(WrapperEvent.StrongRedstone.class).bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position).map(Redstone::getOutputStrongPower).orElseGet(() -> 0)); + events.on(WrapperEvent.StrongRedstone.class) + .bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position) + .map(Redstone::getOutputStrongPower).orElseGet(() -> 0)); - events.on(WrapperEvent.WeakRedstone.class).bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position).map(Redstone::getOutputWeakPower).orElseGet(() -> 0)); + events.on(WrapperEvent.WeakRedstone.class) + .bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position) + .map(Redstone::getOutputWeakPower).orElseGet(() -> 0)); } public Optional getRedstoneNode(World world, Vector3D pos) { diff --git a/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/backward/BWRedstone.java b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/backward/BWRedstone.java new file mode 100644 index 0000000..96615bb --- /dev/null +++ b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/backward/BWRedstone.java @@ -0,0 +1,74 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package nova.minecraft.wrapper.mc.forge.v1_7.wrapper.redstone.backward; + +import nova.core.block.Block; +import nova.core.util.Direction; +import nova.core.wrapper.mc.forge.v17.wrapper.block.backward.BWBlock; +import nova.core.wrapper.mc.forge.v17.wrapper.block.world.BWWorld; +import nova.minecraft.redstone.Redstone; +import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; + +import java.util.function.Consumer; +import java.util.stream.IntStream; + +/** + * + * @author ExE Boss + */ +public class BWRedstone extends Redstone { + + private BWBlock block() { + return (BWBlock) getProvider(); + } + + private net.minecraft.world.World mcWorld() { + return ((BWWorld) block().world()).world(); + } + + public BWRedstone() { + this.canConnect = (Redstone otherRedstone) -> { + Block otherBlock = ((Block) otherRedstone.getProvider()); + Vector3D otherPos = otherBlock.position(); + Vector3D thisPos = block().position(); + return block().mcBlock.canConnectRedstone(mcWorld(), otherBlock.x(), otherBlock.y(), otherBlock.z(), Direction.fromVector(thisPos.crossProduct(otherPos)).ordinal()); + }; + } + + @Override + public void onInputPowerChange(Consumer action) {} + + @Override + public int getOutputStrongPower() { + return IntStream.range(0, 6).map(side -> block().mcBlock.isProvidingStrongPower(mcWorld(), block().x(), block().y(), block().z(), side)).max().orElse(0); + } + + @Override + public void setOutputStrongPower(int power) {} + + @Override + public int getWeakPower(int side) { + return mcWorld().getIndirectPowerLevelTo(block().x(), block().y(), block().z(), side); + } + + @Override + public int getInputWeakPower() { + return mcWorld().getStrongestIndirectPower(block().x(), block().y(), block().z()); + } + + @Override + public int getInputStrongPower() { + return mcWorld().getBlockPowerInput(block().x(), block().y(), block().z()); + } + + @Override + public int getOutputWeakPower() { + return IntStream.range(0, 6).map(side -> block().mcBlock.isProvidingWeakPower(mcWorld(), block().x(), block().y(), block().z(), side)).max().orElse(0); + } + + @Override + public void setOutputWeakPower(int power) {} +} diff --git a/minecraft/1.7/src/main/java/nova/minecraft/redstone/NodeRedstone.java b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/forward/FWRedstone.java similarity index 94% rename from minecraft/1.7/src/main/java/nova/minecraft/redstone/NodeRedstone.java rename to minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/forward/FWRedstone.java index f2c6d34..a04e930 100644 --- a/minecraft/1.7/src/main/java/nova/minecraft/redstone/NodeRedstone.java +++ b/minecraft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/forward/FWRedstone.java @@ -1,7 +1,8 @@ -package nova.minecraft.redstone; +package nova.minecraft.wrapper.mc.forge.v1_7.wrapper.redstone.forward; import nova.core.block.Block; import nova.core.wrapper.mc.forge.v17.wrapper.block.world.BWWorld; +import nova.minecraft.redstone.Redstone; import java.util.function.Consumer; import java.util.stream.IntStream; @@ -11,7 +12,7 @@ * @author Calclavia */ //TODO: Create NodeVirtualRedstone (for MC blocks that are redstone, but don't implement NOVA) -public class NodeRedstone extends Redstone { +public class FWRedstone extends Redstone { private boolean init = false; private int inputStrongPower = 0; private int inputWeakPower = 0; diff --git a/minecraft/1.8/build.gradle b/minecraft/1.8/build.gradle index ffe343b..6ed6662 100644 --- a/minecraft/1.8/build.gradle +++ b/minecraft/1.8/build.gradle @@ -29,8 +29,14 @@ artifactory { } } +task deobfJar(type: Jar) { + from sourceSets.main.output + classifier = 'deobf' +} + artifacts { archives jar + archives deobfJar } apply plugin: "forge" @@ -43,8 +49,8 @@ minecraft { dependencies { compile rootProject - compile "nova.core:NOVA-Core:${property("nova.version")}" - compile "nova.core:NOVA-Core-Wrapper-MC1.8:${property("nova.version")}:deobf" + compile group: "nova.core", name: "NOVA-Core", version: property("nova_version"), changing: true + compile "nova.core:NOVA-Core-Wrapper-MC1.8:${nova_version}:deobf" } processResources { diff --git a/minecraft/1.8/gradle.properties b/minecraft/1.8/gradle.properties index d2e0861..41aec0a 100644 --- a/minecraft/1.8/gradle.properties +++ b/minecraft/1.8/gradle.properties @@ -1,8 +1,8 @@ group = nova.minecraft -nova.version = 0.1.0-SNAPSHOT minecraft.version = 1.8 -forge.version = 11.14.3.1446 +forge.version = 11.14.3.1491 +forgeGradleVersion = 1.2-SNAPSHOT packaging = jar info.inceptionYear = 2015 diff --git a/minecraft/1.8/src/main/java/nova/minecraft/redstone/ComponentModule.java b/minecraft/1.8/src/main/java/nova/minecraft/redstone/ComponentModule.java deleted file mode 100644 index c80b066..0000000 --- a/minecraft/1.8/src/main/java/nova/minecraft/redstone/ComponentModule.java +++ /dev/null @@ -1,13 +0,0 @@ -package nova.minecraft.redstone; - -import se.jbee.inject.bind.BinderModule; - -/** - * @author Calclavia - */ -public class ComponentModule extends BinderModule { - @Override - protected void declare() { - bind(Redstone.class).to(NodeRedstone.class); - } -} diff --git a/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/depmodules/ComponentModule.java b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/depmodules/ComponentModule.java new file mode 100644 index 0000000..b74bda7 --- /dev/null +++ b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/depmodules/ComponentModule.java @@ -0,0 +1,15 @@ +package nova.minecraft.wrapper.mc.forge.v1_8.depmodules; + +import nova.minecraft.wrapper.mc.forge.v1_8.wrapper.redstone.forward.FWRedstone; +import nova.minecraft.redstone.Redstone; +import se.jbee.inject.bind.BinderModule; + +/** + * @author Calclavia + */ +public class ComponentModule extends BinderModule { + @Override + protected void declare() { + bind(Redstone.class).to(FWRedstone.class); + } +} diff --git a/minecraft/1.8/src/main/java/nova/minecraft/redstone/RedstoneAPI.java b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/launch/RedstoneAPI.java old mode 100755 new mode 100644 similarity index 57% rename from minecraft/1.8/src/main/java/nova/minecraft/redstone/RedstoneAPI.java rename to minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/launch/RedstoneAPI.java index d36f9b7..6264777 --- a/minecraft/1.8/src/main/java/nova/minecraft/redstone/RedstoneAPI.java +++ b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/launch/RedstoneAPI.java @@ -1,4 +1,4 @@ -package nova.minecraft.redstone; +package nova.minecraft.wrapper.mc.forge.v1_8.launch; import nova.core.block.Block; import nova.core.event.bus.GlobalEvents; @@ -6,10 +6,13 @@ import nova.core.loader.Mod; import nova.core.world.World; import nova.core.wrapper.mc.forge.v18.util.WrapperEvent; +import nova.minecraft.redstone.Redstone; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import java.util.Optional; +import nova.minecraft.wrapper.mc.forge.v1_8.depmodules.ComponentModule; + /** * The Minecraft native loader * @author Calclavia @@ -25,15 +28,21 @@ public RedstoneAPI(GlobalEvents events) { @Override public void preInit() { - events.on(WrapperEvent.RedstoneConnect.class).bind(evt -> evt.canConnect = getRedstoneNode(evt.world, evt.position).map(n -> n.canConnect.apply(null)).orElseGet(() -> false)); + events.on(WrapperEvent.RedstoneConnect.class) + .bind(evt -> evt.canConnect = getRedstoneNode(evt.world, evt.position) + .map(n -> n.canConnect.apply(null)).orElseGet(() -> false)); - events.on(WrapperEvent.StrongRedstone.class).bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position).map(Redstone::getOutputStrongPower).orElseGet(() -> 0)); + events.on(WrapperEvent.StrongRedstone.class) + .bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position) + .map(Redstone::getOutputStrongPower).orElseGet(() -> 0)); - events.on(WrapperEvent.WeakRedstone.class).bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position).map(Redstone::getOutputWeakPower).orElseGet(() -> 0)); + events.on(WrapperEvent.WeakRedstone.class) + .bind(evt -> evt.power = getRedstoneNode(evt.world, evt.position) + .map(Redstone::getOutputWeakPower).orElseGet(() -> 0)); } public Optional getRedstoneNode(World world, Vector3D pos) { Optional blockOptional = world.getBlock(pos); return blockOptional.flatMap(block -> block.components.getOp(Redstone.class)); } -} \ No newline at end of file +} diff --git a/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/backward/BWRedstone.java b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/backward/BWRedstone.java new file mode 100644 index 0000000..066a956 --- /dev/null +++ b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/backward/BWRedstone.java @@ -0,0 +1,79 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package nova.minecraft.wrapper.mc.forge.v1_8.wrapper.redstone.backward; + +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import nova.core.block.Block; +import nova.core.util.Direction; +import nova.core.wrapper.mc.forge.v18.wrapper.block.backward.BWBlock; +import nova.core.wrapper.mc.forge.v18.wrapper.block.world.BWWorld; +import nova.internal.core.Game; +import nova.minecraft.redstone.Redstone; +import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; + +import java.util.function.Consumer; +import java.util.stream.IntStream; + +/** + * + * @author ExE Boss + */ +public class BWRedstone extends Redstone { + + private BWBlock block() { + return (BWBlock) getProvider(); + } + + private net.minecraft.world.World mcWorld() { + return ((BWWorld) block().world()).world(); + } + + public BWRedstone() { + this.canConnect = (Redstone otherRedstone) -> { + Block otherBlock = ((Block)otherRedstone.getProvider()); + Vector3D otherPos = otherBlock.position(); + Vector3D thisPos = block().position(); + return block().mcBlock.canConnectRedstone(mcWorld(), Game.natives().toNative(thisPos), Game.natives().toNative(Direction.fromVector(thisPos.crossProduct(otherPos)))); + }; + } + + @Override + public void onInputPowerChange(Consumer action) {} + + @Override + public int getOutputStrongPower() { + BlockPos pos = new BlockPos(block().x(), block().y(), block().z()); + return IntStream.range(0, 6).map(side -> block().mcBlock.isProvidingStrongPower(mcWorld(), pos, mcWorld().getBlockState(pos), EnumFacing.values()[side])).max().orElse(0); + } + + @Override + public void setOutputStrongPower(int power) {} + + @Override + public int getWeakPower(int side) { + return mcWorld().getRedstonePower(new BlockPos(block().x(), block().y(), block().z()), EnumFacing.values()[side]); + } + + @Override + public int getInputWeakPower() { + return mcWorld().isBlockIndirectlyGettingPowered(new BlockPos(block().x(), block().y(), block().z())); + } + + @Override + public int getInputStrongPower() { + return mcWorld().getStrongPower(new BlockPos(block().x(), block().y(), block().z())); + } + + @Override + public int getOutputWeakPower() { + BlockPos pos = new BlockPos(block().x(), block().y(), block().z()); + return IntStream.range(0, 6).map(side -> block().mcBlock.isProvidingWeakPower(mcWorld(), pos, mcWorld().getBlockState(pos), EnumFacing.values()[side])).max().orElse(0); + } + + @Override + public void setOutputWeakPower(int power) {} +} diff --git a/minecraft/1.8/src/main/java/nova/minecraft/redstone/NodeRedstone.java b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/forward/FWRedstone.java old mode 100755 new mode 100644 similarity index 94% rename from minecraft/1.8/src/main/java/nova/minecraft/redstone/NodeRedstone.java rename to minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/forward/FWRedstone.java index 0f27f84..6b9069a --- a/minecraft/1.8/src/main/java/nova/minecraft/redstone/NodeRedstone.java +++ b/minecraft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/wrapper/redstone/forward/FWRedstone.java @@ -1,9 +1,10 @@ -package nova.minecraft.redstone; +package nova.minecraft.wrapper.mc.forge.v1_8.wrapper.redstone.forward; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import nova.core.block.Block; import nova.core.wrapper.mc.forge.v18.wrapper.block.world.BWWorld; +import nova.minecraft.redstone.Redstone; import java.util.function.Consumer; import java.util.stream.IntStream; @@ -13,7 +14,7 @@ * @author Calclavia */ //TODO: Create NodeVirtualRedstone (for MC blocks that are redstone, but don't implement NOVA) -public class NodeRedstone extends Redstone { +public class FWRedstone extends Redstone { private boolean init = false; private int inputStrongPower = 0; private int inputWeakPower = 0; diff --git a/minecraft/build.gradle b/minecraft/build.gradle index 2f4e064..905f27d 100644 --- a/minecraft/build.gradle +++ b/minecraft/build.gradle @@ -1,16 +1,19 @@ -buildscript{ - repositories{ - mavenCentral() - maven { - name "forge" - url "http://files.minecraftforge.net/maven" +subprojects { + buildscript { + repositories { + mavenCentral() + maven { + name "forge" + url "http://files.minecraftforge.net/maven" + } + maven { + name "sonatype" + url "https://oss.sonatype.org/content/repositories/snapshots/" + } } - maven { - name "sonatype" - url "https://oss.sonatype.org/content/repositories/snapshots/" + dependencies { + // Minecraft 1.11 requires newer ForgeGradle, while 1.7 and 1.8 require older. + classpath 'net.minecraftforge.gradle:ForgeGradle:' + property('forgeGradleVersion') } } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' - } }