- 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) {
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user