mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-20 20:11:19 +01:00
Fix error in short item code generation logic (Fixes #395)
This commit is contained in:
parent
66eaab7c4d
commit
71e8ef732f
@ -64,10 +64,10 @@ public class ItemUtil {
|
|||||||
int colonIndex = code.indexOf(':');
|
int colonIndex = code.indexOf(':');
|
||||||
String material = code;
|
String material = code;
|
||||||
String rest = "";
|
String rest = "";
|
||||||
if (poundIndex > 0 && poundIndex < colonIndex) {
|
if (poundIndex > 0 && (colonIndex < 0 || poundIndex < colonIndex)) {
|
||||||
material = code.substring(0, poundIndex);
|
material = code.substring(0, poundIndex);
|
||||||
rest = code.substring(poundIndex);
|
rest = code.substring(poundIndex);
|
||||||
} else if (colonIndex > 0 && colonIndex < poundIndex) {
|
} else if (colonIndex > 0 && (poundIndex < 0 || colonIndex < poundIndex)) {
|
||||||
material = code.substring(0, colonIndex);
|
material = code.substring(0, colonIndex);
|
||||||
rest = code.substring(colonIndex);
|
rest = code.substring(colonIndex);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user