mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
Fix Tooltips on 1.16
This commit is contained in:
parent
358ff25031
commit
c2f3ebbf72
2 changed files with 20 additions and 2 deletions
|
@ -9,6 +9,8 @@ import com.simibubi.create.AllFluids;
|
|||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.content.contraptions.KineticDebugger;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.engine.EngineBlock;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionHandler;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisRangeDisplay;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
||||
|
@ -27,6 +29,7 @@ import com.simibubi.create.content.curiosities.zapper.terrainzapper.WorldshaperR
|
|||
import com.simibubi.create.content.logistics.block.depot.EjectorTargetHandler;
|
||||
import com.simibubi.create.content.logistics.block.mechanicalArm.ArmInteractionPointHandler;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.networking.AllPackets;
|
||||
import com.simibubi.create.foundation.networking.LeftClickPacket;
|
||||
|
@ -52,9 +55,11 @@ import net.minecraft.client.renderer.texture.OverlayTexture;
|
|||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
@ -224,6 +229,19 @@ public class ClientEvents {
|
|||
.addInformation(toolTip);
|
||||
itemTooltip.addAll(0, toolTip);
|
||||
}
|
||||
|
||||
if (stack.getItem() instanceof BlockItem) {
|
||||
BlockItem item = (BlockItem) stack.getItem();
|
||||
if (item.getBlock() instanceof IRotate || item.getBlock() instanceof EngineBlock) {
|
||||
List<ITextComponent> kineticStats = ItemDescription.getKineticStats(item.getBlock());
|
||||
if (!kineticStats.isEmpty()) {
|
||||
event.getToolTip()
|
||||
.add(new StringTextComponent(""));
|
||||
event.getToolTip()
|
||||
.addAll(kineticStats);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PonderTooltipHandler.addToTooltip(event.getToolTip(), stack);
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ public class ItemDescription {
|
|||
if (hasControls) {
|
||||
IFormattableTextComponent tabBuilder = new StringTextComponent("");
|
||||
tabBuilder.append(new StringTextComponent(holdCtrl[0]).formatted(DARK_GRAY));
|
||||
tabBuilder.append(keyCtrl.formatted(ctrl? WHITE : GRAY));
|
||||
tabBuilder.append(keyCtrl.copy().formatted(ctrl? WHITE : GRAY));
|
||||
tabBuilder.append(new StringTextComponent(holdCtrl[1]).formatted(DARK_GRAY));
|
||||
list.add(0, tabBuilder);
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ public class ItemDescription {
|
|||
if (hasDescription) {
|
||||
IFormattableTextComponent tabBuilder = new StringTextComponent("");
|
||||
tabBuilder.append(new StringTextComponent(holdDesc[0]).formatted(DARK_GRAY));
|
||||
tabBuilder.append(keyShift.formatted(shift? WHITE : GRAY));
|
||||
tabBuilder.append(keyShift.copy().formatted(shift? WHITE : GRAY));
|
||||
tabBuilder.append(new StringTextComponent(holdDesc[1]).formatted(DARK_GRAY));
|
||||
list.add(0, tabBuilder);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue