generated from CleanroomMC/TemplateDevEnv
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Synthitic/0.0.6
0.0.6
- Loading branch information
Showing
43 changed files
with
2,935 additions
and
222 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ build | |
# other | ||
eclipse | ||
run | ||
libs | ||
libs |
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
58 changes: 58 additions & 0 deletions
58
src/main/java/com/fulltrix/gcyl/api/util/ItemContainerSwitchShim.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,58 @@ | ||
package com.fulltrix.gcyl.api.util; | ||
|
||
import com.cleanroommc.modularui.widgets.slot.ModularSlot; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.items.IItemHandlerModifiable; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class ItemContainerSwitchShim implements IItemHandlerModifiable { | ||
|
||
IItemHandlerModifiable container; | ||
public ItemContainerSwitchShim(IItemHandlerModifiable container) { | ||
changeInventory(container); | ||
} | ||
|
||
public void changeInventory(IItemHandlerModifiable container) { | ||
this.container = container; | ||
} | ||
|
||
@Override | ||
public int getSlots() { | ||
return this.container.getSlots(); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public ItemStack getStackInSlot(int slot) { | ||
return this.container.getStackInSlot(slot); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public ItemStack insertItem(int slot, @Nonnull ItemStack itemStack, boolean simulate) { | ||
return this.container.insertItem(slot, itemStack, simulate); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public ItemStack extractItem(int slot, int amount, boolean simulate) { | ||
return this.container.extractItem(slot, amount, simulate); | ||
} | ||
|
||
@Override | ||
public int getSlotLimit(int slot) { | ||
return this.container.getSlotLimit(slot); | ||
} | ||
|
||
@Override | ||
public boolean isItemValid(int slot, @NotNull ItemStack stack) { | ||
return IItemHandlerModifiable.super.isItemValid(slot, stack); | ||
} | ||
|
||
@Override | ||
public void setStackInSlot(int i, @Nonnull ItemStack itemStack) { | ||
this.container.setStackInSlot(i, itemStack); | ||
} | ||
} |
Oops, something went wrong.