-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # buildSrc/src/main/kotlin/Dependencies.kt # buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt
- Loading branch information
Showing
22 changed files
with
341 additions
and
7 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
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
CLASS net/minecraft/class_1735 | ||
METHOD method_7682 yarn_isEnabled ()Z | ||
|
||
CLASS net/minecraft/class_465 | ||
METHOD method_2389 yarn_drawBackground (Lnet/minecraft/class_4587;FII)V | ||
METHOD method_2388 yarn_drawForeground (Lnet/minecraft/class_4587;II)V |
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 |
---|---|---|
@@ -1 +1 @@ | ||
org.gradle.jvmargs = -Xmx2G | ||
org.gradle.jvmargs = -Xmx3G |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
repositories { | ||
shedaniel() | ||
} | ||
|
||
dependencies { | ||
modImpl(deps.powah) | ||
modImpl(deps.trEnergy) | ||
modImpl(deps.fabricApi) | ||
modImpl(deps.architectury) | ||
modImpl(deps.clothConfig) | ||
} |
39 changes: 39 additions & 0 deletions
39
module-compat/powah/src/main/java/lol/bai/megane/module/powah/MeganePowah.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,39 @@ | ||
package lol.bai.megane.module.powah; | ||
|
||
import lol.bai.megane.api.MeganeModule; | ||
import lol.bai.megane.api.registry.ClientRegistrar; | ||
import lol.bai.megane.api.registry.CommonRegistrar; | ||
import lol.bai.megane.module.powah.provider.EnergyEnergyProvider; | ||
import lol.bai.megane.module.powah.provider.FurnatorProgressProvider; | ||
import lol.bai.megane.module.powah.provider.InventoryItemProvider; | ||
import lol.bai.megane.module.powah.provider.ReactorProgressProvider; | ||
import lol.bai.megane.module.powah.provider.TankFluidProvider; | ||
import owmii.powah.block.furnator.FurnatorTile; | ||
import owmii.powah.block.reactor.ReactorPartTile; | ||
import owmii.powah.lib.block.AbstractEnergyStorage; | ||
import owmii.powah.lib.block.IInventoryHolder; | ||
import owmii.powah.lib.block.ITankHolder; | ||
|
||
public class MeganePowah implements MeganeModule { | ||
|
||
@Override | ||
public void registerCommon(CommonRegistrar registrar) { | ||
registrar.addEnergy(AbstractEnergyStorage.class, new EnergyEnergyProvider<>(AbstractEnergyStorage::getEnergy)); | ||
registrar.addEnergy(ReactorPartTile.class, new EnergyEnergyProvider<>(it -> it.core().map(AbstractEnergyStorage::getEnergy).orElse(null))); | ||
|
||
registrar.addItem(IInventoryHolder.class, new InventoryItemProvider<>(IInventoryHolder::getInventory)); | ||
registrar.addItem(ReactorPartTile.class, new InventoryItemProvider<>(it -> it.core().map(IInventoryHolder::getInventory).orElse(null))); | ||
|
||
registrar.addFluid(ITankHolder.class, new TankFluidProvider<>(ITankHolder::getTank)); | ||
registrar.addFluid(ReactorPartTile.class, new TankFluidProvider<>(it -> it.core().map(ITankHolder::getTank).orElse(null))); | ||
|
||
registrar.addProgress(FurnatorTile.class, new FurnatorProgressProvider()); | ||
registrar.addProgress(ReactorPartTile.class, new ReactorProgressProvider()); | ||
} | ||
|
||
@Override | ||
public void registerClient(ClientRegistrar registrar) { | ||
registrar.addEnergyInfo("powah", 0x710C00, "FE"); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...compat/powah/src/main/java/lol/bai/megane/module/powah/provider/EnergyEnergyProvider.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,38 @@ | ||
package lol.bai.megane.module.powah.provider; | ||
|
||
import java.util.function.Function; | ||
|
||
import lol.bai.megane.api.provider.EnergyProvider; | ||
import owmii.powah.lib.logistics.energy.Energy; | ||
|
||
public class EnergyEnergyProvider<T> extends EnergyProvider<T> { | ||
|
||
final Function<T, Energy> getter; | ||
|
||
Energy energy; | ||
|
||
public EnergyEnergyProvider(Function<T, Energy> getter) { | ||
this.getter = getter; | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
this.energy = getter.apply(getObject()); | ||
} | ||
|
||
@Override | ||
public boolean hasEnergy() { | ||
return energy != null; | ||
} | ||
|
||
@Override | ||
public long getStored() { | ||
return energy.getStored(); | ||
} | ||
|
||
@Override | ||
public long getMax() { | ||
return energy.getMaxEnergyStored(); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...at/powah/src/main/java/lol/bai/megane/module/powah/provider/FurnatorProgressProvider.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,38 @@ | ||
package lol.bai.megane.module.powah.provider; | ||
|
||
import owmii.powah.block.furnator.FurnatorTile; | ||
import owmii.powah.lib.logistics.inventory.Inventory; | ||
import owmii.powah.lib.util.Ticker; | ||
|
||
public class FurnatorProgressProvider extends TickerProgressProvider<FurnatorTile> { | ||
|
||
static final int[] INPUT = {1}; | ||
static final int[] OUTPUT = {}; | ||
|
||
@Override | ||
protected int[] getInputSlots() { | ||
return INPUT; | ||
} | ||
|
||
@Override | ||
protected int[] getOutputSlots() { | ||
return OUTPUT; | ||
} | ||
|
||
@Override | ||
Ticker getTicker() { | ||
return getObject().getCarbon(); | ||
} | ||
|
||
@Override | ||
Inventory getInventory() { | ||
return getObject().getInventory(); | ||
} | ||
|
||
@Override | ||
public int getPercentage() { | ||
int percent = (int) ticker.perCent(); | ||
return percent == 100 ? 0 : 100 - percent; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
...ompat/powah/src/main/java/lol/bai/megane/module/powah/provider/InventoryItemProvider.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,40 @@ | ||
package lol.bai.megane.module.powah.provider; | ||
|
||
import java.util.function.Function; | ||
|
||
import lol.bai.megane.api.provider.ItemProvider; | ||
import net.minecraft.item.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
import owmii.powah.lib.logistics.inventory.Inventory; | ||
|
||
public class InventoryItemProvider<T> extends ItemProvider<T> { | ||
|
||
final Function<T, Inventory> getter; | ||
|
||
Inventory inventory; | ||
|
||
public InventoryItemProvider(Function<T, Inventory> getter) { | ||
this.getter = getter; | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
this.inventory = getter.apply(getObject()); | ||
} | ||
|
||
@Override | ||
public boolean hasItems() { | ||
return inventory != null; | ||
} | ||
|
||
@Override | ||
public int getSlotCount() { | ||
return inventory.getSlots(); | ||
} | ||
|
||
@Override | ||
public @NotNull ItemStack getStack(int slot) { | ||
return inventory.getStackInSlot(slot); | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...pat/powah/src/main/java/lol/bai/megane/module/powah/provider/ReactorProgressProvider.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,43 @@ | ||
package lol.bai.megane.module.powah.provider; | ||
|
||
import owmii.powah.block.reactor.ReactorPartTile; | ||
import owmii.powah.block.reactor.ReactorTile; | ||
import owmii.powah.lib.logistics.inventory.Inventory; | ||
import owmii.powah.lib.util.Ticker; | ||
|
||
public class ReactorProgressProvider extends TickerProgressProvider<ReactorPartTile> { | ||
|
||
ReactorTile core; | ||
|
||
@Override | ||
protected void init() { | ||
this.core = getObject().core().orElse(null); | ||
super.init(); | ||
} | ||
|
||
@Override | ||
protected int[] getInputSlots() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
protected int[] getOutputSlots() { | ||
return new int[0]; | ||
} | ||
|
||
@Override | ||
Ticker getTicker() { | ||
return core.fuel; | ||
} | ||
|
||
@Override | ||
Inventory getInventory() { | ||
return core.getInventory(); | ||
} | ||
|
||
@Override | ||
public int getPercentage() { | ||
return (int) ticker.perCent(); | ||
} | ||
|
||
} |
Oops, something went wrong.