Fix furnace recipe CCE (#651)

This commit is contained in:
IzzelAliz 2022-07-17 22:19:57 +08:00
parent e392826e44
commit da56932cf0
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338
2 changed files with 5 additions and 22 deletions

View File

@ -84,11 +84,11 @@ public abstract class AbstractFurnaceBlockEntityMixin extends LockableBlockEntit
boolean flag, boolean flag1, ItemStack stack, Recipe<?> recipe) {
if (recipe != null && furnace.cookingProgress == 0) {
CraftItemStack source = CraftItemStack.asCraftMirror(furnace.getItem(0));
CookingRecipe<?> cookingRecipe = (CookingRecipe<?>) ((IRecipeBridge) recipe).bridge$toBukkitRecipe();
FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(level, pos), source, cookingRecipe);
Bukkit.getPluginManager().callEvent(event);
furnace.cookingTotalTime = event.getTotalCookTime();
if (((IRecipeBridge) recipe).bridge$toBukkitRecipe() instanceof CookingRecipe<?> cookingRecipe) {
FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(level, pos), source, cookingRecipe);
Bukkit.getPluginManager().callEvent(event);
furnace.cookingTotalTime = event.getTotalCookTime();
}
}
}

View File

@ -28,7 +28,6 @@ import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.security.AccessControlContext;
import java.util.AbstractMap;
import java.util.ArrayList;
@ -235,22 +234,6 @@ public class ForgeInstaller {
List<String> ignores = new ArrayList<>();
List<String> merges = new ArrayList<>();
var self = new File(ForgeInstaller.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toPath();
// todo ugly McModLauncher/securejarhandler#19
if (self.getParent() != null && self.getParent().getParent() != null && self.getParent().getParent().getFileName() == null) {
var folder = self.resolveSibling(".arclight");
var relocation = folder.resolve("tmp.jar");
if (!Files.exists(folder)) {
Files.createDirectories(folder);
}
try {
if (!Files.isSymbolicLink(relocation)) {
Files.createSymbolicLink(relocation, self);
}
} catch (Exception e) {
Files.copy(self, relocation, StandardCopyOption.REPLACE_EXISTING);
}
self = relocation;
}
for (String arg : Files.lines(path).collect(Collectors.toList())) {
if (jvmArgs && arg.startsWith("-")) {
if (arg.startsWith("-p ")) {