Added the ability to add combustible items

This commit is contained in:
DoctaEnkoda
2025-01-12 12:40:23 -08:00
committed by granny
parent aedc9f8985
commit 2ecfc259c4
7 changed files with 81 additions and 127 deletions

View File

@@ -24,6 +24,29 @@
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1645,6 +_,22 @@
return true;
}
+ // Purpur start - Added the ability to add combustible items
+ @Override
+ public void addFuel(org.bukkit.Material material, int burnTime) {
+ Preconditions.checkArgument(burnTime > 0, "BurnTime must be greater than 0");
+
+ net.minecraft.world.item.ItemStack itemStack = net.minecraft.world.item.ItemStack.fromBukkitCopy(new ItemStack(material));
+ MinecraftServer.getServer().fuelValues().values.put(itemStack.getItem(), burnTime);
+ }
+
+ @Override
+ public void removeFuel(org.bukkit.Material material) {
+ net.minecraft.world.item.ItemStack itemStack = net.minecraft.world.item.ItemStack.fromBukkitCopy(new ItemStack(material));
+ MinecraftServer.getServer().fuelValues().values.keySet().removeIf(itemStack::is);
+ }
+ // Purpur end - Added the ability to add combustible items
+
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
@@ -3049,6 +_,18 @@
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}