This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
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
39904cc
commit 094a4df
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/main/java/me/zeroeightsix/kami/command/commands/PeekCommand.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,36 @@ | ||
package me.zeroeightsix.kami.command.commands; | ||
|
||
import me.zeroeightsix.kami.command.Command; | ||
import me.zeroeightsix.kami.command.syntax.ChunkBuilder; | ||
import me.zeroeightsix.kami.command.syntax.SyntaxChunk; | ||
import me.zeroeightsix.kami.util.Wrapper; | ||
import net.minecraft.item.ItemShulkerBox; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntityShulkerBox; | ||
|
||
/** | ||
* @author 086 | ||
*/ | ||
public class PeekCommand extends Command { | ||
|
||
public static TileEntityShulkerBox sb; | ||
|
||
public PeekCommand() { | ||
super("peek", SyntaxChunk.EMPTY); | ||
} | ||
|
||
@Override | ||
public void call(String[] args) { | ||
ItemStack is = Wrapper.getPlayer().inventory.getCurrentItem(); | ||
|
||
if (is.getItem() instanceof ItemShulkerBox) { | ||
TileEntityShulkerBox entityBox = new TileEntityShulkerBox(); | ||
entityBox.blockType = ((ItemShulkerBox) is.getItem()).getBlock(); | ||
entityBox.setWorld(Wrapper.getWorld()); | ||
entityBox.readFromNBT(is.getTagCompound().getCompoundTag("BlockEntityTag")); | ||
sb = entityBox; | ||
} else { | ||
Command.sendChatMessage("You aren't carrying a shulker box."); | ||
} | ||
} | ||
} |
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