mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 05:02:30 +00:00
Cleanup and reformat: Delete all ISBRH's and IItemRenderers besides book, reformat to tabs in my new classes, add missing copylefts
This commit is contained in:
1 parent
eb7a6aee50
commit
fddf546474
66 files changed
+1877
-2879
No files matched your search
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
* <p>
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
@@ -7,8 +15,8 @@ import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.LoaderState;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -19,80 +27,82 @@ import java.util.Map;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class BotaniaAPIClient {
|
||||
|
||||
private static final Map<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
|
||||
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> islandTypeModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
|
||||
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> islandTypeModels = Maps.newHashMap();
|
||||
|
||||
/**
|
||||
* Register your model for the given subtile class here.
|
||||
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
|
||||
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
|
||||
* Tint is applied whenever a player recolors the flower using floral dye
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used for this subtile
|
||||
* @param itemModel A path to a blockstate json and variant to be used for this subtile's item form
|
||||
*/
|
||||
public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
subtileBlockModels.put(subTileName, model);
|
||||
subtileItemModels.put(subTileName, itemModel);
|
||||
}
|
||||
private BotaniaAPIClient() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Register your model for the given subtile class here.
|
||||
* Call this DURING PREINIT.
|
||||
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
|
||||
* Tint is applied whenever a player recolors the flower using floral dye
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory"
|
||||
*/
|
||||
public static void registerSubtileModel(String subTileName, ModelResourceLocation model) {
|
||||
registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory"));
|
||||
}
|
||||
/**
|
||||
* Register your model for the given subtile class here.
|
||||
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
|
||||
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
|
||||
* Tint is applied whenever a player recolors the flower using floral dye
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used for this subtile
|
||||
* @param itemModel A path to a blockstate json and variant to be used for this subtile's item form
|
||||
*/
|
||||
public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
subtileBlockModels.put(subTileName, model);
|
||||
subtileItemModels.put(subTileName, itemModel);
|
||||
}
|
||||
|
||||
// Convenience overloads for the above two calls
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model);
|
||||
}
|
||||
/**
|
||||
* Register your model for the given subtile class here.
|
||||
* Call this DURING PREINIT.
|
||||
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
|
||||
* Tint is applied whenever a player recolors the flower using floral dye
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory"
|
||||
*/
|
||||
public static void registerSubtileModel(String subTileName, ModelResourceLocation model) {
|
||||
registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory"));
|
||||
}
|
||||
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
|
||||
}
|
||||
// Convenience overloads for the above two calls
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
|
||||
return Collections.unmodifiableMap(subtileBlockModels);
|
||||
}
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile item model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
return Collections.unmodifiableMap(subtileItemModels);
|
||||
}
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
|
||||
return Collections.unmodifiableMap(subtileBlockModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers your model for island type islandType here.
|
||||
* Call this DURING PREINIT.
|
||||
* @param islandType The islandtype to register
|
||||
* @param model The variant within a blockstate json to use as the islandtype's model
|
||||
*/
|
||||
public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) {
|
||||
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
islandTypeModels.put(islandType, model);
|
||||
}
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile item model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
return Collections.unmodifiableMap(subtileItemModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered island type model map
|
||||
*/
|
||||
public static Map<IFloatingFlower.IslandType, ModelResourceLocation> getRegisteredIslandTypeModels() {
|
||||
return Collections.unmodifiableMap(islandTypeModels);
|
||||
}
|
||||
/**
|
||||
* Registers your model for island type islandType here.
|
||||
* Call this DURING PREINIT.
|
||||
*
|
||||
* @param islandType The islandtype to register
|
||||
* @param model The variant within a blockstate json to use as the islandtype's model
|
||||
*/
|
||||
public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) {
|
||||
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
islandTypeModels.put(islandType, model);
|
||||
}
|
||||
|
||||
private BotaniaAPIClient() {}
|
||||
/**
|
||||
* @return An immutable and live view of the registered island type model map
|
||||
*/
|
||||
public static Map<IFloatingFlower.IslandType, ModelResourceLocation> getRegisteredIslandTypeModels() {
|
||||
return Collections.unmodifiableMap(islandTypeModels);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user