mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 03:00:03 +03:00
72 lines
2.7 KiB
Diff
72 lines
2.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java
|
|
@@ -4,16 +4,19 @@
|
|
import java.util.List;
|
|
import net.minecraft.init.Items;
|
|
import net.minecraft.inventory.InventoryCrafting;
|
|
-import net.minecraft.item.EnumDyeColor;
|
|
import net.minecraft.item.ItemArmor;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.NonNullList;
|
|
import net.minecraft.world.World;
|
|
-import net.minecraftforge.fml.relauncher.Side;
|
|
-import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
-public class RecipesArmorDyes implements IRecipe
|
|
+public class RecipesArmorDyes extends ShapelessRecipes implements IRecipe
|
|
{
|
|
+ // CraftBukkit start - Delegate to new parent class with bogus info
|
|
+ public RecipesArmorDyes() {
|
|
+ super("", new ItemStack(Items.LEATHER_HELMET, 0, 0), NonNullList.from(Ingredient.EMPTY, Ingredient.fromItem(Items.DYE)));
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public boolean matches(InventoryCrafting inv, World worldIn)
|
|
{
|
|
ItemStack itemstack = ItemStack.EMPTY;
|
|
@@ -38,7 +41,7 @@
|
|
}
|
|
else
|
|
{
|
|
- if (itemstack1.getItem() != Items.DYE)
|
|
+ if (!net.minecraftforge.oredict.DyeUtils.isDye(itemstack1))
|
|
{
|
|
return false;
|
|
}
|
|
@@ -92,12 +95,12 @@
|
|
}
|
|
else
|
|
{
|
|
- if (itemstack1.getItem() != Items.DYE)
|
|
+ if (!net.minecraftforge.oredict.DyeUtils.isDye(itemstack1))
|
|
{
|
|
return ItemStack.EMPTY;
|
|
}
|
|
|
|
- float[] afloat = EnumDyeColor.byDyeDamage(itemstack1.getMetadata()).getColorComponentValues();
|
|
+ float[] afloat = net.minecraftforge.oredict.DyeUtils.colorFromStack(itemstack1).get().getColorComponentValues();
|
|
int l1 = (int)(afloat[0] * 255.0F);
|
|
int i2 = (int)(afloat[1] * 255.0F);
|
|
int j2 = (int)(afloat[2] * 255.0F);
|
|
@@ -143,11 +146,7 @@
|
|
for (int i = 0; i < nonnulllist.size(); ++i)
|
|
{
|
|
ItemStack itemstack = inv.getStackInSlot(i);
|
|
-
|
|
- if (itemstack.getItem().hasContainerItem())
|
|
- {
|
|
- nonnulllist.set(i, new ItemStack(itemstack.getItem().getContainerItem()));
|
|
- }
|
|
+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack));
|
|
}
|
|
|
|
return nonnulllist;
|
|
@@ -158,7 +157,6 @@
|
|
return true;
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
public boolean canFit(int width, int height)
|
|
{
|
|
return width * height >= 2;
|