Skip to content

Commit

Permalink
Fix item setting
Browse files Browse the repository at this point in the history
  • Loading branch information
NomNuggetNom committed Dec 19, 2014
1 parent b02f1de commit 5a7b142
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/us/mcpvpmod/game/alerts/CustomAlert.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ public ResourceLocation setCustomImage(ResourceLocation resource) {
String imgName = resource.getResourcePath().replaceAll("textures/(.*)\\.png", "$1");

if (imgName.equals("flag")) {
return new ResourceLocation("mcpvp", ("textures/flag_" + Vars.get("team").replaceAll("\u00A7.", "").toLowerCase(Locale.ENGLISH) + "_" + Vars.get("action") + ".png").replaceAll(" ", "_"));
return new ResourceLocation("mcpvp",
("textures/flag_" +
Vars.get("team").replaceAll("\u00A7.", "").toLowerCase(Locale.ENGLISH) + "_" + Vars.get("action") + ".png")
.replaceAll(" ", "_"));
}
return resource;
}
Expand All @@ -160,7 +163,7 @@ public static ItemStack getItem(String name) {
} else if (GameData.getItemRegistry().containsKey(name)) {
return new ItemStack(GameData.getItemRegistry().getObject(name));
} else {
if (name.matches("(?i)(class|kit|character).*(.*icon)*"))
if (name.matches("(?i)(class|kit|character).*(icon)*"))
return AllKits.getIcon(Vars.get("kit"));
else if (name.matches("(?i)sab.*winner"))
return InfoSab.getWinnerIcon();
Expand Down Expand Up @@ -192,7 +195,7 @@ public void show() {
}

if (this.mode == Mode.ITEM) {
item = setCustomItem(item);
item = setCustomItem(getItem(this.template.split("\\s*\\|\\|\\|\\s*")[2]));
Alerts.alert.sendAlertWithItem(newTitle, newDesc, -1, item);
Main.l("Alert \"%s\" was shown (mode:item)", this);
} else if (this.mode == Mode.INTERNAL_IMAGE) {
Expand Down Expand Up @@ -257,7 +260,7 @@ public static Mode getMode(CustomAlert alert) {
//alert.image = CustomTexture.get(alert.id, alert.template.split("\\s*\\|\\|\\|\\s*")[2]);
return EXTERNAL_IMAGE;
} else {
alert.item = getItem(alert.template.split("\\s*\\|\\|\\|\\s*")[2]);
//alert.item = getItem(alert.template.split("\\s*\\|\\|\\|\\s*")[2]);
alert.image = null;
return ITEM;
}
Expand Down

0 comments on commit 5a7b142

Please sign in to comment.