- replace("_LOG","_STRIPPED_LOG") 产生 OAK_STRIPPED_LOG(错误)
- 改为前缀拼接 STRIPPED_ + btName → STRIPPED_OAK_LOG(正确)
- 增加 _STEM 木头类型支持(深色橡木茎等)
- 结构对齐锄地逻辑:Material变量统一 + END_WITH判断
This commit is contained in:
@@ -3948,10 +3948,11 @@ public class Main extends JavaPlugin
|
||||
}
|
||||
// 主手斧头 + 副手盾 → 去皮
|
||||
if (handIsAxe) {
|
||||
String typeName = clicked.getType().name();
|
||||
if (typeName.endsWith("_LOG")) {
|
||||
Material bt = clicked.getType();
|
||||
String btName = bt.name();
|
||||
if (btName.endsWith("_LOG") || btName.endsWith("_STEM")) {
|
||||
e.setCancelled(true);
|
||||
String strippedName = typeName.replace("_LOG", "_STRIPPED_LOG");
|
||||
String strippedName = "STRIPPED_" + btName;
|
||||
Material strippedMat = Material.getMaterial(strippedName);
|
||||
if (strippedMat != null) {
|
||||
clicked.setType(strippedMat);
|
||||
|
||||
Reference in New Issue
Block a user