mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Fix some item tooltips not being greyed, fix petals having incorrect name, fix lexicon open advancement being unobtainable
This commit is contained in:
1 parent
4fac487589
commit
f07a7c1220
21 files changed
+189
-170
No files matched your search
@@ -31,6 +31,7 @@ import net.minecraft.util.math.RayTraceContext;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -266,7 +267,7 @@ public class ItemAstrolabe extends ItemMod {
|
||||
|
||||
tip.add(new StringTextComponent(size + " x " + size));
|
||||
if (block != Blocks.AIR)
|
||||
tip.add(new ItemStack(block).getDisplayName());
|
||||
tip.add(new ItemStack(block).getDisplayName().applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -241,7 +241,7 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
|
||||
Block block = getBlock(stack);
|
||||
if(block != null) {
|
||||
int count = getBlockCount(stack);
|
||||
stacks.add(new StringTextComponent(Integer.toString(count) + " ").appendSibling(new ItemStack(block).getDisplayName()));
|
||||
stacks.add(new StringTextComponent(Integer.toString(count) + " ").appendSibling(new ItemStack(block).getDisplayName()).applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
if(ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false))
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -70,7 +71,7 @@ public class ItemBlackLotus extends ItemMod implements IManaDissolvable {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> list, ITooltipFlag flags) {
|
||||
list.add(new TranslationTextComponent("botaniamisc.lotusDesc"));
|
||||
list.add(new TranslationTextComponent("botaniamisc.lotusDesc").applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
@@ -89,7 +90,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> list, ITooltipFlag flags) {
|
||||
int level = stack.getOrCreateTag().getInt(TAG_LEVEL);
|
||||
ITextComponent levelLoc = new TranslationTextComponent("botania.roman" + (level + 1));
|
||||
list.add(new TranslationTextComponent("botaniamisc.shardLevel", levelLoc));
|
||||
list.add(new TranslationTextComponent("botaniamisc.shardLevel", levelLoc).applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -117,6 +117,8 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
Book book = getBook();
|
||||
|
||||
if(playerIn instanceof ServerPlayerEntity) {
|
||||
ServerPlayerEntity player= (ServerPlayerEntity) playerIn;
|
||||
UseItemSuccessTrigger.INSTANCE.trigger(player, stack, player.getServerWorld(), player.posX, player.posY, player.posZ);
|
||||
NetworkHandler.sendToPlayer(new MessageOpenBookGui(book.resourceLoc.toString()), (ServerPlayerEntity) playerIn);
|
||||
SoundEvent sfx = PatchouliSounds.getSound(book.openSound, PatchouliSounds.book_open);
|
||||
worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, sfx, SoundCategory.PLAYERS, 1F, (float) (0.7 + Math.random() * 0.4));
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -63,7 +64,7 @@ public class ItemManaTablet extends ItemMod implements IManaItem, ICreativeManaP
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
|
||||
if(isStackCreative(par1ItemStack))
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.creative"));
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.creative").applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
@@ -77,7 +78,7 @@ public class ItemPinkinator extends ItemMod {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flags) {
|
||||
tooltip.add(new TranslationTextComponent("botaniamisc.pinkinatorDesc"));
|
||||
tooltip.add(new TranslationTextComponent("botaniamisc.pinkinatorDesc").applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -260,7 +261,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, World world, List<ITextComponent> list, ITooltipFlag flags) {
|
||||
list.add(new TranslationTextComponent(getModeString(stack)));
|
||||
list.add(new TranslationTextComponent(getModeString(stack)).applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -40,7 +41,7 @@ public class ItemBlockPool extends ItemBlockMod {
|
||||
public void addInformation(@Nonnull ItemStack par1ItemStack, World world, @Nonnull List<ITextComponent> stacks, @Nonnull ITooltipFlag flag) {
|
||||
if(((BlockPool) getBlock()).variant == BlockPool.Variant.CREATIVE)
|
||||
for(int i = 0; i < 2; i++)
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.creativePool" + i));
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.creativePool" + i).applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -63,9 +64,9 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble {
|
||||
@Override
|
||||
public void addHiddenTooltip(ItemStack stack, World world, List<ITextComponent> stacks, ITooltipFlag flags) {
|
||||
if(variant == Variant.THINKING_HAND) {
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.cosmeticThinking"));
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.cosmeticThinking").applyTextStyle(TextFormatting.GRAY));
|
||||
} else {
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.cosmeticBauble"));
|
||||
stacks.add(new TranslationTextComponent("botaniamisc.cosmeticBauble").applyTextStyle(TextFormatting.GRAY));
|
||||
}
|
||||
super.addHiddenTooltip(stack, world, stacks, flags);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.recipe.ICustomApothecaryColor;
|
||||
import vazkii.botania.common.item.block.ItemBlockMod;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemPetal extends ItemBlockMod implements ICustomApothecaryColor {
|
||||
public final DyeColor color;
|
||||
|
||||
@@ -24,6 +26,13 @@ public class ItemPetal extends ItemBlockMod implements ICustomApothecaryColor {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey() {
|
||||
// Don't take name of the block
|
||||
return getDefaultTranslationKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getParticleColor(ItemStack stack) {
|
||||
return color.colorValue;
|
||||
|
||||
Reference in new issue
Block a user