mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Initial support for model visibility system. Implemented it for OBJ, B3D and normal vanilla models; fixed NPE accessing parent state in B3DModel. Fixes #2801.
This commit is contained in:
1 parent
4008983a5d
commit
ce481da1d1
6 files changed
+228
-170
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package net.minecraftforge.common.model;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
final class HiddenModelPart implements IModelPart
|
||||
{
|
||||
private final ImmutableList<String> path;
|
||||
|
||||
HiddenModelPart(ImmutableList<String> path)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
ImmutableList<String> getPath()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.minecraftforge.common.model;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.collect.UnmodifiableIterator;
|
||||
|
||||
public enum Models
|
||||
{
|
||||
;
|
||||
|
||||
public static IModelPart getHiddenModelPart(ImmutableList<String> path)
|
||||
{
|
||||
return new HiddenModelPart(path);
|
||||
}
|
||||
|
||||
public static UnmodifiableIterator<String> getParts(IModelPart part)
|
||||
{
|
||||
if(part instanceof HiddenModelPart)
|
||||
{
|
||||
return ((HiddenModelPart) part).getPath().iterator();
|
||||
}
|
||||
return Iterators.emptyIterator();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user