|
1 | 1 | package me.EtienneDx.RealEstate; |
2 | 2 |
|
3 | 3 | import java.util.regex.Matcher; |
4 | | -import java.util.regex.Pattern; |
5 | 4 |
|
6 | 5 | import org.bukkit.command.CommandSender; |
7 | 6 | import org.bukkit.plugin.PluginDescriptionFile; |
@@ -353,10 +352,10 @@ public class Messages extends AnnotationConfig |
353 | 352 | public String msgInfoClaimInfoRentHeader = "$9-----= $f[$6RealEstate Rent Info$f]$9 =-----"; |
354 | 353 |
|
355 | 354 | @ConfigField(name="RealEstate.Info.Claim.Info.Rent.GeneralNoBuyer", comment = "0: claim type, 1: formatted price, 2: duration") |
356 | | - public String msgInfoClaimInfoGeneralRentNoBuyer = "$bThis {0} is for rent for $a{1}$b per $a{2}."; |
| 355 | + public String msgInfoClaimInfoGeneralRentNoBuyer = "$bThis {0} is for rent for $a{1}$b per $a{2}$b."; |
357 | 356 |
|
358 | 357 | @ConfigField(name="RealEstate.Info.Claim.Info.Rent.GeneralBuyer", comment = "0: claim type, 1: buyer name, 2: formatted price, 3: time left in current period, 4: duration of a period") |
359 | | - public String msgInfoClaimInfoGeneralRentBuyer = "$bThis {0} is currently rented by $a{1}$b for $a{2}$b. The {0} is rented until $a{3}$b. The rent period is $a{4}"; |
| 358 | + public String msgInfoClaimInfoGeneralRentBuyer = "$bThis {0} is currently rented by $a{1}$b for $a{2}$b. The {0} is rented for another $a{3}$b. The rent period is $a{4}"; |
360 | 359 |
|
361 | 360 | @ConfigField(name="RealEstate.Info.Claim.Info.Rent.MaxPeriod", comment = "0: max periods") |
362 | 361 | public String msgInfoClaimInfoRentMaxPeriod = "$bIt can be rented for a maximum of $a{0}$b periods."; |
@@ -449,11 +448,10 @@ public static String getMessage(String msgTemplate, boolean withPrefix, String.. |
449 | 448 | } |
450 | 449 |
|
451 | 450 | msgTemplate = msgTemplate.replace('$', ChatColor.COLOR_CHAR); |
452 | | - |
| 451 | + |
453 | 452 | for (int i = 0; i < args.length; i++) { |
454 | 453 | String param = args[i]; |
455 | | - Matcher matcher = Pattern.compile("\\{" + i + "\\}").matcher(msgTemplate); |
456 | | - msgTemplate = matcher.replaceAll(Matcher.quoteReplacement(param)); |
| 454 | + msgTemplate = msgTemplate.replaceAll("\\{" + i + "\\}", Matcher.quoteReplacement(param)); |
457 | 455 | } |
458 | 456 |
|
459 | 457 | return msgTemplate; |
|
0 commit comments