Update to BCLib 0.3.0
This commit is contained in:
parent
1a52251af0
commit
b2431153dc
294 changed files with 7484 additions and 1440 deletions
|
@ -100,7 +100,10 @@ public final class ArmorRenderingRegistry {
|
|||
*/
|
||||
public static void registerSimpleTexture(ResourceLocation identifier, Item... items) {
|
||||
registerTexture((entity, stack, slot, secondLayer, suffix, defaultTexture) -> {
|
||||
return new ResourceLocation(identifier.getNamespace(), "textures/models/armor/" + identifier.getPath() + "_layer_" + (secondLayer ? 2 : 1) + (suffix == null ? "" : "_" + suffix) + ".png");
|
||||
return new ResourceLocation(
|
||||
identifier.getNamespace(),
|
||||
"textures/models/armor/" + identifier.getPath() + "_layer_" + (secondLayer ? 2 : 1) + (suffix == null ? "" : "_" + suffix) + ".png"
|
||||
);
|
||||
}, items);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,12 @@ public abstract class MixinArmorFeatureRenderer extends RenderLayer {
|
|||
ItemStack stack = storedEntity.getItemBySlot(slot);
|
||||
|
||||
HumanoidModel<LivingEntity> defaultModel = cir.getReturnValue();
|
||||
HumanoidModel<LivingEntity> model = ArmorRenderingRegistry.getArmorModel(storedEntity, stack, slot, defaultModel);
|
||||
HumanoidModel<LivingEntity> model = ArmorRenderingRegistry.getArmorModel(
|
||||
storedEntity,
|
||||
stack,
|
||||
slot,
|
||||
defaultModel
|
||||
);
|
||||
|
||||
if (model != defaultModel) {
|
||||
cir.setReturnValue(model);
|
||||
|
@ -98,7 +103,14 @@ public abstract class MixinArmorFeatureRenderer extends RenderLayer {
|
|||
|
||||
@Inject(method = "getArmorLocation", at = @At(value = "INVOKE", target = "Ljava/util/Map;computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void getArmorTexture(ArmorItem armorItem, boolean secondLayer, /* @Nullable */ String suffix, CallbackInfoReturnable<ResourceLocation> cir, String vanillaIdentifier) {
|
||||
String texture = ArmorRenderingRegistry.getArmorTexture(storedEntity, storedEntity.getItemBySlot(storedSlot), storedSlot, secondLayer, suffix, new ResourceLocation(vanillaIdentifier)).toString();
|
||||
String texture = ArmorRenderingRegistry.getArmorTexture(
|
||||
storedEntity,
|
||||
storedEntity.getItemBySlot(storedSlot),
|
||||
storedSlot,
|
||||
secondLayer,
|
||||
suffix,
|
||||
new ResourceLocation(vanillaIdentifier)
|
||||
).toString();
|
||||
|
||||
if (!Objects.equals(texture, vanillaIdentifier)) {
|
||||
cir.setReturnValue(ARMOR_LOCATION_CACHE.computeIfAbsent(texture, ResourceLocation::new));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue