-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
258 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
!/build.gradle | ||
!/.gitignore | ||
|
||
!/1.11 | ||
!/1.8 | ||
!/1.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
minecraft/1.7/src/main/java/nova/minecraft/redstone/ComponentModule.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...ft/1.7/src/main/java/nova/minecraft/wrapper/mc/forge/v1_7/depmodules/ComponentModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
.../main/java/nova/minecraft/wrapper/mc/forge/v1_7/wrapper/redstone/backward/BWRedstone.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Redstone> 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) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
minecraft/1.8/src/main/java/nova/minecraft/redstone/ComponentModule.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...ft/1.8/src/main/java/nova/minecraft/wrapper/mc/forge/v1_8/depmodules/ComponentModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.