mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Added the ability to add combustible items
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/world/inventory/AbstractFurnaceMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractFurnaceMenu.java
|
||||
@@ -121,7 +_,13 @@
|
||||
} else if (index != 1 && index != 0) {
|
||||
if (this.canSmelt(item)) {
|
||||
if (!this.moveItemStackTo(item, 0, 1, false)) {
|
||||
- return ItemStack.EMPTY;
|
||||
+ // Purpur start - Added the ability to add combustible items
|
||||
+ if (this.isFuel(item)) {
|
||||
+ if (!this.moveItemStackTo(item, 1, 2, false)) {
|
||||
+ return ItemStack.EMPTY;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Added the ability to add combustible items
|
||||
}
|
||||
} else if (this.isFuel(item)) {
|
||||
if (!this.moveItemStackTo(item, 1, 2, false)) {
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user