下面列出了怎么用org.bukkit.loot.LootTable的API类实例代码及写法,或者点击链接到github查看源代码。
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
String namespace = minecraftKey.b();
String key = minecraftKey.getKey();
net.minecraft.server.v1_14_R1.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry()
.getLootTable(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
String namespace = minecraftKey.b();
String key = minecraftKey.getKey();
net.minecraft.server.v1_13_R1.LootTable lootTable = getCLW(cmdCtx).getServer().aP().a(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.d(cmdCtx, str);
String namespace = minecraftKey.getNamespace();
String key = minecraftKey.getKey();
// LootItemCondition lootItemCondition = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
// lootItemCondition.
// String namespace = lootItemCondition.b();
net.minecraft.server.v1_15_R1.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry()
.getLootTable(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
String namespace = minecraftKey.b();
String key = minecraftKey.getKey();
net.minecraft.server.v1_13_R2.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry().getLootTable(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
String namespace = minecraftKey.getNamespace();
String key = minecraftKey.getKey();
net.minecraft.server.v1_14_R1.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry().getLootTable(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
String namespace = minecraftKey.b();
String key = minecraftKey.getKey();
net.minecraft.server.v1_14_R1.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry().getLootTable(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
String namespace = minecraftKey.b();
String key = minecraftKey.getKey();
net.minecraft.server.v1_13_R2.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry().getLootTable(minecraftKey);
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@SuppressWarnings("deprecation")
@Override
public LootTable getLootTable(CommandContext cmdCtx, String str) {
MinecraftKey minecraftKey = ArgumentMinecraftKeyRegistered.e(cmdCtx, str);
String namespace = minecraftKey.getNamespace();
String key = minecraftKey.getKey();
// LootItemCondition lootItemCondition = ArgumentMinecraftKeyRegistered.c(cmdCtx, str);
// lootItemCondition.
// String namespace = lootItemCondition.b();
net.minecraft.server.v1_16_R1.LootTable lootTable = getCLW(cmdCtx).getServer().getLootTableRegistry()
.getLootTable(minecraftKey);
// CommandListenerWrapper clw = (CommandListenerWrapper) cmdCtx.getSource();
// new LootTableInfo.Builder(clw.getWorld())
// .setOptional(LootContextParameters.THIS_ENTITY, clw.getEntity())
// .set(LootContextParameters.POSITION, var1)
//
// private static int a(CommandContext<CommandListenerWrapper> var0, MinecraftKey var1, b var2)
// throws CommandSyntaxException {
// CommandListenerWrapper var3 = (CommandListenerWrapper) var0.getSource();
// LootTableInfo.Builder var4 = new LootTableInfo.Builder(var3.getWorld())
// .setOptional(LootContextParameters.THIS_ENTITY, (Object) var3.getEntity())
// .set(LootContextParameters.POSITION, (Object) new BlockPosition(var3.getPosition()));
// return CommandLoot.a(var0, var1, var4.build(LootContextParameterSets.CHEST), var2);
// }
//
// private static int a(CommandContext<CommandListenerWrapper> var0, MinecraftKey var12, LootTableInfo var2, b var3)
// throws CommandSyntaxException {
// CommandListenerWrapper var4 = (CommandListenerWrapper) var0.getSource();
// LootTable var5 = var4.getServer().getLootTableRegistry().getLootTable(var12);
// List var6 = var5.populateLoot(var2);
// return var3.accept(var0, var6, var1 -> CommandLoot.a(var4, var1));
// }
return new CraftLootTable(new NamespacedKey(namespace, key), lootTable);
}
@Override
public Class<?> getPrimitiveType() {
return LootTable.class;
}
@Override
public LootTable getLootTable() {
return null;
}
@Override
public LootTable getLootTable(NamespacedKey key) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public LootTable getLootTable(NamespacedKey key) {
return null;
}
@Override
public void setLootTable(LootTable lootTable) {
}
LootTable getLootTable(CommandContext<?> cmdCtx, String key);
@Override public void setLootTable(LootTable table) { }
@Override public void setLootTable(LootTable table) { }
@Override public void setLootTable(LootTable table) { }
@Override public void setLootTable(LootTable table) { }