forked from Creators-of-Create/Create
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Showing
3 changed files
with
44 additions
and
45 deletions.
There are no files selected for viewing
46 changes: 23 additions & 23 deletions
46
src/main/java/com/simibubi/create/compat/thresholdSwitch/StorageDrawers.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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package com.simibubi.create.compat.thresholdSwitch; | ||
|
||
import com.simibubi.create.compat.Mods; | ||
|
||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraftforge.items.IItemHandler; | ||
|
||
public class StorageDrawers implements ThresholdSwitchCompat { | ||
|
||
@Override | ||
public boolean isFromThisMod(BlockEntity blockEntity) { | ||
return blockEntity != null && Mods.STORAGEDRAWERS.id() | ||
.equals(blockEntity.getType() | ||
.getRegistryName() | ||
.getNamespace()); | ||
} | ||
|
||
@Override | ||
public long getSpaceInSlot(IItemHandler inv, int slot) { | ||
if (slot == 0) | ||
return 0; | ||
|
||
return inv.getSlotLimit(slot); | ||
} | ||
} | ||
//import com.simibubi.create.compat.Mods; | ||
// | ||
//import net.minecraft.world.level.block.entity.BlockEntity; | ||
//import net.minecraftforge.items.IItemHandler; | ||
// | ||
//public class StorageDrawers implements ThresholdSwitchCompat { | ||
// | ||
// @Override | ||
// public boolean isFromThisMod(BlockEntity blockEntity) { | ||
// return blockEntity != null && Mods.STORAGEDRAWERS.id() | ||
// .equals(blockEntity.getType() | ||
// .getRegistryName() | ||
// .getNamespace()); | ||
// } | ||
// | ||
// @Override | ||
// public long getSpaceInSlot(IItemHandler inv, int slot) { | ||
// if (slot == 0) | ||
// return 0; | ||
// | ||
// return inv.getSlotLimit(slot); | ||
// } | ||
//} |
4 changes: 2 additions & 2 deletions
4
src/main/java/com/simibubi/create/compat/thresholdSwitch/ThresholdSwitchCompat.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package com.simibubi.create.compat.thresholdSwitch; | ||
|
||
import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; | ||
import net.fabricmc.fabric.api.transfer.v1.storage.Storage; | ||
import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
public interface ThresholdSwitchCompat { | ||
|
||
boolean isFromThisMod(BlockEntity blockEntity); | ||
|
||
long getSpaceInSlot(Storage<ItemVariant> inv, int slot); | ||
long getSpaceInSlot(StorageView<ItemVariant> inv); | ||
|
||
} |
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