Skip to content

Commit

Permalink
More changes to PulseIo
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragonoidzero committed Oct 9, 2021
1 parent 71b6540 commit 47729c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.6

# Mod Properties
mod_version = 1.6.2
mod_version = 1.6.3
maven_group = azzy.fabric
archives_base_name = incubus-core

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package net.id.incubus_core.systems;

import net.minecraft.util.math.Direction;
import org.jetbrains.annotations.Nullable;

@SuppressWarnings("unused")
public interface MaterialProvider {

Material getMaterial(Direction direction);
Material getMaterial(@Nullable Direction direction);
}
13 changes: 10 additions & 3 deletions src/main/java/net/id/incubus_core/systems/PulseIo.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public interface PulseIo extends MaterialProvider {
/**
* Get the total amount of energy stored
*/
long getMotive();
default long getMotive() {
return getFrequency() * getInductance();
}

/**
* Get the frequency component of the stored energy
Expand Down Expand Up @@ -52,14 +54,14 @@ default long getMotiveCapacity() {
* Get the minimum level of Inductance needed to cause this object to fail.
*/
default long getFailureInductance() {
return Long.MAX_VALUE;
return getMaterial(null).maxInductance();
}

/**
* Get the minimum frequency needed to cause this object to fail.
*/
default long getFailureFrequency() {
return Long.MAX_VALUE;
return getMaterial(null).maxFrequency();
}

/**
Expand Down Expand Up @@ -135,6 +137,11 @@ default long extractMotive(long maxAmount, Simulation simulation) {
return 0;
}

/**
* What do you want me to explain here? Half the bloody methods are already just copy pasted!
*/
void setPolarity(Polarity polarity);

/**
* Return false if this object does not support insertion at all, meaning that insertion will always return the passed amount,
* and insert-only connectors should not connect.
Expand Down

0 comments on commit 47729c5

Please sign in to comment.