Run migration mappings
Everything is still broken, but at least we reduced the amount of errors by hundreds, if not thousands.
This commit is contained in:
parent
1caae69992
commit
4035d91151
484 changed files with 4924 additions and 4962 deletions
|
@ -2,11 +2,11 @@ package WayofTime.bloodmagic.recipe.alchemyTable;
|
|||
|
||||
import WayofTime.bloodmagic.util.Constants;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemBanner;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.BannerItem;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
@ -65,16 +65,16 @@ public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe {
|
|||
|
||||
if (tagOrDyeStack.getItem() == Items.NAME_TAG) {
|
||||
if (!outputStack.hasTagCompound()) {
|
||||
outputStack.setTagCompound(new NBTTagCompound());
|
||||
outputStack.setTagCompound(new CompoundNBT());
|
||||
}
|
||||
|
||||
outputStack.getTagCompound().setString(Constants.NBT.COLOR, tagOrDyeStack.getDisplayName());
|
||||
|
||||
return outputStack;
|
||||
} else {
|
||||
EnumDyeColor dyeColor = ItemBanner.getBaseColor(tagOrDyeStack);
|
||||
DyeColor dyeColor = BannerItem.getBaseColor(tagOrDyeStack);
|
||||
if (!outputStack.hasTagCompound()) {
|
||||
outputStack.setTagCompound(new NBTTagCompound());
|
||||
outputStack.setTagCompound(new CompoundNBT());
|
||||
}
|
||||
|
||||
outputStack.getTagCompound().setString(Constants.NBT.COLOR, String.valueOf(Utils.DYE_COLOR_VALUES.getOrDefault(dyeColor, 0)));
|
||||
|
|
|
@ -3,8 +3,8 @@ package WayofTime.bloodmagic.recipe.alchemyTable;
|
|||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.potion.BMPotionUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.PotionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -14,9 +14,9 @@ import java.util.List;
|
|||
public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe {
|
||||
protected double lengthAugment = 0;
|
||||
protected int powerAugment = 0;
|
||||
protected Potion wantedPotion;
|
||||
protected Effect wantedPotion;
|
||||
|
||||
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, PotionEffect baseEffect, double lengthAugment, int powerAugment) {
|
||||
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, EffectInstance baseEffect, double lengthAugment, int powerAugment) {
|
||||
super(lpDrained, ticksRequired, tierRequired, inputItems, baseEffect);
|
||||
|
||||
ArrayList<Object> recipe = new ArrayList<>();
|
||||
|
@ -30,14 +30,14 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe {
|
|||
this.powerAugment = powerAugment;
|
||||
}
|
||||
|
||||
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, double lengthAugment, int powerAugment) {
|
||||
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, EffectInstance baseEffect, double lengthAugment, int powerAugment) {
|
||||
this(lpDrained, ticksRequired, tierRequired, Collections.singletonList(inputItem), baseEffect, lengthAugment, powerAugment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPotionFlaskValidInput(ItemStack stack) {
|
||||
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(stack);
|
||||
for (PotionEffect eff : effectList) {
|
||||
List<EffectInstance> effectList = PotionUtils.getEffectsFromStack(stack);
|
||||
for (EffectInstance eff : effectList) {
|
||||
if (eff.getPotion() == wantedPotion) {
|
||||
double currentAugment = BMPotionUtils.getLengthAugment(stack, wantedPotion);
|
||||
|
||||
|
@ -53,9 +53,9 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe {
|
|||
if (inputStack.isEmpty()) {
|
||||
ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK);
|
||||
|
||||
List<PotionEffect> effectList = new ArrayList<>();
|
||||
List<EffectInstance> effectList = new ArrayList<>();
|
||||
int potionLength = wantedPotion.isInstant() ? 1 : BMPotionUtils.getAugmentedLength(baseEffect.getDuration(), lengthAugment, powerAugment - baseEffect.getAmplifier());
|
||||
effectList.add(new PotionEffect(wantedPotion, potionLength, powerAugment - baseEffect.getAmplifier()));
|
||||
effectList.add(new EffectInstance(wantedPotion, potionLength, powerAugment - baseEffect.getAmplifier()));
|
||||
|
||||
BMPotionUtils.setEffects(outputStack, effectList);
|
||||
|
||||
|
@ -64,15 +64,15 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe {
|
|||
|
||||
ItemStack outputStack = inputStack.copy();
|
||||
|
||||
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(outputStack);
|
||||
List<PotionEffect> newEffectList = new ArrayList<>();
|
||||
List<EffectInstance> effectList = PotionUtils.getEffectsFromStack(outputStack);
|
||||
List<EffectInstance> newEffectList = new ArrayList<>();
|
||||
|
||||
for (PotionEffect effect : effectList) {
|
||||
for (EffectInstance effect : effectList) {
|
||||
if (effect.getPotion() == wantedPotion) {
|
||||
double currentLengthAugment = Math.max(lengthAugment, BMPotionUtils.getLengthAugment(outputStack, wantedPotion));
|
||||
int currentPowerAugment = Math.max(powerAugment, effect.getAmplifier());
|
||||
int potionLength = wantedPotion.isInstant() ? 1 : BMPotionUtils.getAugmentedLength(baseEffect.getDuration(), currentLengthAugment, currentPowerAugment);
|
||||
newEffectList.add(new PotionEffect(wantedPotion, potionLength, currentPowerAugment));
|
||||
newEffectList.add(new EffectInstance(wantedPotion, potionLength, currentPowerAugment));
|
||||
BMPotionUtils.setLengthAugment(outputStack, wantedPotion, currentLengthAugment);
|
||||
} else {
|
||||
newEffectList.add(effect);
|
||||
|
@ -84,10 +84,10 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe {
|
|||
return outputStack;
|
||||
}
|
||||
|
||||
public static ItemStack getAugmentedPotionFlask(PotionEffect baseEffect) {
|
||||
public static ItemStack getAugmentedPotionFlask(EffectInstance baseEffect) {
|
||||
ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK);
|
||||
|
||||
List<PotionEffect> effectList = new ArrayList<>();
|
||||
List<EffectInstance> effectList = new ArrayList<>();
|
||||
effectList.add(baseEffect);
|
||||
|
||||
BMPotionUtils.setEffects(outputStack, effectList);
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.bloodmagic.recipe.alchemyTable;
|
|||
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.PotionUtils;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -16,10 +16,10 @@ import java.util.List;
|
|||
public class AlchemyTablePotionRecipe extends AlchemyTableRecipe {
|
||||
public static final ItemStack basePotionFlaskStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK, 1, OreDictionary.WILDCARD_VALUE);
|
||||
public static final int temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember = 3;
|
||||
protected PotionEffect baseEffect;
|
||||
protected EffectInstance baseEffect;
|
||||
protected double baseAddedImpurity = 5;
|
||||
|
||||
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, PotionEffect baseEffect) {
|
||||
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, List<ItemStack> inputItems, EffectInstance baseEffect) {
|
||||
super(basePotionFlaskStack, lpDrained, ticksRequired, tierRequired);
|
||||
|
||||
ArrayList<Object> recipe = new ArrayList<>();
|
||||
|
@ -30,7 +30,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe {
|
|||
this.baseEffect = baseEffect;
|
||||
}
|
||||
|
||||
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect) {
|
||||
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, EffectInstance baseEffect) {
|
||||
this(lpDrained, ticksRequired, tierRequired, Collections.singletonList(inputItem), baseEffect);
|
||||
}
|
||||
|
||||
|
@ -101,12 +101,12 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe {
|
|||
}
|
||||
|
||||
public boolean isPotionFlaskValidInput(ItemStack stack) {
|
||||
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(stack);
|
||||
List<EffectInstance> effectList = PotionUtils.getEffectsFromStack(stack);
|
||||
if (effectList.size() >= temporaryMaximumEffectsOnThePotionFlaskYesThisIsALongFieldItIsJustSoIRemember) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (PotionEffect eff : effectList) {
|
||||
for (EffectInstance eff : effectList) {
|
||||
if (eff.getPotion() == baseEffect.getPotion()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe {
|
|||
if (inputStack.isEmpty()) {
|
||||
ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK);
|
||||
|
||||
List<PotionEffect> effectList = new ArrayList<>();
|
||||
List<EffectInstance> effectList = new ArrayList<>();
|
||||
effectList.add(baseEffect);
|
||||
|
||||
PotionUtils.appendEffects(outputStack, effectList);
|
||||
|
@ -129,7 +129,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe {
|
|||
|
||||
ItemStack outputStack = inputStack.copy();
|
||||
|
||||
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(outputStack);
|
||||
List<EffectInstance> effectList = PotionUtils.getEffectsFromStack(outputStack);
|
||||
effectList.add(baseEffect);
|
||||
|
||||
PotionUtils.appendEffects(outputStack, effectList);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue