Skip to content

Commit

Permalink
[2.0.0-dev8]与v1分支同步
Browse files Browse the repository at this point in the history
  • Loading branch information
YufiriaMazenta committed Jan 14, 2024
1 parent 925ec65 commit b6b59ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import java.text.SimpleDateFormat
version = "2.0.0-dev7"
version = "2.0.0-dev8"

plugins {
`java-library`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void onPrepareAnvil(PrepareAnvilEvent event) {
if (!conditionResult) {
event.getInventory().setRepairCost(0);
event.setResult(null);
event.getInventory().setItem(2, null);
return;
}
}
Expand All @@ -66,6 +67,7 @@ public void onPrepareAnvil(PrepareAnvilEvent event) {
}
event.getInventory().setRepairCost(anvilRecipe.costLevel());
event.setResult(result);
event.getInventory().setItem(2, result);
}

@EventHandler(priority = EventPriority.MONITOR)
Expand Down Expand Up @@ -180,6 +182,7 @@ public void onClickAnvil(InventoryClickEvent event) {
AnvilRecipe afterClickRecipe = RecipeManager.INSTANCE.matchAnvilRecipe(base, addition);
if (afterClickRecipe == null) {
anvilInventory.setItem(2, null);
anvilInventory.setRepairCost(0);
return;
}
anvilInventory.setItem(2, afterClickRecipe.getResult());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void onPrepareSmith(PrepareSmithingEvent event) {
condition = "if " + condition;
boolean result = (boolean) ArcencielDispatcher.INSTANCE.dispatchArcencielBlock(player, condition).obj();
if (!result) {
event.setResult(null);
event.getInventory().setResult(null);
}
}
Expand All @@ -62,8 +63,10 @@ public void onSmithItem(SmithItemEvent event) {
public void checkCannotCraftLore(PrepareSmithingEvent event) {
ItemStack[] items = event.getInventory().getContents();
boolean containsLore = ItemUtils.hasCannotCraftLore(items);
if (containsLore)
if (containsLore) {
event.getInventory().setResult(null);
event.setResult(null);
}
}

}

0 comments on commit b6b59ef

Please sign in to comment.