generated from NeoForgeMDKs/MDK-1.21-ModDevGradle
-
-
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.
- Loading branch information
1 parent
27ddabb
commit 813e973
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/dev/wolfieboy09/qstorage/api/slots/EnergySlot.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,20 @@ | ||
package dev.wolfieboy09.qstorage.api.slots; | ||
|
||
import net.minecraft.world.item.ItemStack; | ||
import net.neoforged.neoforge.capabilities.Capabilities; | ||
import net.neoforged.neoforge.energy.IEnergyStorage; | ||
import net.neoforged.neoforge.items.IItemHandler; | ||
import net.neoforged.neoforge.items.SlotItemHandler; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class EnergySlot extends SlotItemHandler { | ||
public EnergySlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) { | ||
super(itemHandler, index, xPosition, yPosition); | ||
} | ||
|
||
@Override | ||
public boolean mayPlace(@NotNull ItemStack stack) { | ||
IEnergyStorage energyStorage = stack.getCapability(Capabilities.EnergyStorage.ITEM); | ||
return energyStorage != null; | ||
} | ||
} |
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