第65批修复3:去皮Material名修复
Auto Release / build (push) Successful in 2m13s

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