mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Updated ForgeDev MCP Mapping Version (#6532)
This commit is contained in:
1 parent
aca45340bf
commit
2ce4f5ece5
83 files changed
+392
-379
No files matched your search
@@ -101,7 +101,7 @@ public class BlockModelConfiguration implements IModelConfiguration
|
||||
@Override
|
||||
public Material resolveTexture(String name)
|
||||
{
|
||||
return owner.func_228816_c_(name);
|
||||
return owner.resolveTextureName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,7 +133,7 @@ public class BlockModelConfiguration implements IModelConfiguration
|
||||
IModelTransform state = getCustomModelState();
|
||||
|
||||
return state != null
|
||||
? new SimpleModelTransform(PerspectiveMapWrapper.getTransformsWithFallback(state, getCameraTransforms()), state.func_225615_b_())
|
||||
? new SimpleModelTransform(PerspectiveMapWrapper.getTransformsWithFallback(state, getCameraTransforms()), state.getRotation())
|
||||
: new SimpleModelTransform(PerspectiveMapWrapper.getTransforms(getCameraTransforms()));
|
||||
}
|
||||
|
||||
|
||||
@@ -180,16 +180,16 @@ public class CompositeModel implements IDynamicBakedModel
|
||||
throw new UnsupportedOperationException("Attempted to call adQuads on a Submodel instance. Please don't.");
|
||||
}
|
||||
|
||||
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
{
|
||||
return model.func_225613_a_(bakery, spriteGetter, new ModelTransformComposition(this.modelTransform, modelTransform,
|
||||
return model.bakeModel(bakery, spriteGetter, new ModelTransformComposition(this.modelTransform, modelTransform,
|
||||
this.modelTransform.isUvLock() || modelTransform.isUvLock()), modelLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors)
|
||||
{
|
||||
return model.func_225614_a_(modelGetter, missingTextureErrors);
|
||||
return model.getTextures(modelGetter, missingTextureErrors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public class CompositeModel implements IDynamicBakedModel
|
||||
Submodel submodel = part.getValue();
|
||||
if (!owner.getPartVisibility(submodel))
|
||||
continue;
|
||||
bakedParts.put(part.getKey(), submodel.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation));
|
||||
bakedParts.put(part.getKey(), submodel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation));
|
||||
}
|
||||
return new CompositeModel(owner.isShadedInGui(), owner.useSmoothLighting(), particle, bakedParts.build(), owner.getCombinedTransform(), overrides);
|
||||
}
|
||||
|
||||
@@ -97,25 +97,25 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
|
||||
{
|
||||
Material particleLocation = owner.resolveTexture("particle");
|
||||
if (MissingTextureSprite.getLocation().equals(particleLocation.func_229313_b_()))
|
||||
if (MissingTextureSprite.getLocation().equals(particleLocation.getTextureLocation()))
|
||||
{
|
||||
particleLocation = null;
|
||||
}
|
||||
|
||||
Material baseLocation = owner.resolveTexture("base");
|
||||
if (MissingTextureSprite.getLocation().equals(baseLocation.func_229313_b_()))
|
||||
if (MissingTextureSprite.getLocation().equals(baseLocation.getTextureLocation()))
|
||||
{
|
||||
baseLocation = null;
|
||||
}
|
||||
|
||||
Material fluidMaskLocation = owner.resolveTexture("fluid");
|
||||
if (MissingTextureSprite.getLocation().equals(fluidMaskLocation.func_229313_b_()))
|
||||
if (MissingTextureSprite.getLocation().equals(fluidMaskLocation.getTextureLocation()))
|
||||
{
|
||||
fluidMaskLocation = null;
|
||||
}
|
||||
|
||||
Material coverLocation = owner.resolveTexture("cover");
|
||||
if (!MissingTextureSprite.getLocation().equals(coverLocation.func_229313_b_()))
|
||||
if (!MissingTextureSprite.getLocation().equals(coverLocation.getTextureLocation()))
|
||||
{
|
||||
// cover (the actual item around the other two)
|
||||
coverLocation = null;
|
||||
@@ -135,7 +135,7 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
|
||||
modelTransform = new ModelTransformComposition(modelTransform, new SimpleModelTransform(new TransformationMatrix(null, new Quaternion(0, 0, 1, 0), null, null)));
|
||||
}
|
||||
|
||||
TransformationMatrix transform = modelTransform.func_225615_b_();
|
||||
TransformationMatrix transform = modelTransform.getRotation();
|
||||
|
||||
TextureAtlasSprite fluidSprite = fluid != Fluids.EMPTY ? spriteGetter.apply(ForgeHooksClient.getBlockMaterial(fluid.getAttributes().getStillTexture())) : null;
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> func_225614_a_(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
|
||||
public Collection<Material> getTextures(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
|
||||
{
|
||||
return ImmutableList.of(font2);
|
||||
}
|
||||
@@ -104,11 +104,11 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
{
|
||||
IBakedModel bigMissing = missingModel.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation);
|
||||
IBakedModel bigMissing = missingModel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation);
|
||||
ModelTransformComposition smallState = new ModelTransformComposition(modelTransform, new SimpleModelTransform(smallTransformation));
|
||||
IBakedModel smallMissing = missingModel.func_225613_a_(bakery, spriteGetter, smallState, modelLocation);
|
||||
IBakedModel smallMissing = missingModel.bakeModel(bakery, spriteGetter, smallState, modelLocation);
|
||||
return new BakedModel(bigMissing, smallMissing, fontRenderer, message, spriteGetter.apply(font2));
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
@Override
|
||||
public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack mat)
|
||||
{
|
||||
TransformationMatrix transform = TransformationMatrix.func_227983_a_();
|
||||
TransformationMatrix transform = TransformationMatrix.identity();
|
||||
boolean big = true;
|
||||
switch (cameraTransformType)
|
||||
{
|
||||
@@ -235,7 +235,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||
default:
|
||||
break;
|
||||
}
|
||||
mat.func_227866_c_().func_227870_a_().func_226595_a_(transform.func_227988_c_());
|
||||
mat.getLast().getMatrix().mul(transform.getMatrix());
|
||||
if (big != this.big)
|
||||
{
|
||||
return otherModel;
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class FluidModel implements IModelGeometry<FluidModel>
|
||||
{
|
||||
FluidAttributes attrs = fluid.getAttributes();
|
||||
return new CachingBakedFluid(
|
||||
modelTransform.func_225615_b_(),
|
||||
modelTransform.getRotation(),
|
||||
PerspectiveMapWrapper.getTransforms(modelTransform),
|
||||
modelLocation,
|
||||
attrs.getColor(),
|
||||
@@ -389,7 +389,7 @@ public final class FluidModel implements IModelGeometry<FluidModel>
|
||||
private void putVertex(IVertexConsumer consumer, Direction side, boolean offset, float x, float y, float z, float u, float v)
|
||||
{
|
||||
VertexFormat format = DefaultVertexFormats.BLOCK;
|
||||
ImmutableList<VertexFormatElement> elements = format.func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> elements = format.getElements();
|
||||
for(int e = 0; e < elements.size(); e++)
|
||||
{
|
||||
switch(elements.get(e).getUsage())
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation)
|
||||
{
|
||||
//TODO: Verify
|
||||
TransformationMatrix transform = modelTransform.func_225615_b_();
|
||||
TransformationMatrix transform = modelTransform.getRotation();
|
||||
ImmutableList<BakedQuad> quads = getQuadsForSprites(textures, transform, spriteGetter);
|
||||
TextureAtlasSprite particle = spriteGetter.apply(
|
||||
owner.isTexturePresent("particle") ? owner.resolveTexture("particle") : textures.get(0)
|
||||
@@ -396,9 +396,9 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
|
||||
private static void putVertex(IVertexConsumer consumer, Direction side, float x, float y, float z, float u, float v)
|
||||
{
|
||||
VertexFormat format = consumer.getVertexFormat();
|
||||
for(int e = 0; e < format.func_227894_c_().size(); e++)
|
||||
for(int e = 0; e < format.getElements().size(); e++)
|
||||
{
|
||||
switch(format.func_227894_c_().get(e).getUsage())
|
||||
switch(format.getElements().get(e).getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
consumer.put(e, x, y, z, 1f);
|
||||
@@ -413,7 +413,7 @@ public final class ItemLayerModel implements IModelGeometry<ItemLayerModel>
|
||||
consumer.put(e, offX, offY, offZ, 0f);
|
||||
break;
|
||||
case UV:
|
||||
if(format.func_227894_c_().get(e).getIndex() == 0)
|
||||
if(format.getElements().get(e).getIndex() == 0)
|
||||
{
|
||||
consumer.put(e, u, v, 0f, 1f);
|
||||
break;
|
||||
|
||||
@@ -264,9 +264,9 @@ public final class ItemTextureQuadConverter
|
||||
float x, float y, float z, float u, float v, int color)
|
||||
{
|
||||
VertexFormat format = consumer.getVertexFormat();
|
||||
for (int e = 0; e < format.func_227894_c_().size(); e++)
|
||||
for (int e = 0; e < format.getElements().size(); e++)
|
||||
{
|
||||
switch (format.func_227894_c_().get(e).getUsage())
|
||||
switch (format.getElements().get(e).getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
consumer.put(e, x, y, z, 1f);
|
||||
@@ -285,7 +285,7 @@ public final class ItemTextureQuadConverter
|
||||
consumer.put(e, offX, offY, offZ, 0f);
|
||||
break;
|
||||
case UV:
|
||||
if (format.func_227894_c_().get(e).getIndex() == 0)
|
||||
if (format.getElements().get(e).getIndex() == 0)
|
||||
{
|
||||
consumer.put(e, u, v, 0f, 1f);
|
||||
break;
|
||||
|
||||
@@ -162,7 +162,7 @@ public final class ModelLoader extends ModelBakery
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, LOCATION).func_229314_c_();
|
||||
instance = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, LOCATION).getSprite();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public final class ModelLoader extends ModelBakery
|
||||
*/
|
||||
public static Function<Material, TextureAtlasSprite> defaultTextureGetter()
|
||||
{
|
||||
return Material::func_229314_c_;
|
||||
return Material::getSprite;
|
||||
}
|
||||
|
||||
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
|
||||
|
||||
@@ -223,7 +223,7 @@ public class ModelLoaderRegistry
|
||||
{
|
||||
throw new JsonParseException("transform: allowed keys: 'thirdperson', 'firstperson', 'gui', 'head', 'matrix', 'translation', 'rotation', 'scale', 'post-rotation'");
|
||||
}
|
||||
TransformationMatrix base = TransformationMatrix.func_227983_a_();
|
||||
TransformationMatrix base = TransformationMatrix.identity();
|
||||
if(!transform.entrySet().isEmpty())
|
||||
{
|
||||
base = context.deserialize(transform, TransformationMatrix.class);
|
||||
@@ -282,7 +282,7 @@ public class ModelLoaderRegistry
|
||||
modelBuilder.addGeneralQuad(BlockModel.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, modelTransform, modelLocation));
|
||||
} else {
|
||||
modelBuilder.addFaceQuad(
|
||||
modelTransform.func_225615_b_().rotateTransform(blockpartface.cullFace),
|
||||
modelTransform.getRotation().rotateTransform(blockpartface.cullFace),
|
||||
BlockModel.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, direction, modelTransform, modelLocation));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,9 +51,9 @@ public class ModelTransformComposition implements IModelTransform
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformationMatrix func_225615_b_()
|
||||
public TransformationMatrix getRotation()
|
||||
{
|
||||
return first.func_225615_b_().compose(second.func_225615_b_());
|
||||
return first.getRotation().compose(second.getRotation());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,7 +72,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||
Set<Material> materials = Sets.newHashSet();
|
||||
materials.add(owner.resolveTexture("particle"));
|
||||
for (IUnbakedModel m : models.values())
|
||||
materials.addAll(m.func_225614_a_(modelGetter, missingTextureErrors));
|
||||
materials.addAll(m.getTextures(modelGetter, missingTextureErrors));
|
||||
return materials;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||
ImmutableMap.Builder<RenderType, IBakedModel> builder = ImmutableMap.builder();
|
||||
for(Map.Entry<RenderType, IUnbakedModel> entry : models.entrySet())
|
||||
{
|
||||
builder.put(entry.getKey(), entry.getValue().func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation));
|
||||
builder.put(entry.getKey(), entry.getValue().bakeModel(bakery, spriteGetter, modelTransform, modelLocation));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||
owner.useSmoothLighting(), owner.isShadedInGui(),
|
||||
owner.isSideLit(), spriteGetter.apply(owner.resolveTexture("particle")), overrides,
|
||||
buildModels(models, modelTransform, bakery, spriteGetter, modelLocation),
|
||||
missing.func_225613_a_(bakery, spriteGetter, modelTransform, modelLocation),
|
||||
missing.bakeModel(bakery, spriteGetter, modelTransform, modelLocation),
|
||||
PerspectiveMapWrapper.getTransforms(new ModelTransformComposition(owner.getCombinedTransform(), modelTransform)));
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||
{
|
||||
ImmutableMap.Builder<RenderType, IUnbakedModel> builder = ImmutableMap.builder();
|
||||
JsonObject layersObject = JSONUtils.getJsonObject(modelContents, "layers");
|
||||
for(RenderType layer : RenderType.func_228661_n_()) // block layers
|
||||
for(RenderType layer : RenderType.getBlockRenderTypes()) // block layers
|
||||
{
|
||||
String layerName = layer.toString(); // mc overrides toString to return the ID for the layer
|
||||
if(layersObject.has(layerName))
|
||||
|
||||
@@ -106,7 +106,7 @@ public class PerspectiveMapWrapper implements IDynamicBakedModel
|
||||
|
||||
public static IBakedModel handlePerspective(IBakedModel model, ImmutableMap<ItemCameraTransforms.TransformType, TransformationMatrix> transforms, ItemCameraTransforms.TransformType cameraTransformType, MatrixStack mat)
|
||||
{
|
||||
TransformationMatrix tr = transforms.getOrDefault(cameraTransformType, TransformationMatrix.func_227983_a_());
|
||||
TransformationMatrix tr = transforms.getOrDefault(cameraTransformType, TransformationMatrix.identity());
|
||||
if (!tr.isIdentity())
|
||||
{
|
||||
tr.push(mat);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class QuadTransformer
|
||||
|
||||
Vector4f pos = new Vector4f(x, y, z, 1);
|
||||
transform.transformPosition(pos);
|
||||
pos.func_229375_f_();
|
||||
pos.perspectiveDivide();
|
||||
|
||||
putAtByteOffset(outData, offset, Float.floatToRawIntBits(pos.getX()));
|
||||
putAtByteOffset(outData,offset + 4, Float.floatToRawIntBits(pos.getY()));
|
||||
@@ -77,7 +77,7 @@ public class QuadTransformer
|
||||
|
||||
Vector3f pos = new Vector3f(x, y, z);
|
||||
transform.transformNormal(pos);
|
||||
pos.func_229194_d_();
|
||||
pos.normalize();
|
||||
|
||||
int normalOut = ((((byte)(x / 127.0f)) & 0xFF) << 24) |
|
||||
((((byte)(y / 127.0f)) & 0xFF) << 16) |
|
||||
@@ -125,16 +125,16 @@ public class QuadTransformer
|
||||
{
|
||||
int index;
|
||||
VertexFormatElement element = null;
|
||||
for (index = 0; index < fmt.func_227894_c_().size(); index++)
|
||||
for (index = 0; index < fmt.getElements().size(); index++)
|
||||
{
|
||||
VertexFormatElement el = fmt.func_227894_c_().get(index);
|
||||
VertexFormatElement el = fmt.getElements().get(index);
|
||||
if (el.getUsage() == VertexFormatElement.Usage.POSITION)
|
||||
{
|
||||
element = el;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == fmt.func_227894_c_().size() || element == null)
|
||||
if (index == fmt.getElements().size() || element == null)
|
||||
throw new RuntimeException("Expected vertex format to have a POSITION attribute");
|
||||
if (element.getType() != VertexFormatElement.Type.FLOAT)
|
||||
throw new RuntimeException("Expected POSITION attribute to have data type FLOAT");
|
||||
@@ -147,16 +147,16 @@ public class QuadTransformer
|
||||
{
|
||||
int index;
|
||||
VertexFormatElement element = null;
|
||||
for (index = 0; index < fmt.func_227894_c_().size(); index++)
|
||||
for (index = 0; index < fmt.getElements().size(); index++)
|
||||
{
|
||||
VertexFormatElement el = fmt.func_227894_c_().get(index);
|
||||
VertexFormatElement el = fmt.getElements().get(index);
|
||||
if (el.getUsage() == VertexFormatElement.Usage.NORMAL)
|
||||
{
|
||||
element = el;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == fmt.func_227894_c_().size() || element == null)
|
||||
if (index == fmt.getElements().size() || element == null)
|
||||
throw new IllegalStateException("BLOCK format does not have normals?");
|
||||
if (element.getType() != VertexFormatElement.Type.BYTE)
|
||||
throw new RuntimeException("Expected NORMAL attribute to have data type BYTE");
|
||||
@@ -176,7 +176,7 @@ public class QuadTransformer
|
||||
int[] outData = Arrays.copyOf(inData, inData.length);
|
||||
processVertices(inData, outData);
|
||||
|
||||
return new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.getSprite(), input.shouldApplyDiffuseLighting());
|
||||
return new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.func_187508_a(), input.shouldApplyDiffuseLighting());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,7 +208,7 @@ public class QuadTransformer
|
||||
int[] outData = Arrays.copyOf(inData, inData.length);
|
||||
processVertices(inData, outData);
|
||||
|
||||
outputs.add(new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.getSprite(), input.shouldApplyDiffuseLighting()));
|
||||
outputs.add(new BakedQuad(outData, input.getTintIndex(), input.getFace(), input.func_187508_a(), input.shouldApplyDiffuseLighting()));
|
||||
}
|
||||
return outputs;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public abstract class SimpleModelFontRenderer extends FontRenderer {
|
||||
|
||||
private void addVertex(BakedQuadBuilder quadBuilder, float x, float y, float u, float v)
|
||||
{
|
||||
ImmutableList<VertexFormatElement> elements = quadBuilder.getVertexFormat().func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> elements = quadBuilder.getVertexFormat().getElements();
|
||||
for(int e = 0; e < elements.size(); e++)
|
||||
{
|
||||
VertexFormatElement element = elements.get(e);
|
||||
|
||||
@@ -29,14 +29,14 @@ import com.google.common.collect.ImmutableMap;
|
||||
*/
|
||||
public final class SimpleModelTransform implements IModelTransform
|
||||
{
|
||||
public static final SimpleModelTransform IDENTITY = new SimpleModelTransform(TransformationMatrix.func_227983_a_());
|
||||
public static final SimpleModelTransform IDENTITY = new SimpleModelTransform(TransformationMatrix.identity());
|
||||
|
||||
private final ImmutableMap<?, TransformationMatrix> map;
|
||||
private final TransformationMatrix base;
|
||||
|
||||
public SimpleModelTransform(ImmutableMap<?, TransformationMatrix> map)
|
||||
{
|
||||
this(map, TransformationMatrix.func_227983_a_());
|
||||
this(map, TransformationMatrix.identity());
|
||||
}
|
||||
|
||||
public SimpleModelTransform(TransformationMatrix base)
|
||||
@@ -51,7 +51,7 @@ public final class SimpleModelTransform implements IModelTransform
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformationMatrix func_225615_b_()
|
||||
public TransformationMatrix getRotation()
|
||||
{
|
||||
return base;
|
||||
}
|
||||
@@ -59,6 +59,6 @@ public final class SimpleModelTransform implements IModelTransform
|
||||
@Override
|
||||
public TransformationMatrix getPartTransformation(Object part)
|
||||
{
|
||||
return map.getOrDefault(part, TransformationMatrix.func_227983_a_());
|
||||
return map.getOrDefault(part, TransformationMatrix.identity());
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -79,7 +79,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList
|
||||
return asm.apply(Animation.getWorldTime(world, Animation.getPartialTickTime())).getLeft();
|
||||
})
|
||||
// TODO where should uvlock data come from?
|
||||
.map(state -> model.func_225613_a_(bakery, bakedTextureGetter, new ModelTransformComposition(state, this.state), modelLoc))
|
||||
.map(state -> model.bakeModel(bakery, bakedTextureGetter, new ModelTransformComposition(state, this.state), modelLoc))
|
||||
.orElseGet(() -> super.getModelWithOverrides(originalModel, stack, world, entity));
|
||||
}
|
||||
}
|
||||
@@ -408,8 +408,8 @@ public class ModelBlockAnimation
|
||||
}
|
||||
Quaternion rot = new Quaternion(rotation_axis, rotation_angle, false);
|
||||
TransformationMatrix base = new TransformationMatrix(translation, rot, scale, null);
|
||||
Vector3f negOrigin = origin.func_229195_e_();
|
||||
negOrigin.func_229192_b_(-1,-1,-1);
|
||||
Vector3f negOrigin = origin.copy();
|
||||
negOrigin.mul(-1,-1,-1);
|
||||
base = new TransformationMatrix(origin, null, null, null).compose(base).compose(new TransformationMatrix(negOrigin, null, null, null));
|
||||
return base.blockCenterToCorner();
|
||||
}
|
||||
@@ -428,7 +428,7 @@ public class ModelBlockAnimation
|
||||
@Override
|
||||
public TransformationMatrix getInvBindPose()
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -537,8 +537,8 @@ public class ModelBlockAnimation
|
||||
if(!trOp.isIdentity())
|
||||
{
|
||||
float w = info.getWeights().get(i)[0];
|
||||
tmp = trOp.func_227988_c_();
|
||||
tmp.func_226592_a_(w);
|
||||
tmp = trOp.getMatrix();
|
||||
tmp.mul(w);
|
||||
m.add(tmp);
|
||||
weight += w;
|
||||
}
|
||||
@@ -546,7 +546,7 @@ public class ModelBlockAnimation
|
||||
}
|
||||
if(weight > 1e-5)
|
||||
{
|
||||
m.func_226592_a_(1f / weight);
|
||||
m.mul(1f / weight);
|
||||
return new TransformationMatrix(m);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ public class TileEntityRendererAnimation<T extends TileEntity> extends TileEntit
|
||||
protected static BlockRendererDispatcher blockRenderer;
|
||||
|
||||
@Override
|
||||
public void func_225616_a_(T te, float partialTick, MatrixStack mat, IRenderTypeBuffer renderer, int light, int otherlight)
|
||||
public void render(T te, float partialTick, MatrixStack mat, IRenderTypeBuffer renderer, int light, int otherlight)
|
||||
{
|
||||
LazyOptional<IAnimationStateMachine> cap = te.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY);
|
||||
if(!cap.isPresent())
|
||||
@@ -80,7 +80,7 @@ public class TileEntityRendererAnimation<T extends TileEntity> extends TileEntit
|
||||
|
||||
// TODO: caching?
|
||||
data.setData(Properties.AnimationProperty, pair.getLeft());
|
||||
blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, mat, renderer.getBuffer(Atlases.func_228782_g_()), false, new Random(), 42, light, data);
|
||||
blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, mat, renderer.getBuffer(Atlases.getSolidBlockType()), false, new Random(), 42, light, data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public enum B3DClip implements IClip
|
||||
@Override
|
||||
public TransformationMatrix apply(float time)
|
||||
{
|
||||
TransformationMatrix ret = TransformationMatrix.func_227983_a_();
|
||||
TransformationMatrix ret = TransformationMatrix.identity();
|
||||
if(node.getAnimation() == null)
|
||||
{
|
||||
return ret.compose(new TransformationMatrix(node.getPos(), node.getRot(), node.getScale(), null));
|
||||
|
||||
@@ -226,13 +226,13 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
|
||||
|
||||
@Override
|
||||
public TransformationMatrix func_225615_b_()
|
||||
public TransformationMatrix getRotation()
|
||||
{
|
||||
if(parent != null)
|
||||
{
|
||||
return parent.func_225615_b_();
|
||||
return parent.getRotation();
|
||||
}
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,7 +242,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
|
||||
if(!(part instanceof NodeJoint))
|
||||
{
|
||||
return TransformationMatrix.func_227983_a_();
|
||||
return TransformationMatrix.identity();
|
||||
}
|
||||
Node<?> node = ((NodeJoint)part).getNode();
|
||||
TransformationMatrix nodeTransform;
|
||||
@@ -290,7 +290,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
|
||||
public static TransformationMatrix getNodeMatrix(@Nullable Animation animation, Node<?> node, int frame)
|
||||
{
|
||||
TransformationMatrix ret = TransformationMatrix.func_227983_a_();
|
||||
TransformationMatrix ret = TransformationMatrix.identity();
|
||||
Key key = null;
|
||||
if(animation != null) key = animation.getKeys().get(frame, node);
|
||||
else if(node.getAnimation() != null) key = node.getAnimation().getKeys().get(frame, node);
|
||||
@@ -355,8 +355,8 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
@Override
|
||||
public TransformationMatrix getInvBindPose()
|
||||
{
|
||||
Matrix4f m = new TransformationMatrix(node.getPos(), node.getRot(), node.getScale(), null).func_227988_c_();
|
||||
m.func_226600_c_();
|
||||
Matrix4f m = new TransformationMatrix(node.getPos(), node.getRot(), node.getScale(), null).getMatrix();
|
||||
m.invert();
|
||||
TransformationMatrix pose = new TransformationMatrix(m);
|
||||
|
||||
if(node.getParent() != null)
|
||||
@@ -446,7 +446,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> func_225614_a_(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
|
||||
public Collection<Material> getTextures(Function<ResourceLocation, IUnbakedModel> p_225614_1_, Set<com.mojang.datafixers.util.Pair<String, String>> p_225614_2_)
|
||||
{
|
||||
return textures.values().stream().filter(loc -> !loc.startsWith("#"))
|
||||
.map(t -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(t)))
|
||||
@@ -461,7 +461,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBakedModel func_225613_a_(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
public IBakedModel bakeModel(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ResourceLocation modelLocation)
|
||||
{
|
||||
ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
|
||||
TextureAtlasSprite missing = spriteGetter.apply(new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, MissingTextureSprite.getLocation()));
|
||||
@@ -694,7 +694,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
Mesh mesh = (Mesh)node.getKind();
|
||||
Collection<Face> faces = mesh.bake(new Function<Node<?>, Matrix4f>()
|
||||
{
|
||||
private final TransformationMatrix global = state.func_225615_b_();
|
||||
private final TransformationMatrix global = state.getRotation();
|
||||
private final LoadingCache<Node<?>, TransformationMatrix> localCache = CacheBuilder.newBuilder()
|
||||
.maximumSize(32)
|
||||
.build(new CacheLoader<Node<?>, TransformationMatrix>()
|
||||
@@ -709,7 +709,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
@Override
|
||||
public Matrix4f apply(Node<?> node)
|
||||
{
|
||||
return global.compose(localCache.getUnchecked(node)).func_227988_c_();
|
||||
return global.compose(localCache.getUnchecked(node)).getMatrix();
|
||||
}
|
||||
});
|
||||
for(Face f : faces)
|
||||
@@ -735,7 +735,7 @@ public enum B3DLoader implements ISelectiveResourceReloadListener
|
||||
private final void putVertexData(IVertexConsumer consumer, Vertex v, Vector3f faceNormal, TextureAtlasSprite sprite)
|
||||
{
|
||||
// TODO handle everything not handled (texture transformations, bones, transformations, normals, e.t.c)
|
||||
ImmutableList<VertexFormatElement> vertexFormatElements = consumer.getVertexFormat().func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> vertexFormatElements = consumer.getVertexFormat().getElements();
|
||||
for(int e = 0; e < vertexFormatElements.size(); e++)
|
||||
{
|
||||
switch(vertexFormatElements.get(e).getUsage())
|
||||
|
||||
@@ -663,7 +663,7 @@ public class B3DModel
|
||||
Matrix4f t = new Matrix4f();
|
||||
if(mesh.getWeightMap().get(this).isEmpty())
|
||||
{
|
||||
t.func_226591_a_();
|
||||
t.setIdentity();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -671,11 +671,11 @@ public class B3DModel
|
||||
{
|
||||
totalWeight += bone.getLeft();
|
||||
Matrix4f bm = animator.apply(bone.getRight());
|
||||
bm.func_226592_a_(bone.getLeft());
|
||||
bm.mul(bone.getLeft());
|
||||
t.add(bm);
|
||||
}
|
||||
if(Math.abs(totalWeight) > 1e-4) t.func_226592_a_(1f / totalWeight);
|
||||
else t.func_226591_a_();
|
||||
if(Math.abs(totalWeight) > 1e-4) t.mul(1f / totalWeight);
|
||||
else t.setIdentity();
|
||||
}
|
||||
|
||||
TransformationMatrix trsr = new TransformationMatrix(t);
|
||||
@@ -684,7 +684,7 @@ public class B3DModel
|
||||
Vector4f pos = new Vector4f(this.pos);
|
||||
pos.setW(1);
|
||||
trsr.transformPosition(pos);
|
||||
pos.func_229374_e_();
|
||||
pos.normalize();
|
||||
Vector3f rPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
|
||||
|
||||
// normal
|
||||
@@ -692,7 +692,7 @@ public class B3DModel
|
||||
|
||||
if(this.normal != null)
|
||||
{
|
||||
rNormal = this.normal.func_229195_e_();
|
||||
rNormal = this.normal.copy();
|
||||
trsr.transformNormal(rNormal);
|
||||
}
|
||||
|
||||
@@ -784,13 +784,13 @@ public class B3DModel
|
||||
|
||||
public static Vector3f getNormal(Vertex v1, Vertex v2, Vertex v3)
|
||||
{
|
||||
Vector3f a = v2.getPos().func_229195_e_();
|
||||
Vector3f a = v2.getPos().copy();
|
||||
a.sub(v1.getPos());
|
||||
Vector3f b = v3.getPos().func_229195_e_();
|
||||
Vector3f b = v3.getPos().copy();
|
||||
b.sub(v1.getPos());
|
||||
Vector3f c = a.func_229195_e_();
|
||||
Vector3f c = a.copy();
|
||||
c.cross(b);
|
||||
c.func_229194_d_();
|
||||
c.normalize();
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,12 +350,12 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
|
||||
Vector3f a = positions.get(indices[0][0]);
|
||||
Vector3f ab = positions.get(indices[1][0]);
|
||||
Vector3f ac = positions.get(indices[2][0]);
|
||||
Vector3f abs = ab.func_229195_e_();
|
||||
Vector3f abs = ab.copy();
|
||||
abs.sub(a);
|
||||
Vector3f acs = ac.func_229195_e_();
|
||||
Vector3f acs = ac.copy();
|
||||
acs.sub(a);
|
||||
abs.cross(acs);
|
||||
abs.func_229194_d_();
|
||||
abs.normalize();
|
||||
faceNormal = abs;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
|
||||
Vector4f color = index.length >= 4 && colors.size() > 0 ? colors.get(index[3]) : COLOR_WHITE;
|
||||
if (hasTransform)
|
||||
{
|
||||
normal = norm0.func_229195_e_();
|
||||
normal = norm0.copy();
|
||||
transformation.transformPosition(position);
|
||||
transformation.transformNormal(normal);
|
||||
};
|
||||
@@ -463,7 +463,7 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
|
||||
|
||||
private void putVertexData(IVertexConsumer consumer, Vector4f position0, Vec2f texCoord0, Vector3f normal0, Vector4f color0, Vec2f uv2, TextureAtlasSprite texture)
|
||||
{
|
||||
ImmutableList<VertexFormatElement> elements = consumer.getVertexFormat().func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> elements = consumer.getVertexFormat().getElements();
|
||||
for(int j=0;j<elements.size();j++)
|
||||
{
|
||||
VertexFormatElement e = elements.get(j);
|
||||
@@ -533,7 +533,7 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
|
||||
|
||||
for (int[][] face : mesh.faces)
|
||||
{
|
||||
Pair<BakedQuad, Direction> quad = makeQuad(face, tintIndex, colorTint, mat.ambientColor, texture, modelTransform.func_225615_b_());
|
||||
Pair<BakedQuad, Direction> quad = makeQuad(face, tintIndex, colorTint, mat.ambientColor, texture, modelTransform.getRotation());
|
||||
if (quad.getRight() == null)
|
||||
modelBuilder.addGeneralQuad(quad.getLeft());
|
||||
else
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.minecraft.util.Direction;
|
||||
*/
|
||||
public class BakedQuadBuilder implements IVertexConsumer
|
||||
{
|
||||
private static final int SIZE = DefaultVertexFormats.BLOCK.func_227894_c_().size();
|
||||
private static final int SIZE = DefaultVertexFormats.BLOCK.getElements().size();
|
||||
|
||||
private final float[][][] unpackedData = new float[4][SIZE][4];
|
||||
private int tint = -1;
|
||||
@@ -134,7 +134,7 @@ public class BakedQuadBuilder implements IVertexConsumer
|
||||
float tS = tX > tY ? tX : tY;
|
||||
float ep = 1f / (tS * 0x100);
|
||||
int uve = 0;
|
||||
ImmutableList<VertexFormatElement> elements = DefaultVertexFormats.BLOCK.func_227894_c_();
|
||||
ImmutableList<VertexFormatElement> elements = DefaultVertexFormats.BLOCK.getElements();
|
||||
while(uve < elements.size())
|
||||
{
|
||||
VertexFormatElement e = elements.get(uve);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BlockInfo
|
||||
{
|
||||
if(cachedTint == tint) return cachedMultiplier;
|
||||
cachedTint = tint;
|
||||
cachedMultiplier = colors.func_228054_a_(state, world, blockPos, tint);
|
||||
cachedMultiplier = colors.getColor(state, world, blockPos, tint);
|
||||
return cachedMultiplier;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class BlockInfo
|
||||
int brightness = 0x00FF00FF; // FIXME: state.getPackedLightmapCoords(world, pos);
|
||||
s[x][y][z] = (brightness >> 0x14) & 0xF;
|
||||
b[x][y][z] = (brightness >> 0x04) & 0xF;
|
||||
ao[x][y][z] = state.func_215703_d(world, pos);
|
||||
ao[x][y][z] = state.getAmbientOcclusionLightValue(world, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,10 +139,10 @@ public class BlockInfo
|
||||
BlockPos pos = blockPos.offset(side);
|
||||
BlockState state = world.getBlockState(pos);
|
||||
|
||||
BlockState thisStateShape = this.state.isSolid() && this.state.func_215691_g() ? this.state : Blocks.AIR.getDefaultState();
|
||||
BlockState otherStateShape = state.isSolid() && state.func_215691_g() ? state : Blocks.AIR.getDefaultState();
|
||||
BlockState thisStateShape = this.state.isSolid() && this.state.isTransparent() ? this.state : Blocks.AIR.getDefaultState();
|
||||
BlockState otherStateShape = state.isSolid() && state.isTransparent() ? state : Blocks.AIR.getDefaultState();
|
||||
|
||||
if(state.getOpacity(world, blockPos) == 15 || VoxelShapes.func_223416_b(thisStateShape.func_215702_a(world, blockPos, side), otherStateShape.func_215702_a(world, pos, side.getOpposite())))
|
||||
if(state.getOpacity(world, blockPos) == 15 || VoxelShapes.faceShapeCovers(thisStateShape.getFaceOcclusionShape(world, blockPos, side), otherStateShape.getFaceOcclusionShape(world, pos, side.getOpposite())))
|
||||
{
|
||||
int x = side.getXOffset() + 1;
|
||||
int y = side.getYOffset() + 1;
|
||||
|
||||
@@ -24,8 +24,8 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
/**
|
||||
* Assumes that the data length is not less than e.func_227894_c_().size().
|
||||
* Also assumes that element index passed will increment from 0 to format.func_227894_c_().size() - 1.
|
||||
* Assumes that the data length is not less than e.getElements().size().
|
||||
* Also assumes that element index passed will increment from 0 to format.getElements().size() - 1.
|
||||
* Normal, Color and UV are assumed to be in 0-1 range.
|
||||
*/
|
||||
public interface IVertexConsumer
|
||||
|
||||
@@ -87,7 +87,7 @@ public class LightUtil
|
||||
|
||||
public static void putBakedQuad(IVertexConsumer consumer, BakedQuad quad)
|
||||
{
|
||||
consumer.setTexture(quad.getSprite());
|
||||
consumer.setTexture(quad.func_187508_a());
|
||||
consumer.setQuadOrientation(quad.getFace());
|
||||
if(quad.hasTintIndex())
|
||||
{
|
||||
@@ -97,8 +97,8 @@ public class LightUtil
|
||||
float[] data = new float[4];
|
||||
VertexFormat formatFrom = consumer.getVertexFormat();
|
||||
VertexFormat formatTo = DefaultVertexFormats.BLOCK;
|
||||
int countFrom = formatFrom.func_227894_c_().size();
|
||||
int countTo = formatTo.func_227894_c_().size();
|
||||
int countFrom = formatFrom.getElements().size();
|
||||
int countTo = formatTo.getElements().size();
|
||||
int[] eMap = mapFormats(formatFrom, formatTo);
|
||||
for(int v = 0; v < 4; v++)
|
||||
{
|
||||
@@ -131,17 +131,17 @@ public class LightUtil
|
||||
|
||||
private static int[] generateMapping(VertexFormat from, VertexFormat to)
|
||||
{
|
||||
int fromCount = from.func_227894_c_().size();
|
||||
int toCount = to.func_227894_c_().size();
|
||||
int fromCount = from.getElements().size();
|
||||
int toCount = to.getElements().size();
|
||||
int[] eMap = new int[fromCount];
|
||||
|
||||
for(int e = 0; e < fromCount; e++)
|
||||
{
|
||||
VertexFormatElement expected = from.func_227894_c_().get(e);
|
||||
VertexFormatElement expected = from.getElements().get(e);
|
||||
int e2;
|
||||
for(e2 = 0; e2 < toCount; e2++)
|
||||
{
|
||||
VertexFormatElement current = to.func_227894_c_().get(e2);
|
||||
VertexFormatElement current = to.getElements().get(e2);
|
||||
if(expected.getUsage() == current.getUsage() && expected.getIndex() == current.getIndex())
|
||||
{
|
||||
break;
|
||||
@@ -155,7 +155,7 @@ public class LightUtil
|
||||
public static void unpack(int[] from, float[] to, VertexFormat formatFrom, int v, int e)
|
||||
{
|
||||
int length = 4 < to.length ? 4 : to.length;
|
||||
VertexFormatElement element = formatFrom.func_227894_c_().get(e);
|
||||
VertexFormatElement element = formatFrom.getElements().get(e);
|
||||
int vertexStart = v * formatFrom.getSize() + formatFrom.getOffset(e);
|
||||
int count = element.getElementCount();
|
||||
VertexFormatElement.Type type = element.getType();
|
||||
@@ -210,7 +210,7 @@ public class LightUtil
|
||||
|
||||
public static void pack(float[] from, int[] to, VertexFormat formatTo, int v, int e)
|
||||
{
|
||||
VertexFormatElement element = formatTo.func_227894_c_().get(e);
|
||||
VertexFormatElement element = formatTo.getElements().get(e);
|
||||
int vertexStart = v * formatTo.getSize() + formatTo.getOffset(e);
|
||||
int count = element.getElementCount();
|
||||
VertexFormatElement.Type type = element.getType();
|
||||
@@ -319,7 +319,7 @@ public class LightUtil
|
||||
@Override
|
||||
public void put(int element, float... data)
|
||||
{
|
||||
if(getVertexFormat().func_227894_c_().get(element).getUsage() == VertexFormatElement.Usage.COLOR)
|
||||
if(getVertexFormat().getElements().get(element).getUsage() == VertexFormatElement.Usage.COLOR)
|
||||
{
|
||||
System.arraycopy(auxColor, 0, buf, 0, buf.length);
|
||||
int n = Math.min(4, data.length);
|
||||
@@ -333,7 +333,7 @@ public class LightUtil
|
||||
{
|
||||
super.put(element, data);
|
||||
}
|
||||
if(element == getVertexFormat().func_227894_c_().size() - 1)
|
||||
if(element == getVertexFormat().getElements().size() - 1)
|
||||
{
|
||||
vertices++;
|
||||
if(vertices == 4)
|
||||
|
||||
+3
-3
@@ -38,8 +38,8 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
|
||||
public void setVertexFormat(VertexFormat format)
|
||||
{
|
||||
this.format = format;
|
||||
dataLength = new byte[format.func_227894_c_().size()];
|
||||
quadData = new float[format.func_227894_c_().size()][4][4];
|
||||
dataLength = new byte[format.getElements().size()];
|
||||
quadData = new float[format.getElements().size()][4][4];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +56,7 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
|
||||
{
|
||||
dataLength[element] = (byte)data.length;
|
||||
}
|
||||
if (element == getVertexFormat().func_227894_c_().size() - 1)
|
||||
if (element == getVertexFormat().getElements().size() - 1)
|
||||
{
|
||||
vertices++;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TRSRTransformer extends VertexTransformer
|
||||
@Override
|
||||
public void put(int element, float... data)
|
||||
{
|
||||
switch (getVertexFormat().func_227894_c_().get(element).getUsage())
|
||||
switch (getVertexFormat().getElements().get(element).getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
Vector4f pos = new Vector4f(data[0], data[1], data[2], data[3]);
|
||||
|
||||
@@ -59,12 +59,12 @@ public class VertexBufferConsumer implements IVertexConsumer
|
||||
// TODO
|
||||
/*
|
||||
VertexFormat format = getVertexFormat();
|
||||
if(renderer.isColorDisabled() && format.func_227894_c_().get(e).getUsage() == Usage.COLOR)
|
||||
if(renderer.isColorDisabled() && format.getElements().get(e).getUsage() == Usage.COLOR)
|
||||
{
|
||||
data = dummyColor;
|
||||
}
|
||||
LightUtil.pack(data, quadData, format, v, e);
|
||||
if(e == format.func_227894_c_().size() - 1)
|
||||
if(e == format.getElements().size() - 1)
|
||||
{
|
||||
v++;
|
||||
if(v == 4)
|
||||
|
||||
@@ -66,9 +66,9 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
|
||||
private void updateIndices()
|
||||
{
|
||||
for(int i = 0; i < getVertexFormat().func_227894_c_().size(); i++)
|
||||
for(int i = 0; i < getVertexFormat().getElements().size(); i++)
|
||||
{
|
||||
switch(getVertexFormat().func_227894_c_().get(i).getUsage())
|
||||
switch(getVertexFormat().getElements().get(i).getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
posIndex = i;
|
||||
@@ -80,7 +80,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
colorIndex = i;
|
||||
break;
|
||||
case UV:
|
||||
if(getVertexFormat().func_227894_c_().get(i).getIndex() == 2)
|
||||
if(getVertexFormat().getElements().get(i).getIndex() == 2)
|
||||
{
|
||||
lightmapIndex = i;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
{
|
||||
if (format == null || format.hasNormal())
|
||||
return format;
|
||||
List<VertexFormatElement> l = Lists.newArrayList(format.func_227894_c_());
|
||||
List<VertexFormatElement> l = Lists.newArrayList(format.getElements());
|
||||
l.add(NORMAL_4F);
|
||||
return new VertexFormat(ImmutableList.copyOf(l));
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
t.set(position[0]);
|
||||
v2.sub(t);
|
||||
v2.cross(v1);
|
||||
v2.func_229194_d_();
|
||||
v2.normalize();
|
||||
for(int v = 0; v < 4; v++)
|
||||
{
|
||||
normal[v][0] = v2.getX();
|
||||
@@ -170,7 +170,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
}
|
||||
|
||||
VertexFormat format = parent.getVertexFormat();
|
||||
int count = format.func_227894_c_().size();
|
||||
int count = format.getElements().size();
|
||||
|
||||
for(int v = 0; v < 4; v++)
|
||||
{
|
||||
@@ -209,7 +209,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
// no need for remapping cause all we could've done is add 1 element to the end
|
||||
for(int e = 0; e < count; e++)
|
||||
{
|
||||
VertexFormatElement element = format.func_227894_c_().get(e);
|
||||
VertexFormatElement element = format.getElements().get(e);
|
||||
switch(element.getUsage())
|
||||
{
|
||||
case POSITION:
|
||||
|
||||
Reference in new issue
Block a user