Lots of work

This commit is contained in:
Vincent Lee committed 2020-06-26 09:59:25 -05:00
1 parent 98b74dc69b
commit 17ccb624f8
236 files changed
+839 -1015

No files matched your search

@@ -13,7 +13,6 @@ import com.google.common.collect.Lists;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttribute;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
@@ -129,7 +128,7 @@ public class ItemBrewBase extends Item implements IBrewItem {
@Override
public ITextComponent getDisplayName(@Nonnull ItemStack stack) {
return new TranslationTextComponent(getTranslationKey(), new TranslationTextComponent(getBrew(stack).getTranslationKey(stack)),
new StringTextComponent(Integer.toString(getSwigsLeft(stack))).applyTextStyle(TextFormatting.BOLD));
new StringTextComponent(Integer.toString(getSwigsLeft(stack))).func_240699_a_(TextFormatting.BOLD));
}
// [VanillaCopy] PotionUtils.addPotionTooltip, with custom effect list
@@ -137,7 +136,7 @@ public class ItemBrewBase extends Item implements IBrewItem {
public static void addPotionTooltip(List<EffectInstance> list, List<ITextComponent> lores, float durationFactor) {
List<Tuple<String, AttributeModifier>> list1 = Lists.newArrayList();
if (list.isEmpty()) {
lores.add((new TranslationTextComponent("effect.none")).applyTextStyle(TextFormatting.GRAY));
lores.add((new TranslationTextComponent("effect.none")).func_240699_a_(TextFormatting.GRAY));
} else {
for (EffectInstance effectinstance : list) {
ITextComponent itextcomponent = new TranslationTextComponent(effectinstance.getEffectName());
@@ -159,13 +158,13 @@ public class ItemBrewBase extends Item implements IBrewItem {
itextcomponent.appendText(" (").appendText(EffectUtils.getPotionDurationString(effectinstance, durationFactor)).appendText(")");
}
lores.add(itextcomponent.applyTextStyle(effect.getEffectType().getColor()));
lores.add(itextcomponent.func_240699_a_(effect.getEffectType().getColor()));
}
}
if (!list1.isEmpty()) {
lores.add(new StringTextComponent(""));
lores.add((new TranslationTextComponent("potion.whenDrank")).applyTextStyle(TextFormatting.DARK_PURPLE));
lores.add((new TranslationTextComponent("potion.whenDrank")).func_240699_a_(TextFormatting.DARK_PURPLE));
for (Tuple<String, AttributeModifier> tuple : list1) {
AttributeModifier attributemodifier2 = tuple.getB();
@@ -178,10 +177,10 @@ public class ItemBrewBase extends Item implements IBrewItem {
}
if (d0 > 0.0D) {
lores.add((new TranslationTextComponent("attribute.modifier.plus." + attributemodifier2.getOperation().getId(), ItemStack.DECIMALFORMAT.format(d1), new TranslationTextComponent("attribute.name." + tuple.getA()))).applyTextStyle(TextFormatting.BLUE));
lores.add((new TranslationTextComponent("attribute.modifier.plus." + attributemodifier2.getOperation().getId(), ItemStack.DECIMALFORMAT.format(d1), new TranslationTextComponent("attribute.name." + tuple.getA()))).func_240699_a_(TextFormatting.BLUE));
} else if (d0 < 0.0D) {
d1 = d1 * -1.0D;
lores.add((new TranslationTextComponent("attribute.modifier.take." + attributemodifier2.getOperation().getId(), ItemStack.DECIMALFORMAT.format(d1), new TranslationTextComponent("attribute.name." + tuple.getA()))).applyTextStyle(TextFormatting.RED));
lores.add((new TranslationTextComponent("attribute.modifier.take." + attributemodifier2.getOperation().getId(), ItemStack.DECIMALFORMAT.format(d1), new TranslationTextComponent("attribute.name." + tuple.getA()))).func_240699_a_(TextFormatting.RED));
}
}
}