use of gg.moonflower.pollen.pinwheel.api.common.texture.GeometryModelTexture in project pollen by MoonflowerTeam.
the class GeometryTextureSpriteUploader method prepare.
@Override
protected TextureAtlas.Preparations prepare(ResourceManager resourceManager, ProfilerFiller profiler) {
try (OnlineRepository onlineRepository = new OnlineRepository(this.hashTables)) {
profiler.startTick();
profiler.push("stitching");
Stopwatch stopwatch = Stopwatch.createUnstarted();
this.beginStitch(System.currentTimeMillis(), stopwatch);
TextureAtlas.Preparations sheetData = this.textureAtlas.prepareToStitch(new OnlineResourceManager(resourceManager, onlineRepository, this.textures.stream().filter(texture -> texture.getType() == GeometryModelTexture.Type.ONLINE).collect(Collectors.toSet())), this.textures.stream().filter(texture -> texture.getType() == GeometryModelTexture.Type.LOCATION || texture.getType() == GeometryModelTexture.Type.ONLINE).map(GeometryModelTexture::getLocation).distinct(), profiler, Minecraft.getInstance().options.mipmapLevels);
this.endStitch(stopwatch);
profiler.pop();
profiler.endTick();
return sheetData;
}
}
use of gg.moonflower.pollen.pinwheel.api.common.texture.GeometryModelTexture in project pollen by MoonflowerTeam.
the class DeveloperHalo method registerTextures.
@Override
public void registerTextures(BiConsumer<ResourceLocation, GeometryModelTextureTable> textureConsumer) {
this.halos.forEach((key, value) -> {
textureConsumer.accept(new ResourceLocation(Pollen.MOD_ID, key), value.getTextureTable());
textureConsumer.accept(new ResourceLocation(Pollen.MOD_ID, key + "_emissive"), new GeometryModelTextureTable(value.getTextureTable().getTextureDefinitions().entrySet().stream().collect(Collectors.<Map.Entry<String, GeometryModelTexture[]>, String, GeometryModelTexture[]>toMap(Map.Entry::getKey, entry -> {
GeometryModelTexture[] textures = new GeometryModelTexture[entry.getValue().length];
for (int i = 0; i < textures.length; i++) {
GeometryModelTexture texture = entry.getValue()[i];
textures[i] = GeometryModelTexture.texture(texture).setGlowing(true).build();
}
return textures;
}))));
});
}
use of gg.moonflower.pollen.pinwheel.api.common.texture.GeometryModelTexture in project pollen by MoonflowerTeam.
the class Halo method registerTextures.
@Override
public void registerTextures(BiConsumer<ResourceLocation, GeometryModelTextureTable> textureConsumer) {
textureConsumer.accept(this.getRegistryName(), this.data.getTextureTable());
textureConsumer.accept(new ResourceLocation(this.getRegistryName().getNamespace(), this.getRegistryName().getPath() + "_emissive"), new GeometryModelTextureTable(this.data.getTextureTable().getTextureDefinitions().entrySet().stream().collect(Collectors.<Map.Entry<String, GeometryModelTexture[]>, String, GeometryModelTexture[]>toMap(Map.Entry::getKey, entry -> {
GeometryModelTexture[] textures = new GeometryModelTexture[entry.getValue().length];
for (int i = 0; i < textures.length; i++) {
GeometryModelTexture texture = entry.getValue()[i];
textures[i] = GeometryModelTexture.texture(texture).setGlowing(true).build();
}
return textures;
}))));
}
Aggregations