com.parzivail.p3d.P3dUnbakedBlockModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pswg Show documentation
Show all versions of pswg Show documentation
Explore the galaxy with Galaxies: Parzi's Star Wars Mod!
package com.parzivail.p3d;
import com.mojang.datafixers.util.Pair;
import com.parzivail.util.client.model.BaseUnbakedBlockModel;
import com.parzivail.util.client.model.ClonableUnbakedModel;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
import java.util.function.Function;
import net.minecraft.class_1100;
import net.minecraft.class_1723;
import net.minecraft.class_2960;
import net.minecraft.class_4730;
public class P3dUnbakedBlockModel extends BaseUnbakedBlockModel
{
private final HashMap additionalTextures = new HashMap<>();
public P3dUnbakedBlockModel(class_2960 baseTexture, class_2960 particleTexture, BakerFunction, P3dBakedBlockModel> baker)
{
super(baseTexture, particleTexture, baker);
}
public P3dUnbakedBlockModel withTexture(String id, class_2960 texture)
{
this.additionalTextures.put(id, texture);
return this;
}
public P3dUnbakedBlockModel withTextures(HashMap textures)
{
this.additionalTextures.putAll(textures);
return this;
}
@Override
public Collection getTextureDependencies(Function function, Set> errors)
{
var ids = super.getTextureDependencies(function, errors);
for (var texture : additionalTextures.values())
ids.add(new class_4730(class_1723.field_21668, texture));
return ids;
}
@Override
public ClonableUnbakedModel copy()
{
return new P3dUnbakedBlockModel(baseTexture, particleTexture, baker)
.withTextures(additionalTextures);
}
public HashMap getAdditionalTextures()
{
return additionalTextures;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy