Finished initial tag testing for altar recipes
This commit is contained in:
parent
9935197282
commit
37c6feeb6b
|
@ -5,6 +5,7 @@ import java.util.Set;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTBase;
|
import net.minecraft.nbt.NBTBase;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
|
||||||
public class AltarRecipe
|
public class AltarRecipe
|
||||||
{
|
{
|
||||||
|
@ -66,22 +67,42 @@ public class AltarRecipe
|
||||||
|
|
||||||
NBTTagCompound comparedTag = comparedStack.getTagCompound();
|
NBTTagCompound comparedTag = comparedStack.getTagCompound();
|
||||||
|
|
||||||
Set set = tag.func_150296_c();
|
return this.areTagsEqual(tag, comparedTag);
|
||||||
|
}
|
||||||
for(Object obj : set)
|
|
||||||
{
|
return true;
|
||||||
if(obj instanceof String)
|
}
|
||||||
{
|
|
||||||
String str = (String)obj;
|
protected boolean areTagsEqual(NBTTagCompound tag, NBTTagCompound comparedTag)
|
||||||
|
{
|
||||||
NBTBase baseTag = comparedTag.getTag(str);
|
Set set = tag.func_150296_c();
|
||||||
|
|
||||||
if(baseTag != null && !baseTag.equals(comparedTag.getTag(str)))
|
for(Object obj : set)
|
||||||
|
{
|
||||||
|
if(obj instanceof String)
|
||||||
|
{
|
||||||
|
String str = (String)obj;
|
||||||
|
|
||||||
|
NBTBase baseTag = comparedTag.getTag(str);
|
||||||
|
|
||||||
|
if(baseTag instanceof NBTTagCompound)
|
||||||
|
{
|
||||||
|
NBTBase comparedBaseTag = comparedTag.getTag(str);
|
||||||
|
if(comparedBaseTag instanceof NBTTagCompound)
|
||||||
|
{
|
||||||
|
if(!this.areTagsEqual((NBTTagCompound) tag, comparedTag))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
if(baseTag != null && !baseTag.equals(comparedTag.getTag(str)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -13,6 +13,11 @@ public class AltarRecipeRegistry
|
||||||
{
|
{
|
||||||
altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled));
|
altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void registerNBTAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled)
|
||||||
|
{
|
||||||
|
altarRecipes.add(new AltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled, true));
|
||||||
|
}
|
||||||
|
|
||||||
public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate)
|
public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue