org.bukkit.loot.LootTable Java Examples

The following examples show how to use org.bukkit.loot.LootTable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NMS_1_14.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #2
Source File: NMS_1_13_1.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #3
Source File: NMS_1_14_3.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #4
Source File: NMS_1_14_4.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #5
Source File: NMS_1_13_2.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #6
Source File: NMS_1_15.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
	}
 
Example #7
Source File: NMS_1_13.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #8
Source File: LootTableArgument.java    From 1.13-Command-API with Apache License 2.0 4 votes vote down vote up
@Override
public Class<?> getPrimitiveType() {
	return LootTable.class;
}
 
Example #9
Source File: NMS_1_16_R1.java    From 1.13-Command-API with Apache License 2.0 4 votes vote down vote up
@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);
	}
 
Example #10
Source File: ChestImpl.java    From Civs with GNU General Public License v3.0 4 votes vote down vote up
@Override
public LootTable getLootTable() {
    return null;
}
 
Example #11
Source File: MockServer.java    From Chimera with MIT License 4 votes vote down vote up
@Override
public LootTable getLootTable(NamespacedKey key) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
Example #12
Source File: MockServer.java    From SaneEconomy with GNU General Public License v3.0 4 votes vote down vote up
@Override
public LootTable getLootTable(NamespacedKey key) {
    return null;
}
 
Example #13
Source File: ChestImpl.java    From Civs with GNU General Public License v3.0 2 votes vote down vote up
@Override
public void setLootTable(LootTable lootTable) {

}
 
Example #14
Source File: NMS.java    From 1.13-Command-API with Apache License 2.0 votes vote down vote up
LootTable          getLootTable(CommandContext<?> cmdCtx, String key); 
Example #15
Source File: CraftNMSSlime.java    From HolographicDisplays with GNU General Public License v3.0 votes vote down vote up
@Override public void setLootTable(LootTable table) { } 
Example #16
Source File: CraftNMSSlime.java    From HolographicDisplays with GNU General Public License v3.0 votes vote down vote up
@Override public void setLootTable(LootTable table) { } 
Example #17
Source File: CraftNMSSlime.java    From HolographicDisplays with GNU General Public License v3.0 votes vote down vote up
@Override public void setLootTable(LootTable table) { } 
Example #18
Source File: CraftNMSSlime.java    From HolographicDisplays with GNU General Public License v3.0 votes vote down vote up
@Override public void setLootTable(LootTable table) { }