Files
MinecraftForge/src/main/java/net/minecraftforge/event/LootTableLoadEvent.java
T

56 lines
1.5 KiB
Java
Raw Normal View History

/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
2016-05-09 14:15:59 -07:00
package net.minecraftforge.event;
2021-07-17 00:08:49 -05:00
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.LootTables;
2018-06-10 21:12:46 -04:00
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
2016-05-09 14:15:59 -07:00
/**
* Event fired when a LootTable json is loaded from json.
* This event is fired whenever resources are loaded, or when the server starts.
* This event will NOT be fired for LootTables loaded from the world folder, these are
* considered configurations files and should not be modified by mods.
*
* Canceling the event will make it load a empty loot table.
*
*/
@Cancelable
public class LootTableLoadEvent extends Event
{
private final ResourceLocation name;
private LootTable table;
2021-07-17 00:08:49 -05:00
private LootTables lootTableManager;
2016-05-09 14:15:59 -07:00
2021-07-17 00:08:49 -05:00
public LootTableLoadEvent(ResourceLocation name, LootTable table, LootTables lootTableManager)
2016-05-09 14:15:59 -07:00
{
this.name = name;
this.table = table;
this.lootTableManager = lootTableManager;
2016-05-09 14:15:59 -07:00
}
public ResourceLocation getName()
{
return this.name;
}
public LootTable getTable()
{
return this.table;
}
2021-07-17 00:08:49 -05:00
public LootTables getLootTableManager()
{
return this.lootTableManager;
}
2016-05-09 14:15:59 -07:00
public void setTable(LootTable table)
{
this.table = table;
}
}