MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getModelCull

Method getModelCull

src/main/java/net/optifine/SmartLeaves.java:100–168  ·  view source on GitHub ↗
(String type, List updatedTypes)

Source from the content-addressed store, hash-verified

98 }
99
100 static IBakedModel getModelCull(String type, List updatedTypes)
101 {
102 ModelManager modelmanager = Config.getModelManager();
103
104 if (modelmanager == null)
105 {
106 return null;
107 }
108 else
109 {
110 ResourceLocation resourcelocation = new ResourceLocation("blockstates/" + type + "_leaves.json");
111
112 if (Config.getDefiningResourcePack(resourcelocation) != Config.getDefaultResourcePack())
113 {
114 return null;
115 }
116 else
117 {
118 ResourceLocation resourcelocation1 = new ResourceLocation("models/block/" + type + "_leaves.json");
119
120 if (Config.getDefiningResourcePack(resourcelocation1) != Config.getDefaultResourcePack())
121 {
122 return null;
123 }
124 else
125 {
126 ModelResourceLocation modelresourcelocation = new ModelResourceLocation(type + "_leaves", "normal");
127 IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation);
128
129 if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel())
130 {
131 List list = ibakedmodel.getGeneralQuads();
132
133 if (list.size() == 0)
134 {
135 return ibakedmodel;
136 }
137 else if (list.size() != 6)
138 {
139 return null;
140 }
141 else
142 {
143 for (Object bakedquad0 : list)
144 {
145 BakedQuad bakedquad = (BakedQuad) bakedquad0;
146 List list1 = ibakedmodel.getFaceQuads(bakedquad.getFace());
147
148 if (list1.size() > 0)
149 {
150 return null;
151 }
152
153 list1.add(bakedquad);
154 }
155
156 list.clear();
157 updatedTypes.add(type + "_leaves");

Callers 1

updateLeavesModelsMethod · 0.95

Calls 11

getModelManagerMethod · 0.95
getModelMethod · 0.95
getMissingModelMethod · 0.95
getGeneralQuadsMethod · 0.95
getFaceQuadsMethod · 0.95
getFaceMethod · 0.95
clearMethod · 0.65
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected