Commit 05f7d78b authored by Ash's avatar Ash
Browse files

More refactoring of sprays

parent 91d7096d
......@@ -16,21 +16,27 @@ import java.io.File;
public class MapSpray extends Spray {
private static final StringProp IMAGE = Property.String(Scope.NONE, "Texture");
private static final StringProp MODEL = Property.String(Scope.NONE, "Model", null);
private static final StringProp IMAGE = Property.String(Scope.NONE, "Texture", null);
@Getter private final String imagePath;
@Getter private final SprayImage image;
@Getter private String imagePath;
@Getter private SprayImage image;
public MapSpray(SprayManager manager, Pack pack, File file, String key) {
super(manager, pack, file, key);
this.imagePath = MODEL.fget(file, this);
this.image = getSprayImage(imagePath);
this.imagePath = IMAGE.fget(file, this);
if(imagePath == null) {
imagePath = MODEL.fget(file, this);
}
if(this.imagePath == null) {
MCLogger.error(MCCLang.get("cosmetic.spray.error.no-image-specified", "No image specified for spray {0}", key));
return;
}
this.image = getSprayImage(imagePath);
if(this.image == null) {
MCLogger.error(MCCLang.get("cosmetic.spray.error.image-not-found", "Image {0} for spray {1} was not found", imagePath, key));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment