Package appeng.api.client
Class StorageCellModels
java.lang.Object
appeng.api.client.StorageCellModels
A registry for 3D models used to render storage cells in the world, when they are inserted into a drive or similar
machines.
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.resources.ResourceLocation
Returns the default model, which can be used when no explicit model is registered.static @Nullable net.minecraft.resources.ResourceLocation
model
(net.minecraft.world.level.ItemLike itemLike) TheResourceLocation
of the model used to render the given storage cellItem
when inserted into a drive or similar.static Map
<net.minecraft.world.item.Item, net.minecraft.resources.ResourceLocation> models()
A copy of all registered mappings.static void
registerModel
(net.minecraft.world.level.ItemLike itemLike, net.minecraft.resources.ResourceLocation model) Register a new model for a storage cell item.
-
Method Details
-
registerModel
public static void registerModel(net.minecraft.world.level.ItemLike itemLike, net.minecraft.resources.ResourceLocation model) Register a new model for a storage cell item.You are responsible for ensuring that the given model is actually loaded by the game. See
ModelEvent.RegisterAdditional
. This method only maps anItem
to aResourceLocation
which can be looked up from theModelBakery
. No validation about missing models will be done. Will throw an exception in case a model is already registered for an item. For examples look at our cell part models within the drive model directory.- Parameters:
itemLike
- The cell itemmodel
- TheResourceLocation
representing the model.
-
model
@Nullable public static @Nullable net.minecraft.resources.ResourceLocation model(net.minecraft.world.level.ItemLike itemLike) TheResourceLocation
of the model used to render the given storage cellItem
when inserted into a drive or similar.- Parameters:
itemLike
-- Returns:
- null, if no model is registered.
-
models
A copy of all registered mappings. -
getDefaultModel
public static net.minecraft.resources.ResourceLocation getDefaultModel()Returns the default model, which can be used when no explicit model is registered.
-