AssetTagsCommand class
Пакет: com.hypixel.hytale.server.core.command.commands.debug
Файл: com/hypixel/hytale/server/core/command/commands/debug/AssetTagsCommand.java
extends: CommandBase
Поля (8)
| Модификаторы | Тип | Имя |
|---|---|---|
|
|
break |
|
Set |
var11 |
|
String |
var2 |
|
String |
var3 |
|
int |
var4 |
|
String |
var7 |
|
AssetMap |
var8 |
|
Set |
var9 |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
if if(var4 == Integer.MIN_VALUE) |
|
|
if if(var8 instanceof AssetMapWithIndexes var10) |
abstract |
|
super super("tags", "server.commands.assets.tags.desc") |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.command.commands.debug;
class="kw">import com.hypixel.hytale.assetstore.AssetMap;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.AssetStore;
class="kw">import com.hypixel.hytale.assetstore.map.AssetMapWithIndexes;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.command.system.CommandContext;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
class="kw">import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;
class="kw">import com.hypixel.hytale.server.core.util.message.MessageFormat;
class="kw">import java.util.Set;
class="kw">import java.util.Map.Entry;
class="kw">import java.util.stream.Collectors;
class="kw">import javax.annotation.Nonnull;
class="kw">public class AssetTagsCommand class="kw">extends CommandBase {
@Nonnull
class="kw">private class="kw">final RequiredArg<String> classArg = this.withRequiredArg("class", "server.commands.assets.tags.class.desc", ArgTypes.STRING);
@Nonnull
class="kw">private class="kw">final RequiredArg<String> tagArg = this.withRequiredArg("tag", "server.commands.assets.tags.tag.desc", ArgTypes.STRING);
class="kw">public AssetTagsCommand() {
super("tags", "server.commands.assets.tags.desc");
}
@Override
class="kw">protected void executeSync(@Nonnull CommandContext var1) {
String var2 = this.classArg.get(var1);
String var3 = this.tagArg.get(var1);
int var4 = AssetRegistry.getTagIndex(var3);
if (var4 == Integer.MIN_VALUE) {
var1.sendMessage(Message.translation("server.commands.assets.tags.tagNotFound").param("tag", var3));
} else {
for (Entry var6 : AssetRegistry.getStoreMap().entrySet()) {
String var7 = var6.getKey().getSimpleName();
if (var7.equalsIgnoreCase(var2)) {
var1.sendMessage(Message.translation("server.commands.assets.tags.assetsOfTypeWithTag").param("type", var7).param("tag", var3));
AssetMap var8 = var6.getValue().getAssetMap();
Set var9 = var8.getKeysForTag(var4).stream().map(Object::toString).map(Message::raw).collect(Collectors.toSet());
var1.sendMessage(MessageFormat.list(Message.translation("server.commands.assets.tags.assetKeys"), var9));
if (var8 class="kw">instanceof AssetMapWithIndexes var10) {
Set var11 = var10.getIndexesForTag(var4).intStream().mapToObj(Integer::toString).map(Message::raw).collect(Collectors.toSet());
var1.sendMessage(MessageFormat.list(Message.translation("server.commands.assets.tags.assetIndexes"), var11));
}
break;
}
}
}
}
}