diff options
author | Hendrik Horstmann <65970327+heinrich26@users.noreply.github.com> | 2023-09-29 04:01:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 12:01:02 +1000 |
commit | 981acc84d7426c8b643492b24a8731208976d6e2 (patch) | |
tree | da791efe0b799597a76857ed2d1264d5eeaab9eb /src/main/kotlin/io | |
parent | e34d22adea31de68cf9bf081fa51dd652219e254 (diff) | |
download | NotEnoughUpdates-981acc84d7426c8b643492b24a8731208976d6e2.tar.gz NotEnoughUpdates-981acc84d7426c8b643492b24a8731208976d6e2.tar.bz2 NotEnoughUpdates-981acc84d7426c8b643492b24a8731208976d6e2.zip |
Hover Effect for Equipment- & Pet-Display, Vanilla Cooldowns, New DevCommands, Improved CustomSkulls (#837)
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.kt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.kt index 9e29d248..e083cd06 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/PackDevCommand.kt @@ -26,6 +26,7 @@ import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe import io.github.moulberry.notenoughupdates.core.util.MiscUtils import io.github.moulberry.notenoughupdates.events.RegisterBrigadierCommandEvent import io.github.moulberry.notenoughupdates.util.brigadier.* +import net.minecraft.block.state.IBlockState import net.minecraft.client.Minecraft import net.minecraft.client.entity.AbstractClientPlayer import net.minecraft.command.ICommandSender @@ -35,8 +36,11 @@ import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.player.EntityPlayer import net.minecraft.item.ItemStack +import net.minecraft.tileentity.TileEntitySkull import net.minecraft.util.EnumChatFormatting import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.* + @NEUAutoSubscribe class PackDevCommand { @@ -152,6 +156,31 @@ class PackDevCommand { npcListCommand("armor stand", "getarmorstand", "getarmorstands", EntityArmorStand::class.java) { Minecraft.getMinecraft().theWorld.loadedEntityList } + thenLiteralExecute("block") { + val pos = Minecraft.getMinecraft().thePlayer.rayTrace(4.0, 10f).blockPos + + val block: IBlockState = Minecraft.getMinecraft().theWorld.getBlockState(pos) + if (block.block.hasTileEntity(block)) { + val te = Minecraft.getMinecraft().theWorld.getTileEntity(pos) + val s = StringBuilder().also { + it.appendLine("NBT: ${te.tileData}") + if (te is TileEntitySkull && te.playerProfile != null) { + it.appendLine("PlayerProfile:\nId: ") + it.appendLine(te.playerProfile.id) + it.append("Name: ") + it.appendLine(te.playerProfile.name) + it.append("Textures: ") + it.appendLine(te.playerProfile.properties.get("textures")?.firstOrNull()?.value) + } + }.toString().trim() + + MiscUtils.copyToClipboard(s) + reply("Copied data to clipboard") + return@thenLiteralExecute + } + reply("No tile entity found at your cursor") + }.withHelp("Find the tile entity you're looking at and copy data about it to your clipboard") + thenExecute { NotEnoughUpdates.INSTANCE.packDevEnabled = !NotEnoughUpdates.INSTANCE.packDevEnabled if (NotEnoughUpdates.INSTANCE.packDevEnabled) { |