-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrating ChargePadMixin from BaublesBatPacks here
Makes IC2 Chargepads Bauble slot aware
- Loading branch information
Showing
5 changed files
with
48 additions
and
0 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
34 changes: 34 additions & 0 deletions
34
src/main/java/mega/blendtronic/mixin/mixins/common/misc/IC2ChargepadBaubleSupportMixin.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,34 @@ | ||
package mega.blendtronic.mixin.mixins.common.misc; | ||
|
||
import baubles.common.lib.PlayerHandler; | ||
import ic2.core.block.wiring.*; | ||
import lombok.val; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = {TileEntityChargepadBatBox.class, | ||
TileEntityChargepadCESU.class, | ||
TileEntityChargepadMFE.class, | ||
TileEntityChargepadMFSU.class}, | ||
remap = false) | ||
public abstract class IC2ChargepadBaubleSupportMixin extends TileEntityChargepadBlock { | ||
public IC2ChargepadBaubleSupportMixin(int tier, int output, int maxStorage) { | ||
super(tier, output, maxStorage); | ||
} | ||
|
||
@Inject(method = "getItems", | ||
at = @At("RETURN"), | ||
require = 4) | ||
private void injectBaublesCharge(EntityPlayer player, CallbackInfo ci) { | ||
val baubles = PlayerHandler.getPlayerBaubles(player); | ||
for (val bauble : baubles.stackList) { | ||
if (bauble != null) { | ||
chargeitems(bauble, getOutput()); | ||
baubles.markDirty(); | ||
} | ||
} | ||
} | ||
} |
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