mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:46:12 +03:00
56 lines
2.4 KiB
Diff
56 lines
2.4 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java
|
|
@@ -16,15 +16,18 @@
|
|
public class FurnaceRecipes
|
|
{
|
|
private static final FurnaceRecipes SMELTING_BASE = new FurnaceRecipes();
|
|
- private final Map<ItemStack, ItemStack> smeltingList = Maps.<ItemStack, ItemStack>newHashMap();
|
|
+ public Map<ItemStack, ItemStack> smeltingList = Maps.<ItemStack, ItemStack>newHashMap(); //CB - final -> non-final
|
|
private final Map<ItemStack, Float> experienceList = Maps.<ItemStack, Float>newHashMap();
|
|
+ public Map<ItemStack,ItemStack> customRecipes = Maps.newHashMap(); // CraftBukkit - add field
|
|
+ public int customRecipesSize = 0;
|
|
+ public Map<ItemStack,Float> customExperience = Maps.newHashMap(); // CraftBukkit - add field
|
|
|
|
public static FurnaceRecipes instance()
|
|
{
|
|
return SMELTING_BASE;
|
|
}
|
|
|
|
- private FurnaceRecipes()
|
|
+ public FurnaceRecipes()
|
|
{
|
|
this.addSmeltingRecipeForBlock(Blocks.IRON_ORE, new ItemStack(Items.IRON_INGOT), 0.7F);
|
|
this.addSmeltingRecipeForBlock(Blocks.GOLD_ORE, new ItemStack(Items.GOLD_INGOT), 1.0F);
|
|
@@ -61,6 +64,13 @@
|
|
this.addSmeltingRecipeForBlock(Blocks.LAPIS_ORE, new ItemStack(Items.DYE, 1, EnumDyeColor.BLUE.getDyeDamage()), 0.2F);
|
|
this.addSmeltingRecipeForBlock(Blocks.QUARTZ_ORE, new ItemStack(Items.QUARTZ), 0.2F);
|
|
}
|
|
+
|
|
+ // CraftBukkit start - add method
|
|
+ public void registerRecipe(ItemStack itemstack, ItemStack itemstack1, float f) {
|
|
+ this.customRecipes.put(itemstack, itemstack1);
|
|
+ customRecipesSize++;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
|
|
public void addSmeltingRecipeForBlock(Block input, ItemStack stack, float experience)
|
|
{
|
|
@@ -82,6 +92,17 @@
|
|
@Nullable
|
|
public ItemStack getSmeltingResult(ItemStack stack)
|
|
{
|
|
+ // CB start
|
|
+ if(customRecipesSize > 0)
|
|
+ for (Entry<ItemStack, ItemStack> entry : this.customRecipes.entrySet())
|
|
+ {
|
|
+ if (this.compareItemStacks(stack, (ItemStack)entry.getKey()))
|
|
+ {
|
|
+ return (ItemStack)entry.getValue();
|
|
+ }
|
|
+ }
|
|
+ // CB end
|
|
+
|
|
for (Entry<ItemStack, ItemStack> entry : this.smeltingList.entrySet())
|
|
{
|
|
if (this.compareItemStacks(stack, (ItemStack)entry.getKey()))
|