mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 19:25:23 -05:00
Use identifier path composition methods (#3820)
This commit is contained in:
parent
18dd60fee4
commit
d1321076fe
3 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,7 @@ public class EntityModelLayersMixin {
|
|||
private static void createSign(WoodType type, CallbackInfoReturnable<EntityModelLayer> cir) {
|
||||
if (type.name().indexOf(Identifier.NAMESPACE_SEPARATOR) != -1) {
|
||||
Identifier identifier = Identifier.of(type.name());
|
||||
cir.setReturnValue(new EntityModelLayer(Identifier.of(identifier.getNamespace(), "sign/" + identifier.getPath()), "main"));
|
||||
cir.setReturnValue(new EntityModelLayer(identifier.withPrefixedPath("sign/"), "main"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class EntityModelLayersMixin {
|
|||
private static void createHangingSign(WoodType type, CallbackInfoReturnable<EntityModelLayer> cir) {
|
||||
if (type.name().indexOf(Identifier.NAMESPACE_SEPARATOR) != -1) {
|
||||
Identifier identifier = Identifier.of(type.name());
|
||||
cir.setReturnValue(new EntityModelLayer(Identifier.of(identifier.getNamespace(), "hanging_sign/" + identifier.getPath()), "main"));
|
||||
cir.setReturnValue(new EntityModelLayer(identifier.withPrefixedPath("hanging_sign/"), "main"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public abstract class HangingSignEditScreenMixin extends AbstractSignEditScreen
|
|||
private Identifier init(String id, Operation<Identifier> original) {
|
||||
if (signType.name().indexOf(Identifier.NAMESPACE_SEPARATOR) != -1) {
|
||||
Identifier identifier = Identifier.of(signType.name());
|
||||
return Identifier.of(identifier.getNamespace(), "textures/gui/hanging_signs/" + identifier.getPath() + ".png");
|
||||
return identifier.withPath(path -> "textures/gui/hanging_signs/" + path + ".png");
|
||||
}
|
||||
|
||||
return original.call(id);
|
||||
|
|
|
@ -40,6 +40,6 @@ public final class FabricShaderProgram extends ShaderProgram {
|
|||
*/
|
||||
public static Identifier rewriteAsId(String input, String containedId) {
|
||||
Identifier contained = Identifier.of(containedId);
|
||||
return Identifier.of(contained.getNamespace(), input.replace(containedId, contained.getPath()));
|
||||
return contained.withPath(path -> input.replace(containedId, path));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue