net.minecraftforge.common.model.IModelPart Java Examples

The following examples show how to use net.minecraftforge.common.model.IModelPart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockGenericPipe.java    From Logistics-Pipes-2 with MIT License 6 votes vote down vote up
@Override
public Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part)
      {
          if(part.isPresent())
          {
              // This whole thing is subject to change, but should do for now.
              UnmodifiableIterator<String> parts = Models.getParts(part.get());
              if(parts.hasNext())
              {
                  String name = parts.next();
                  // only interested in the root level
                  if(!parts.hasNext() && hidden.contains(name))
                  {
                      return value;
                  }
              }
          }
          return Optional.absent();
      }
 
Example #2
Source File: BakedEvalModel.java    From OpenModsLib with MIT License 5 votes vote down vote up
@Override
public IBakedModel load(final Map<String, Float> key) throws Exception {
	final IModelState clipTransform = part -> {
		if (!part.isPresent()) return Optional.empty();

		final IModelPart maybeJoint = part.get();
		if (!(maybeJoint instanceof IJoint)) return Optional.empty();

		final IJoint joint = (IJoint)part.get();
		return Optional.of(evaluator.evaluate(joint, key));
	};
	return bakeModelWithTransform(clipTransform);
}
 
Example #3
Source File: ModelRocket.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
@Override
public Optional<TRSRTransformation> apply(
		Optional<? extends IModelPart> part) {
	return Optional.empty();
}