forked from RepoMirrors/kami-blue
implement peek
This commit is contained in:
parent
39904cca3f
commit
094a4dff1a
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package me.zeroeightsix.kami.event;
|
||||
|
||||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.command.commands.PeekCommand;
|
||||
import me.zeroeightsix.kami.event.events.DisplaySizeChangedEvent;
|
||||
import me.zeroeightsix.kami.gui.UIRenderer;
|
||||
import me.zeroeightsix.kami.gui.kami.KamiGUI;
|
||||
@ -11,6 +12,8 @@ import me.zeroeightsix.kami.module.modules.render.BossStack;
|
||||
import me.zeroeightsix.kami.util.KamiTessellator;
|
||||
import me.zeroeightsix.kami.util.Wrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.inventory.GuiShulkerBox;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
@ -47,6 +50,16 @@ public class ForgeEventProcessor {
|
||||
.filter(component -> component instanceof Frame)
|
||||
.forEach(component -> KamiGUI.dock((Frame) component));
|
||||
}
|
||||
|
||||
if (PeekCommand.sb != null) {
|
||||
ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft());
|
||||
int i = scaledresolution.getScaledWidth();
|
||||
int j = scaledresolution.getScaledHeight();
|
||||
GuiShulkerBox gui = new GuiShulkerBox(Wrapper.getPlayer().inventory, PeekCommand.sb);
|
||||
gui.setWorldAndResolution(Wrapper.getMinecraft(), i, j);
|
||||
Minecraft.getMinecraft().displayGuiScreen(gui);
|
||||
PeekCommand.sb = null;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
@ -60,6 +60,7 @@ public net.minecraft.client.renderer.BlockModelRenderer *()
|
||||
public net.minecraft.pathfinding.Path *
|
||||
public net.minecraft.client.gui.GuiBossOverlay *
|
||||
public net.minecraft.client.gui.GuiBossOverlay func_184052_a(IILnet/minecraft/world/BossInfo;)V
|
||||
public net.minecraft.tileentity.TileEntity field_145854_h # blockType
|
||||
|
||||
#Specific targeting past here
|
||||
#public net.minecraft.world.chunk.Chunk func_186034_a(Lnet/minecraft/world/chunk/IChunkGenerator;)V # Populate Chunk Method
|
||||
|
Loading…
Reference in New Issue
Block a user