Package org.cyclops.cyclopscore.helper
Class ModelHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.ModelHelpers
Helpers for models.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final net.minecraft.client.renderer.block.model.ItemTransforms
static final net.minecraft.client.renderer.block.model.ItemTransforms
static final Map<net.minecraft.core.Direction,
List<net.minecraft.client.renderer.block.model.BakedQuad>> static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
static final net.minecraft.client.renderer.block.model.ItemTransform
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
getSafeProperty
(net.minecraftforge.client.model.data.ModelData modelData, net.minecraftforge.client.model.data.ModelProperty<T> property, T fallback) Safely get a model data property for a data state and value that may not have been set yet.static net.minecraft.client.renderer.block.model.BlockModel
loadModelBlock
(net.minecraft.resources.ResourceLocation modelLocation) Read the given model location to aBlockModel
.static net.minecraft.client.renderer.block.model.ItemTransforms
modifyDefaultTransforms
(Map<net.minecraft.world.item.ItemDisplayContext, net.minecraft.client.renderer.block.model.ItemTransform> overrides) Apply the given overrides to the default transformations.
-
Field Details
-
THIRD_PERSON_RIGHT_HAND
public static final net.minecraft.client.renderer.block.model.ItemTransform THIRD_PERSON_RIGHT_HAND -
THIRD_PERSON_LEFT_HAND
public static final net.minecraft.client.renderer.block.model.ItemTransform THIRD_PERSON_LEFT_HAND -
FIRST_PERSON_RIGHT_HAND
public static final net.minecraft.client.renderer.block.model.ItemTransform FIRST_PERSON_RIGHT_HAND -
FIRST_PERSON_LEFT_HAND
public static final net.minecraft.client.renderer.block.model.ItemTransform FIRST_PERSON_LEFT_HAND -
HEAD
public static final net.minecraft.client.renderer.block.model.ItemTransform HEAD -
GROUND
public static final net.minecraft.client.renderer.block.model.ItemTransform GROUND -
FIXED
public static final net.minecraft.client.renderer.block.model.ItemTransform FIXED -
GUI
public static final net.minecraft.client.renderer.block.model.ItemTransform GUI -
DEFAULT_CAMERA_TRANSFORMS
public static final net.minecraft.client.renderer.block.model.ItemTransforms DEFAULT_CAMERA_TRANSFORMS -
THIRD_PERSON_RIGHT_HAND_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform THIRD_PERSON_RIGHT_HAND_ITEM -
THIRD_PERSON_LEFT_HAND_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform THIRD_PERSON_LEFT_HAND_ITEM -
FIRST_PERSON_RIGHT_HAND_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform FIRST_PERSON_RIGHT_HAND_ITEM -
FIRST_PERSON_LEFT_HAND_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform FIRST_PERSON_LEFT_HAND_ITEM -
HEAD_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform HEAD_ITEM -
GROUND_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform GROUND_ITEM -
FIXED_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform FIXED_ITEM -
GUI_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransform GUI_ITEM -
DEFAULT_CAMERA_TRANSFORMS_ITEM
public static final net.minecraft.client.renderer.block.model.ItemTransforms DEFAULT_CAMERA_TRANSFORMS_ITEM -
EMPTY_FACE_QUADS
-
-
Constructor Details
-
ModelHelpers
public ModelHelpers()
-
-
Method Details
-
loadModelBlock
public static net.minecraft.client.renderer.block.model.BlockModel loadModelBlock(net.minecraft.resources.ResourceLocation modelLocation) throws IOException Read the given model location to aBlockModel
.- Parameters:
modelLocation
- A model location (without .json suffix)- Returns:
- The corresponding model.
- Throws:
IOException
- If the model file was invalid.
-
getSafeProperty
public static <T> T getSafeProperty(@Nullable net.minecraftforge.client.model.data.ModelData modelData, net.minecraftforge.client.model.data.ModelProperty<T> property, T fallback) Safely get a model data property for a data state and value that may not have been set yet.- Type Parameters:
T
- The type of value to fetch.- Parameters:
modelData
- The model data.property
- The property to get the value for.fallback
- The fallback value when something has failed.- Returns:
- The value.
-
modifyDefaultTransforms
public static net.minecraft.client.renderer.block.model.ItemTransforms modifyDefaultTransforms(Map<net.minecraft.world.item.ItemDisplayContext, net.minecraft.client.renderer.block.model.ItemTransform> overrides) Apply the given overrides to the default transformations.- Parameters:
overrides
- The transformations to override.- Returns:
- The resulting transformation map.
-