2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2020-07-02 17:49:11 +00:00
|
|
|
* Copyright (c) 2016-2020.
|
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
|
|
|
|
*/
|
|
|
|
|
2014-11-27 03:56:35 +00:00
|
|
|
package net.minecraftforge.client.event;
|
|
|
|
|
2019-02-14 23:08:53 +00:00
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.model.IBakedModel;
|
|
|
|
import net.minecraft.client.renderer.model.ModelManager;
|
|
|
|
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
2019-06-21 23:34:58 +00:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2015-02-04 06:45:23 +00:00
|
|
|
import net.minecraftforge.client.model.ModelLoader;
|
2019-06-23 00:36:07 +00:00
|
|
|
import net.minecraftforge.eventbus.api.Event;
|
2014-11-27 03:56:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when the ModelManager is notified of the resource manager reloading.
|
|
|
|
* Called after model registry is setup, but before it's passed to BlockModelShapes.
|
|
|
|
*/
|
2016-03-05 23:51:39 +00:00
|
|
|
// TODO: try to merge with ICustomModelLoader
|
2019-06-23 00:36:07 +00:00
|
|
|
public class ModelBakeEvent extends Event
|
2014-11-27 03:56:35 +00:00
|
|
|
{
|
2016-03-05 23:51:39 +00:00
|
|
|
private final ModelManager modelManager;
|
2019-06-21 23:34:58 +00:00
|
|
|
private final Map<ResourceLocation, IBakedModel> modelRegistry;
|
2016-03-05 23:51:39 +00:00
|
|
|
private final ModelLoader modelLoader;
|
2015-02-04 07:05:07 +00:00
|
|
|
|
2019-06-21 23:34:58 +00:00
|
|
|
public ModelBakeEvent(ModelManager modelManager, Map<ResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
2014-11-27 03:56:35 +00:00
|
|
|
{
|
|
|
|
this.modelManager = modelManager;
|
|
|
|
this.modelRegistry = modelRegistry;
|
2015-02-04 06:45:23 +00:00
|
|
|
this.modelLoader = modelLoader;
|
2014-11-27 03:56:35 +00:00
|
|
|
}
|
2016-03-05 23:51:39 +00:00
|
|
|
|
|
|
|
public ModelManager getModelManager()
|
|
|
|
{
|
|
|
|
return modelManager;
|
|
|
|
}
|
|
|
|
|
2019-06-21 23:34:58 +00:00
|
|
|
public Map<ResourceLocation, IBakedModel> getModelRegistry()
|
2016-03-05 23:51:39 +00:00
|
|
|
{
|
|
|
|
return modelRegistry;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ModelLoader getModelLoader()
|
|
|
|
{
|
|
|
|
return modelLoader;
|
|
|
|
}
|
2014-11-27 03:56:35 +00:00
|
|
|
}
|