2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2018-07-01 21:17:28 +00:00
|
|
|
* Copyright (c) 2016-2018.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2016-05-09 21:15:59 +00:00
|
|
|
package net.minecraftforge.event;
|
|
|
|
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraft.world.storage.loot.LootTable;
|
2017-04-07 23:22:49 +00:00
|
|
|
import net.minecraft.world.storage.loot.LootTableManager;
|
2016-05-09 21:15:59 +00:00
|
|
|
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
2017-04-07 23:22:49 +00:00
|
|
|
private LootTableManager lootTableManager;
|
2016-05-09 21:15:59 +00:00
|
|
|
|
2017-04-07 23:22:49 +00:00
|
|
|
public LootTableLoadEvent(ResourceLocation name, LootTable table, LootTableManager lootTableManager)
|
2016-05-09 21:15:59 +00:00
|
|
|
{
|
|
|
|
this.name = name;
|
|
|
|
this.table = table;
|
2017-04-07 23:22:49 +00:00
|
|
|
this.lootTableManager = lootTableManager;
|
2016-05-09 21:15:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public ResourceLocation getName()
|
|
|
|
{
|
|
|
|
return this.name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public LootTable getTable()
|
|
|
|
{
|
|
|
|
return this.table;
|
|
|
|
}
|
|
|
|
|
2017-04-07 23:22:49 +00:00
|
|
|
public LootTableManager getLootTableManager()
|
|
|
|
{
|
|
|
|
return this.lootTableManager;
|
|
|
|
}
|
|
|
|
|
2016-05-09 21:15:59 +00:00
|
|
|
public void setTable(LootTable table)
|
|
|
|
{
|
|
|
|
this.table = table;
|
|
|
|
}
|
|
|
|
}
|