Skip to content

Commit

Permalink
make tr energy compat last and use EnergyIo interface directly
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed May 27, 2021
1 parent 91bf615 commit 04ed08f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
import badasintended.megane.api.provider.EnergyProvider;
import badasintended.megane.api.registry.MeganeRegistrar;
import dev.technici4n.fasttransferlib.api.energy.EnergyIo;
import net.minecraft.block.entity.BlockEntity;

public class FastTransferLib implements MeganeModule {

@Override
public void register(MeganeRegistrar registrar) {
registrar.energy(1100, BlockEntity.class, EnergyProvider.of(
t -> t instanceof EnergyIo,
t -> ((EnergyIo) t).getEnergy(),
t -> ((EnergyIo) t).getEnergyCapacity()
registrar.energy(1100, EnergyIo.class, EnergyProvider.of(
EnergyIo::getEnergy,
EnergyIo::getEnergyCapacity
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class TeamRebornEnergy implements MeganeModule {

@Override
public void register(MeganeRegistrar registrar) {
registrar.energy(1100, BlockEntity.class, new EnergyProvider<BlockEntity>() {
registrar.energy(1200, BlockEntity.class, new EnergyProvider<BlockEntity>() {
EnergyHandler handler;

@Override
Expand Down

0 comments on commit 04ed08f

Please sign in to comment.