mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:00:02 +03:00
77 lines
3.1 KiB
Diff
77 lines
3.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/crafting/RecipeFireworks.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java
|
|
@@ -10,13 +10,17 @@
|
|
import net.minecraft.nbt.NBTTagList;
|
|
import net.minecraft.util.NonNullList;
|
|
import net.minecraft.world.World;
|
|
-import net.minecraftforge.fml.relauncher.Side;
|
|
-import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
-public class RecipeFireworks implements IRecipe
|
|
+public class RecipeFireworks extends ShapelessRecipes implements IRecipe
|
|
{
|
|
private ItemStack resultItem = ItemStack.EMPTY;
|
|
|
|
+ // CraftBukkit start - Delegate to new parent class with bogus info
|
|
+ public RecipeFireworks() {
|
|
+ super("", new ItemStack(Items.FIREWORKS, 0, 0), NonNullList.from(Ingredient.EMPTY, Ingredient.fromItem(Items.GUNPOWDER)));
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public boolean matches(InventoryCrafting inv, World worldIn)
|
|
{
|
|
this.resultItem = ItemStack.EMPTY;
|
|
@@ -41,7 +45,7 @@
|
|
{
|
|
++l;
|
|
}
|
|
- else if (itemstack.getItem() == Items.DYE)
|
|
+ else if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack))
|
|
{
|
|
++k;
|
|
}
|
|
@@ -127,9 +131,9 @@
|
|
|
|
if (!itemstack2.isEmpty())
|
|
{
|
|
- if (itemstack2.getItem() == Items.DYE)
|
|
+ if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack2))
|
|
{
|
|
- list.add(Integer.valueOf(ItemDye.DYE_COLORS[itemstack2.getMetadata() & 15]));
|
|
+ list.add(Integer.valueOf(ItemDye.DYE_COLORS[net.minecraftforge.oredict.DyeUtils.rawDyeDamageFromStack(itemstack2) & 15]));
|
|
}
|
|
else if (itemstack2.getItem() == Items.GLOWSTONE_DUST)
|
|
{
|
|
@@ -181,9 +185,9 @@
|
|
|
|
if (!itemstack1.isEmpty())
|
|
{
|
|
- if (itemstack1.getItem() == Items.DYE)
|
|
+ if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack1))
|
|
{
|
|
- list1.add(Integer.valueOf(ItemDye.DYE_COLORS[itemstack1.getMetadata() & 15]));
|
|
+ list1.add(Integer.valueOf(ItemDye.DYE_COLORS[net.minecraftforge.oredict.DyeUtils.rawDyeDamageFromStack(itemstack1) & 15]));
|
|
}
|
|
else if (itemstack1.getItem() == Items.FIREWORK_CHARGE)
|
|
{
|
|
@@ -248,10 +252,7 @@
|
|
{
|
|
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;
|
|
@@ -262,7 +263,6 @@
|
|
return true;
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
public boolean canFit(int width, int height)
|
|
{
|
|
return width * height >= 1;
|