mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Merge branch 'mc1.20.1/feature-dev' into mc1.21.1/dev
This commit is contained in:
commit
61e08b13a2
40 changed files with 449 additions and 432 deletions
|
@ -136,7 +136,7 @@ repositories {
|
|||
dependencies {
|
||||
jarJar(implementation("com.tterrag.registrate:Registrate:${registrate_version}"))
|
||||
|
||||
jarJar("dev.engine-room.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
|
||||
jarJar("dev.engine-room.flywheel:flywheel-neoforge-${flywheel_minecraft_version}:${flywheel_version}") {
|
||||
version {
|
||||
strictly "[1.0,2.0)"
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import com.simibubi.create.foundation.item.TooltipHelper;
|
|||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.lang.FontHelper.Palette;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public interface IDisplayAssemblyExceptions {
|
||||
|
@ -19,7 +19,7 @@ public interface IDisplayAssemblyExceptions {
|
|||
return false;
|
||||
|
||||
if (!tooltip.isEmpty())
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
|
||||
CreateLang.translate("gui.assembly.exception").style(ChatFormatting.GOLD)
|
||||
.forGoggles(tooltip);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.simibubi.create.content.contraptions.elevator;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
@ -23,6 +21,7 @@ import net.minecraft.ChatFormatting;
|
|||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.util.FormattedCharSequence;
|
||||
|
||||
|
@ -108,7 +107,7 @@ public class ElevatorContactScreen extends AbstractSimiScreen {
|
|||
}
|
||||
|
||||
private EditBox editBox(int x, int width, int chars) {
|
||||
EditBox editBox = new EditBox(font, guiLeft + x, guiTop + 30, width, 10, Lang.IMMUTABLE_EMPTY);
|
||||
EditBox editBox = new EditBox(font, guiLeft + x, guiTop + 30, width, 10, CommonComponents.EMPTY);
|
||||
editBox.setTextColor(-1);
|
||||
editBox.setTextColorUneditable(-1);
|
||||
editBox.setBordered(false);
|
||||
|
@ -131,7 +130,7 @@ public class ElevatorContactScreen extends AbstractSimiScreen {
|
|||
(float) (x + (background.getWidth() - 8) / 2 - font.width(formattedcharsequence) / 2), (float) y + 6, 0x2F3738, false);
|
||||
|
||||
GuiGameElement.of(AllBlocks.ELEVATOR_CONTACT.asStack()).<GuiGameElement
|
||||
.GuiRenderBuilder>at(x + background.getWidth() + 6, y + background.getHeight() - 56, -200)
|
||||
.GuiRenderBuilder>at(x + background.getWidth() + 6, y + background.getHeight() - 56, -200)
|
||||
.scale(5)
|
||||
.render(graphics);
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@ import net.createmod.catnip.platform.CatnipServices;
|
|||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
import com.simibubi.create.foundation.utility.RaycastHelper;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.outliner.Outliner;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
|
@ -64,7 +64,7 @@ public class SuperGlueSelectionHandler {
|
|||
|
||||
if (clusterCooldown > 0) {
|
||||
if (clusterCooldown == 25)
|
||||
player.displayClientMessage(Lang.IMMUTABLE_EMPTY, true);
|
||||
player.displayClientMessage(CommonComponents.EMPTY, true);
|
||||
Outliner.getInstance().keep(clusterOutlineSlot);
|
||||
clusterCooldown--;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ public class SuperGlueSelectionHandler {
|
|||
if (mc.hitResult instanceof BlockHitResult bhr) {
|
||||
face = bhr.getDirection();
|
||||
BlockState blockState = level.getBlockState(hoveredPos);
|
||||
if (blockState.getBlock()instanceof AbstractChassisBlock cb)
|
||||
if (blockState.getBlock() instanceof AbstractChassisBlock cb)
|
||||
if (cb.getGlueableSide(blockState, bhr.getDirection()) != null)
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ import com.simibubi.create.foundation.utility.DistExecutor;
|
|||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.protocol.game.ClientboundSetSubtitleTextPacket;
|
||||
|
@ -102,7 +102,7 @@ public class BacktankUtil {
|
|||
player.connection.send(new ClientboundSetSubtitleTextPacket(
|
||||
Component.literal("\u26A0 ").withStyle(depleted ? ChatFormatting.RED : ChatFormatting.GOLD)
|
||||
.append(component.withStyle(ChatFormatting.GRAY))));
|
||||
player.connection.send(new ClientboundSetTitleTextPacket(Lang.IMMUTABLE_EMPTY));
|
||||
player.connection.send(new ClientboundSetTitleTextPacket(CommonComponents.EMPTY));
|
||||
}
|
||||
|
||||
public static int maxAir(ItemStack backtank) {
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
package com.simibubi.create.content.equipment.goggles;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||
|
||||
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.FormattedText;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GoggleConfigScreen extends AbstractSimiScreen {
|
||||
|
||||
private int offsetX;
|
||||
|
@ -30,19 +31,19 @@ public class GoggleConfigScreen extends AbstractSimiScreen {
|
|||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(CreateLang.translateDirect("gui.config.overlay2")
|
||||
.withStyle(ChatFormatting.GRAY)));
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(CreateLang.translateDirect("gui.config.overlay3")));
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(CreateLang.translateDirect("gui.config.overlay4")));
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(CreateLang.translateDirect("gui.config.overlay5")
|
||||
.withStyle(ChatFormatting.GRAY)));
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(CreateLang.translateDirect("gui.config.overlay6")
|
||||
.withStyle(ChatFormatting.GRAY)));
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
.append(CreateLang.translateDirect("gui.config.overlay7")));
|
||||
tooltip.add(componentSpacing.plainCopy()
|
||||
|
@ -75,7 +76,7 @@ public class GoggleConfigScreen extends AbstractSimiScreen {
|
|||
|
||||
@Override
|
||||
public boolean mouseDragged(double p_mouseDragged_1_, double p_mouseDragged_3_, int p_mouseDragged_5_,
|
||||
double p_mouseDragged_6_, double p_mouseDragged_8_) {
|
||||
double p_mouseDragged_6_, double p_mouseDragged_8_) {
|
||||
updateOffset(p_mouseDragged_1_, p_mouseDragged_3_);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.simibubi.create.infrastructure.config.CClient;
|
|||
import net.createmod.catnip.data.Iterate;
|
||||
import net.createmod.catnip.gui.element.BoxElement;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.outliner.Outline;
|
||||
import net.createmod.catnip.outliner.Outliner;
|
||||
import net.createmod.catnip.outliner.Outliner.OutlineEntry;
|
||||
|
@ -40,6 +39,7 @@ import net.minecraft.client.gui.LayeredDraw;
|
|||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.FormattedText;
|
||||
import net.minecraft.util.Mth;
|
||||
|
@ -114,7 +114,7 @@ public class GoggleOverlayRenderer {
|
|||
|
||||
if (hasHoveringInformation) {
|
||||
if (!tooltip.isEmpty())
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
IHaveHoveringInformation hte = (IHaveHoveringInformation) be;
|
||||
hoverAddedInformation = hte.addToTooltip(tooltip, isShifting);
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class GoggleOverlayRenderer {
|
|||
return;
|
||||
}
|
||||
if (!tooltip.isEmpty())
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
|
||||
CreateLang.translate("gui.goggles.pole_length")
|
||||
.text(" " + poles)
|
||||
|
|
|
@ -5,7 +5,12 @@ import java.util.Optional;
|
|||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.core.Holder;
|
||||
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -29,9 +34,6 @@ import net.minecraft.client.player.AbstractClientPlayer;
|
|||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
|
@ -125,75 +127,75 @@ public class PotatoCannonItem extends ProjectileWeaponItem implements CustomArmP
|
|||
ItemStack stack = player.getItemInHand(hand);
|
||||
return findAmmoInInventory(world, player, stack).map(itemStack -> {
|
||||
|
||||
if (ShootableGadgetItemMethods.shouldSwap(player, stack, hand, this::isCannon))
|
||||
return InteractionResultHolder.fail(stack);
|
||||
if (ShootableGadgetItemMethods.shouldSwap(player, stack, hand, this::isCannon))
|
||||
return InteractionResultHolder.fail(stack);
|
||||
|
||||
if (world.isClientSide) {
|
||||
CreateClient.POTATO_CANNON_RENDER_HANDLER.dontAnimateItem(hand);
|
||||
return InteractionResultHolder.success(stack);
|
||||
}
|
||||
|
||||
Vec3 barrelPos = ShootableGadgetItemMethods.getGunBarrelVec(player, hand == InteractionHand.MAIN_HAND,
|
||||
new Vec3(.75f, -0.15f, 1.5f));
|
||||
Vec3 correction =
|
||||
ShootableGadgetItemMethods.getGunBarrelVec(player, hand == InteractionHand.MAIN_HAND, new Vec3(-.05f, 0, 0))
|
||||
.subtract(player.position()
|
||||
.add(0, player.getEyeHeight(), 0));
|
||||
|
||||
PotatoCannonProjectileType projectileType = PotatoProjectileTypeManager.getTypeForStack(itemStack)
|
||||
.orElse(BuiltinPotatoProjectileTypes.FALLBACK);
|
||||
Vec3 lookVec = player.getLookAngle();
|
||||
Vec3 motion = lookVec.add(correction)
|
||||
.normalize()
|
||||
.scale(2)
|
||||
.scale(projectileType.getVelocityMultiplier());
|
||||
|
||||
float soundPitch = projectileType.getSoundPitch() + (Create.RANDOM.nextFloat() - .5f) / 4f;
|
||||
|
||||
boolean spray = projectileType.getSplit() > 1;
|
||||
Vec3 sprayBase = VecHelper.rotate(new Vec3(0, 0.1, 0), 360 * Create.RANDOM.nextFloat(), Axis.Z);
|
||||
float sprayChange = 360f / projectileType.getSplit();
|
||||
|
||||
for (int i = 0; i < projectileType.getSplit(); i++) {
|
||||
PotatoProjectileEntity projectile = AllEntityTypes.POTATO_PROJECTILE.create(world);
|
||||
projectile.setItem(itemStack);
|
||||
projectile.setEnchantmentEffectsFromCannon(stack);
|
||||
|
||||
Vec3 splitMotion = motion;
|
||||
if (spray) {
|
||||
float imperfection = 40 * (Create.RANDOM.nextFloat() - 0.5f);
|
||||
Vec3 sprayOffset = VecHelper.rotate(sprayBase, i * sprayChange + imperfection, Axis.Z);
|
||||
splitMotion = splitMotion.add(VecHelper.lookAt(sprayOffset, motion));
|
||||
if (world.isClientSide) {
|
||||
CreateClient.POTATO_CANNON_RENDER_HANDLER.dontAnimateItem(hand);
|
||||
return InteractionResultHolder.success(stack);
|
||||
}
|
||||
|
||||
if (i != 0)
|
||||
projectile.recoveryChance = 0;
|
||||
Vec3 barrelPos = ShootableGadgetItemMethods.getGunBarrelVec(player, hand == InteractionHand.MAIN_HAND,
|
||||
new Vec3(.75f, -0.15f, 1.5f));
|
||||
Vec3 correction =
|
||||
ShootableGadgetItemMethods.getGunBarrelVec(player, hand == InteractionHand.MAIN_HAND, new Vec3(-.05f, 0, 0))
|
||||
.subtract(player.position()
|
||||
.add(0, player.getEyeHeight(), 0));
|
||||
|
||||
projectile.setPos(barrelPos.x, barrelPos.y, barrelPos.z);
|
||||
projectile.setDeltaMovement(splitMotion);
|
||||
projectile.setOwner(player);
|
||||
world.addFreshEntity(projectile);
|
||||
}
|
||||
PotatoCannonProjectileType projectileType = PotatoProjectileTypeManager.getTypeForStack(itemStack)
|
||||
.orElse(BuiltinPotatoProjectileTypes.FALLBACK);
|
||||
Vec3 lookVec = player.getLookAngle();
|
||||
Vec3 motion = lookVec.add(correction)
|
||||
.normalize()
|
||||
.scale(2)
|
||||
.scale(projectileType.getVelocityMultiplier());
|
||||
|
||||
if (!player.isCreative()) {
|
||||
itemStack.shrink(1);
|
||||
if (itemStack.isEmpty())
|
||||
player.getInventory().removeItem(itemStack);
|
||||
}
|
||||
float soundPitch = projectileType.getSoundPitch() + (Create.RANDOM.nextFloat() - .5f) / 4f;
|
||||
|
||||
if (!BacktankUtil.canAbsorbDamage(player, maxUses()))
|
||||
stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand));
|
||||
boolean spray = projectileType.getSplit() > 1;
|
||||
Vec3 sprayBase = VecHelper.rotate(new Vec3(0, 0.1, 0), 360 * Create.RANDOM.nextFloat(), Axis.Z);
|
||||
float sprayChange = 360f / projectileType.getSplit();
|
||||
|
||||
Integer cooldown =
|
||||
findAmmoInInventory(world, player, stack).flatMap(PotatoProjectileTypeManager::getTypeForStack)
|
||||
.map(PotatoCannonProjectileType::getReloadTicks)
|
||||
.orElse(10);
|
||||
for (int i = 0; i < projectileType.getSplit(); i++) {
|
||||
PotatoProjectileEntity projectile = AllEntityTypes.POTATO_PROJECTILE.create(world);
|
||||
projectile.setItem(itemStack);
|
||||
projectile.setEnchantmentEffectsFromCannon(stack);
|
||||
|
||||
ShootableGadgetItemMethods.applyCooldown(player, stack, hand, this::isCannon, cooldown);
|
||||
ShootableGadgetItemMethods.sendPackets(player,
|
||||
b -> new PotatoCannonPacket(barrelPos, hand, b, soundPitch, lookVec.normalize(), itemStack));
|
||||
return InteractionResultHolder.success(stack);
|
||||
})
|
||||
Vec3 splitMotion = motion;
|
||||
if (spray) {
|
||||
float imperfection = 40 * (Create.RANDOM.nextFloat() - 0.5f);
|
||||
Vec3 sprayOffset = VecHelper.rotate(sprayBase, i * sprayChange + imperfection, Axis.Z);
|
||||
splitMotion = splitMotion.add(VecHelper.lookAt(sprayOffset, motion));
|
||||
}
|
||||
|
||||
if (i != 0)
|
||||
projectile.recoveryChance = 0;
|
||||
|
||||
projectile.setPos(barrelPos.x, barrelPos.y, barrelPos.z);
|
||||
projectile.setDeltaMovement(splitMotion);
|
||||
projectile.setOwner(player);
|
||||
world.addFreshEntity(projectile);
|
||||
}
|
||||
|
||||
if (!player.isCreative()) {
|
||||
itemStack.shrink(1);
|
||||
if (itemStack.isEmpty())
|
||||
player.getInventory().removeItem(itemStack);
|
||||
}
|
||||
|
||||
if (!BacktankUtil.canAbsorbDamage(player, maxUses()))
|
||||
stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand));
|
||||
|
||||
Integer cooldown =
|
||||
findAmmoInInventory(world, player, stack).flatMap(PotatoProjectileTypeManager::getTypeForStack)
|
||||
.map(PotatoCannonProjectileType::getReloadTicks)
|
||||
.orElse(10);
|
||||
|
||||
ShootableGadgetItemMethods.applyCooldown(player, stack, hand, this::isCannon, cooldown);
|
||||
ShootableGadgetItemMethods.sendPackets(player,
|
||||
b -> new PotatoCannonPacket(barrelPos, hand, b, soundPitch, lookVec.normalize(), itemStack));
|
||||
return InteractionResultHolder.success(stack);
|
||||
})
|
||||
.orElse(InteractionResultHolder.pass(stack));
|
||||
}
|
||||
|
||||
|
@ -242,12 +244,12 @@ public class PotatoCannonItem extends ProjectileWeaponItem implements CustomArmP
|
|||
String _reload = "potato_cannon.ammo.reload_ticks";
|
||||
String _knockback = "potato_cannon.ammo.knockback";
|
||||
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.add(Component.translatable(ammo.getDescriptionId()).append(Component.literal(":"))
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
PotatoCannonProjectileType type = PotatoProjectileTypeManager.getTypeForStack(ammo)
|
||||
.get();
|
||||
MutableComponent spacing = Component.literal(" ");
|
||||
MutableComponent spacing = CommonComponents.space();
|
||||
ChatFormatting green = ChatFormatting.GREEN;
|
||||
ChatFormatting darkGreen = ChatFormatting.DARK_GREEN;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.simibubi.create.content.equipment.symmetryWand;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.platform.CatnipServices;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
@ -23,6 +22,7 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -65,9 +65,9 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
|||
int x = guiLeft;
|
||||
int y = guiTop;
|
||||
|
||||
labelType = new Label(x + 51, y + 28, Lang.IMMUTABLE_EMPTY).colored(0xFFFFFFFF)
|
||||
labelType = new Label(x + 51, y + 28, CommonComponents.EMPTY).colored(0xFFFFFFFF)
|
||||
.withShadow();
|
||||
labelAlign = new Label(x + 51, y + 50, Lang.IMMUTABLE_EMPTY).colored(0xFFFFFFFF)
|
||||
labelAlign = new Label(x + 51, y + 50, CommonComponents.EMPTY).colored(0xFFFFFFFF)
|
||||
.withShadow();
|
||||
|
||||
int state =
|
||||
|
@ -79,17 +79,17 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
|||
|
||||
areaType.calling(position -> {
|
||||
switch (position) {
|
||||
case 0:
|
||||
currentElement = new PlaneMirror(currentElement.getPosition());
|
||||
break;
|
||||
case 1:
|
||||
currentElement = new CrossPlaneMirror(currentElement.getPosition());
|
||||
break;
|
||||
case 2:
|
||||
currentElement = new TriplePlaneMirror(currentElement.getPosition());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 0:
|
||||
currentElement = new PlaneMirror(currentElement.getPosition());
|
||||
break;
|
||||
case 1:
|
||||
currentElement = new CrossPlaneMirror(currentElement.getPosition());
|
||||
break;
|
||||
case 2:
|
||||
currentElement = new TriplePlaneMirror(currentElement.getPosition());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
initAlign(currentElement, x, y);
|
||||
});
|
||||
|
@ -131,10 +131,10 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
|
|||
|
||||
renderBlock(graphics, x, y);
|
||||
GuiGameElement.of(wand)
|
||||
.scale(4)
|
||||
.rotate(-70, 20, 20)
|
||||
.at(x + 178, y + 448, -150)
|
||||
.render(graphics);
|
||||
.scale(4)
|
||||
.rotate(-70, 20, 20)
|
||||
.at(x + 178, y + 448, -150)
|
||||
.render(graphics);
|
||||
}
|
||||
|
||||
protected void renderBlock(GuiGraphics graphics, int x, int y) {
|
||||
|
|
|
@ -13,9 +13,9 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
|
||||
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.platform.CatnipServices;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -44,7 +44,7 @@ public abstract class ZapperScreen extends AbstractSimiScreen {
|
|||
this.background = background;
|
||||
this.zapper = zapper;
|
||||
this.hand = hand;
|
||||
title = Lang.IMMUTABLE_EMPTY;
|
||||
title = CommonComponents.EMPTY;
|
||||
brightColor = 0xFEFEFE;
|
||||
fontColor = AllGuiTextures.FONT_COLOR;
|
||||
|
||||
|
@ -119,9 +119,9 @@ public abstract class ZapperScreen extends AbstractSimiScreen {
|
|||
|
||||
protected void renderZapper(GuiGraphics graphics, int x, int y) {
|
||||
GuiGameElement.of(zapper)
|
||||
.scale(4)
|
||||
.at(x + background.getWidth(), y + background.getHeight() - 48, -200)
|
||||
.render(graphics);
|
||||
.scale(4)
|
||||
.at(x + background.getWidth(), y + background.getHeight() - 48, -200)
|
||||
.render(graphics);
|
||||
}
|
||||
|
||||
protected void renderBlock(GuiGraphics graphics, int x, int y) {
|
||||
|
|
|
@ -16,9 +16,9 @@ import com.simibubi.create.foundation.gui.widget.ScrollInput;
|
|||
import com.simibubi.create.foundation.gui.widget.SelectionScrollInput;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -43,7 +43,7 @@ public class WorldshaperScreen extends ZapperScreen {
|
|||
protected Indicator acrossMaterialsIndicator;
|
||||
|
||||
protected TerrainBrushes currentBrush;
|
||||
protected int[] currentBrushParams = new int[] { 1, 1, 1 };
|
||||
protected int[] currentBrushParams = new int[]{1, 1, 1};
|
||||
protected boolean currentFollowDiagonals;
|
||||
protected boolean currentAcrossMaterials;
|
||||
protected TerrainTools currentTool;
|
||||
|
@ -78,7 +78,7 @@ public class WorldshaperScreen extends ZapperScreen {
|
|||
int x = guiLeft;
|
||||
int y = guiTop;
|
||||
|
||||
brushLabel = new Label(x + 61, y + 25, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
brushLabel = new Label(x + 61, y + 25, CommonComponents.EMPTY).withShadow();
|
||||
brushInput = new SelectionScrollInput(x + 56, y + 20, 77, 18).forOptions(brushOptions)
|
||||
.titled(CreateLang.translateDirect("gui.terrainzapper.brush"))
|
||||
.writingTo(brushLabel)
|
||||
|
@ -107,7 +107,7 @@ public class WorldshaperScreen extends ZapperScreen {
|
|||
brushParams.clear();
|
||||
|
||||
for (int index = 0; index < 3; index++) {
|
||||
Label label = new Label(x + 65 + 20 * index, y + 45, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
Label label = new Label(x + 65 + 20 * index, y + 45, CommonComponents.EMPTY).withShadow();
|
||||
|
||||
final int finalIndex = index;
|
||||
ScrollInput input = new ScrollInput(x + 56 + 20 * index, y + 40, 18, 18)
|
||||
|
@ -151,10 +151,10 @@ public class WorldshaperScreen extends ZapperScreen {
|
|||
if (currentBrush.hasConnectivityOptions()) {
|
||||
int x1 = x + 7 + 4 * 18;
|
||||
int y1 = y + 79;
|
||||
followDiagonalsIndicator = new Indicator(x1, y1 - 6, Lang.IMMUTABLE_EMPTY);
|
||||
followDiagonalsIndicator = new Indicator(x1, y1 - 6, CommonComponents.EMPTY);
|
||||
followDiagonals = new IconButton(x1, y1, AllIcons.I_FOLLOW_DIAGONAL);
|
||||
x1 += 18;
|
||||
acrossMaterialsIndicator = new Indicator(x1, y1 - 6, Lang.IMMUTABLE_EMPTY);
|
||||
acrossMaterialsIndicator = new Indicator(x1, y1 - 6, CommonComponents.EMPTY);
|
||||
acrossMaterials = new IconButton(x1, y1, AllIcons.I_FOLLOW_MATERIAL);
|
||||
|
||||
followDiagonals.withCallback(() -> {
|
||||
|
|
|
@ -8,12 +8,12 @@ import com.simibubi.create.content.fluids.potion.PotionFluid.BottleType;
|
|||
import com.simibubi.create.foundation.fluid.FluidHelper;
|
||||
import com.simibubi.create.foundation.fluid.FluidIngredient;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.data.Pair;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
|
@ -32,6 +32,7 @@ import net.minecraft.world.item.alchemy.Potions;
|
|||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
|
@ -83,7 +84,7 @@ public class PotionFluidHandler {
|
|||
return switch (type) {
|
||||
case LINGERING -> Items.LINGERING_POTION;
|
||||
case SPLASH -> Items.SPLASH_POTION;
|
||||
default -> Items.POTION;
|
||||
default -> Items.POTION;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -103,15 +104,15 @@ public class PotionFluidHandler {
|
|||
List<MobEffectInstance> list = fs.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).customEffects();
|
||||
List<Pair<Holder<Attribute>, AttributeModifier>> list1 = Lists.newArrayList();
|
||||
if (list.isEmpty()) {
|
||||
tooltip.add((Component.translatable("effect.none")).withStyle(ChatFormatting.GRAY));
|
||||
tooltip.add((Component.translatable("effect.none")).withStyle(ChatFormatting.GRAY));
|
||||
} else {
|
||||
for (MobEffectInstance effectinstance : list) {
|
||||
MutableComponent textcomponent = Component.translatable(effectinstance.getDescriptionId());
|
||||
MutableComponent textcomponent = Component.translatable(effectinstance.getDescriptionId());
|
||||
Holder<MobEffect> effect = effectinstance.getEffect();
|
||||
effect.value().createModifiers(effectinstance.getAmplifier(), (attributeHolder, attributeModifier) -> list1.add(Pair.of(attributeHolder, attributeModifier)));
|
||||
|
||||
if (effectinstance.getAmplifier() > 0) {
|
||||
textcomponent.append(" ")
|
||||
textcomponent.append(" ")
|
||||
.append(Component.translatable("potion.potency." + effectinstance.getAmplifier()).getString());
|
||||
}
|
||||
|
||||
|
@ -127,8 +128,8 @@ public class PotionFluidHandler {
|
|||
}
|
||||
|
||||
if (!list1.isEmpty()) {
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add((Component.translatable("potion.whenDrank")).withStyle(ChatFormatting.DARK_PURPLE));
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.add((Component.translatable("potion.whenDrank")).withStyle(ChatFormatting.DARK_PURPLE));
|
||||
|
||||
for (Pair<Holder<Attribute>, AttributeModifier> pair : list1) {
|
||||
AttributeModifier attributemodifier2 = pair.getSecond();
|
||||
|
@ -146,14 +147,14 @@ public class PotionFluidHandler {
|
|||
"attribute.modifier.plus." + attributemodifier2.operation().id(),
|
||||
ItemAttributeModifiers.ATTRIBUTE_MODIFIER_FORMAT.format(d1),
|
||||
Component.translatable(pair.getFirst().value().getDescriptionId())))
|
||||
.withStyle(ChatFormatting.BLUE));
|
||||
.withStyle(ChatFormatting.BLUE));
|
||||
} else if (d0 < 0.0D) {
|
||||
d1 = d1 * -1.0D;
|
||||
tooltip.add((Component.translatable(
|
||||
"attribute.modifier.take." + attributemodifier2.operation().id(),
|
||||
ItemAttributeModifiers.ATTRIBUTE_MODIFIER_FORMAT.format(d1),
|
||||
Component.translatable(pair.getFirst().value().getDescriptionId())))
|
||||
.withStyle(ChatFormatting.RED));
|
||||
.withStyle(ChatFormatting.RED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,6 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
|
@ -22,13 +20,14 @@ import com.simibubi.create.foundation.fluid.FluidHelper;
|
|||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import joptsimple.internal.Strings;
|
||||
import net.createmod.catnip.data.Iterate;
|
||||
import net.createmod.catnip.animation.LerpedFloat;
|
||||
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
||||
import net.createmod.catnip.data.Iterate;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
@ -37,6 +36,7 @@ import net.minecraft.util.Mth;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class BoilerData {
|
|||
private int maxHeatForWater = 0;
|
||||
private int minValue = 0;
|
||||
private int maxValue = 0;
|
||||
public boolean[] occludedDirections = { true, true, true, true };
|
||||
public boolean[] occludedDirections = {true, true, true, true};
|
||||
|
||||
public LerpedFloat gauge = LerpedFloat.linear();
|
||||
|
||||
|
@ -197,7 +197,7 @@ public class BoilerData {
|
|||
calcMinMaxForSize(boilerSize);
|
||||
|
||||
CreateLang.translate("boiler.status", getHeatLevelTextComponent().withStyle(ChatFormatting.GREEN))
|
||||
.forGoggles(tooltip);
|
||||
.forGoggles(tooltip);
|
||||
CreateLang.builder().add(getSizeComponent(true, false)).forGoggles(tooltip, 1);
|
||||
CreateLang.builder().add(getWaterComponent(true, false)).forGoggles(tooltip, 1);
|
||||
CreateLang.builder().add(getHeatComponent(true, false)).forGoggles(tooltip, 1);
|
||||
|
@ -209,7 +209,7 @@ public class BoilerData {
|
|||
double totalSU = getEngineEfficiency(boilerSize) * 16 * Math.max(boilerLevel, attachedEngines)
|
||||
* BlockStressValues.getCapacity(AllBlocks.STEAM_ENGINE.get());
|
||||
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
|
||||
if (attachedEngines > 0 && maxHeatForSize > 0 && maxHeatForWater == 0 && (passiveHeat ? 1 : activeHeat) > 0) {
|
||||
CreateLang.translate("boiler.water_input_rate")
|
||||
|
@ -221,7 +221,7 @@ public class BoilerData {
|
|||
.add(CreateLang.text(" / ")
|
||||
.style(ChatFormatting.GRAY))
|
||||
.add(CreateLang.translate("boiler.per_tick", CreateLang.number(waterSupplyPerLevel)
|
||||
.add(CreateLang.translate("generic.unit.millibuckets")))
|
||||
.add(CreateLang.translate("generic.unit.millibuckets")))
|
||||
.style(ChatFormatting.DARK_GRAY))
|
||||
.forGoggles(tooltip, 1);
|
||||
return true;
|
||||
|
@ -256,8 +256,8 @@ public class BoilerData {
|
|||
|
||||
return isPassive() ? CreateLang.translateDirect("boiler.passive")
|
||||
: (boilerLevel == 0 ? CreateLang.translateDirect("boiler.idle")
|
||||
: boilerLevel == 18 ? CreateLang.translateDirect("boiler.max_lvl")
|
||||
: CreateLang.translateDirect("boiler.lvl", String.valueOf(boilerLevel)));
|
||||
: boilerLevel == 18 ? CreateLang.translateDirect("boiler.max_lvl")
|
||||
: CreateLang.translateDirect("boiler.lvl", String.valueOf(boilerLevel)));
|
||||
}
|
||||
|
||||
public MutableComponent getSizeComponent(boolean forGoggles, boolean useBlocksAsBars, ChatFormatting... styles) {
|
||||
|
@ -273,7 +273,7 @@ public class BoilerData {
|
|||
}
|
||||
|
||||
private MutableComponent componentHelper(String label, int level, boolean forGoggles, boolean useBlocksAsBars,
|
||||
ChatFormatting... styles) {
|
||||
ChatFormatting... styles) {
|
||||
MutableComponent base = useBlocksAsBars ? blockComponent(level) : barComponent(level);
|
||||
|
||||
if (!forGoggles)
|
||||
|
@ -294,7 +294,7 @@ public class BoilerData {
|
|||
}
|
||||
|
||||
private MutableComponent barComponent(int level) {
|
||||
return Component.empty()
|
||||
return Component.empty()
|
||||
.append(bars(Math.max(0, minValue - 1), ChatFormatting.DARK_GREEN))
|
||||
.append(bars(minValue > 0 ? 1 : 0, ChatFormatting.GREEN))
|
||||
.append(bars(Math.max(0, level - minValue), ChatFormatting.DARK_GREEN))
|
||||
|
@ -332,7 +332,7 @@ public class BoilerData {
|
|||
attachedEngines++;
|
||||
if (AllBlocks.STEAM_WHISTLE.has(attachedState)
|
||||
&& WhistleBlock.getAttachedDirection(attachedState)
|
||||
.getOpposite() == d)
|
||||
.getOpposite() == d)
|
||||
attachedWhistles++;
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ public class BoilerData {
|
|||
BlockState attachedState = level.getBlockState(attachedPos);
|
||||
if (AllBlocks.STEAM_WHISTLE.has(attachedState)
|
||||
&& WhistleBlock.getAttachedDirection(attachedState)
|
||||
.getOpposite() == d) {
|
||||
.getOpposite() == d) {
|
||||
if (level.getBlockEntity(attachedPos) instanceof WhistleBlockEntity wbe)
|
||||
whistlePitches.add(wbe.getPitchId());
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.simibubi.create.content.kinetics.belt.transport.TransportedItemStack;
|
|||
import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.math.VecHelper;
|
||||
import net.createmod.catnip.outliner.Outliner;
|
||||
import net.minecraft.ChatFormatting;
|
||||
|
@ -24,6 +23,7 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
|
@ -55,7 +55,7 @@ public class BeltSlicer {
|
|||
}
|
||||
|
||||
public static ItemInteractionResult useWrench(BlockState state, Level world, BlockPos pos, Player player,
|
||||
InteractionHand handIn, BlockHitResult hit, Feedback feedBack) {
|
||||
InteractionHand handIn, BlockHitResult hit, Feedback feedBack) {
|
||||
BeltBlockEntity controllerBE = BeltHelper.getControllerBE(world, pos);
|
||||
if (controllerBE == null)
|
||||
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
|
||||
|
@ -164,7 +164,8 @@ public class BeltSlicer {
|
|||
|
||||
int amountRetrieved = 0;
|
||||
boolean beltFound = false;
|
||||
Search: while (true) {
|
||||
Search:
|
||||
while (true) {
|
||||
for (int i = 0; i < player.getInventory().getContainerSize(); ++i) {
|
||||
if (amountRetrieved == requiredShafts && beltFound)
|
||||
break Search;
|
||||
|
@ -222,7 +223,7 @@ public class BeltSlicer {
|
|||
newController.inventory = null;
|
||||
newController.setController(newController.getBlockPos());
|
||||
for (Iterator<TransportedItemStack> iterator = inventory.getTransportedItems()
|
||||
.iterator(); iterator.hasNext();) {
|
||||
.iterator(); iterator.hasNext(); ) {
|
||||
TransportedItemStack transportedItemStack = iterator.next();
|
||||
float newPosition = transportedItemStack.beltPosition - hitSegment - (towardPositive ? 1 : 0);
|
||||
if (newPosition <= 0)
|
||||
|
@ -401,16 +402,16 @@ public class BeltSlicer {
|
|||
BeltSlope slope2 = nextState.getValue(BeltBlock.SLOPE);
|
||||
|
||||
switch (slope1) {
|
||||
case UPWARD:
|
||||
if (slope2 == BeltSlope.DOWNWARD)
|
||||
return facing1 == facing2.getOpposite();
|
||||
return slope2 == slope1 && facing1 == facing2;
|
||||
case DOWNWARD:
|
||||
if (slope2 == BeltSlope.UPWARD)
|
||||
return facing1 == facing2.getOpposite();
|
||||
return slope2 == slope1 && facing1 == facing2;
|
||||
default:
|
||||
return slope2 == slope1 && facing2.getAxis() == facing1.getAxis();
|
||||
case UPWARD:
|
||||
if (slope2 == BeltSlope.DOWNWARD)
|
||||
return facing1 == facing2.getOpposite();
|
||||
return slope2 == slope1 && facing1 == facing2;
|
||||
case DOWNWARD:
|
||||
if (slope2 == BeltSlope.UPWARD)
|
||||
return facing1 == facing2.getOpposite();
|
||||
return slope2 == slope1 && facing1 == facing2;
|
||||
default:
|
||||
return slope2 == slope1 && facing2.getAxis() == facing1.getAxis();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -478,7 +479,7 @@ public class BeltSlicer {
|
|||
mc.player.displayClientMessage(CreateLang.translateDirect(feedback.langKey)
|
||||
.withStyle(feedback.formatting), true);
|
||||
else
|
||||
mc.player.displayClientMessage(Lang.IMMUTABLE_EMPTY, true);
|
||||
mc.player.displayClientMessage(CommonComponents.EMPTY, true);
|
||||
|
||||
if (feedback.bb != null)
|
||||
Outliner.getInstance().chaseAABB("BeltSlicer", feedback.bb)
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
|
||||
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
|
||||
import net.createmod.catnip.animation.LerpedFloat;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.math.VecHelper;
|
||||
import net.createmod.catnip.nbt.NBTHelper;
|
||||
import net.minecraft.ChatFormatting;
|
||||
|
@ -38,6 +37,7 @@ import net.minecraft.core.HolderLookup;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
@ -508,14 +508,14 @@ public class DeployerBlockEntity extends KineticBlockEntity {
|
|||
.forGoggles(tooltip);
|
||||
|
||||
if (!heldItem.isEmpty())
|
||||
CreateLang.translate("tooltip.deployer.contains", Component.translatable(heldItem.getDescriptionId())
|
||||
.getString(), heldItem.getCount())
|
||||
.style(ChatFormatting.GREEN)
|
||||
.forGoggles(tooltip);
|
||||
CreateLang.translate("tooltip.deployer.contains", Component.translatable(heldItem.getDescriptionId())
|
||||
.getString(), heldItem.getCount())
|
||||
.style(ChatFormatting.GREEN)
|
||||
.forGoggles(tooltip);
|
||||
|
||||
float stressAtBase = calculateStressApplied();
|
||||
if (StressImpact.isEnabled() && !Mth.equal(stressAtBase, 0)) {
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
addStressImpactStats(tooltip, stressAtBase);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,14 +19,13 @@ import com.simibubi.create.foundation.gui.widget.Label;
|
|||
import com.simibubi.create.foundation.gui.widget.SelectionScrollInput;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.data.Pair;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.platform.CatnipServices;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
|
@ -93,9 +92,9 @@ public class AttributeFilterScreen extends AbstractFilterScreen<AttributeFilterM
|
|||
});
|
||||
blacklist.setToolTip(denyN);
|
||||
|
||||
whitelistDisIndicator = new Indicator(x + 47, y + 55, Lang.IMMUTABLE_EMPTY);
|
||||
whitelistConIndicator = new Indicator(x + 65, y + 55, Lang.IMMUTABLE_EMPTY);
|
||||
blacklistIndicator = new Indicator(x + 83, y + 55, Lang.IMMUTABLE_EMPTY);
|
||||
whitelistDisIndicator = new Indicator(x + 47, y + 55, CommonComponents.EMPTY);
|
||||
whitelistConIndicator = new Indicator(x + 65, y + 55, CommonComponents.EMPTY);
|
||||
blacklistIndicator = new Indicator(x + 83, y + 55, CommonComponents.EMPTY);
|
||||
|
||||
addRenderableWidgets(blacklist, whitelistCon, whitelistDis, blacklistIndicator, whitelistConIndicator,
|
||||
whitelistDisIndicator);
|
||||
|
@ -113,10 +112,10 @@ public class AttributeFilterScreen extends AbstractFilterScreen<AttributeFilterM
|
|||
|
||||
handleIndicators();
|
||||
|
||||
attributeSelectorLabel = new Label(x + 43, y + 28, Lang.IMMUTABLE_EMPTY).colored(0xF3EBDE)
|
||||
attributeSelectorLabel = new Label(x + 43, y + 28, CommonComponents.EMPTY).colored(0xF3EBDE)
|
||||
.withShadow();
|
||||
attributeSelector = new SelectionScrollInput(x + 39, y + 23, 137, 18);
|
||||
attributeSelector.forOptions(Arrays.asList(Lang.IMMUTABLE_EMPTY));
|
||||
attributeSelector.forOptions(Arrays.asList(CommonComponents.EMPTY));
|
||||
attributeSelector.removeCallback();
|
||||
referenceItemChanged(menu.ghostInventory.getStackInSlot(0));
|
||||
|
||||
|
@ -127,11 +126,11 @@ public class AttributeFilterScreen extends AbstractFilterScreen<AttributeFilterM
|
|||
selectedAttributes.add((menu.selectedAttributes.isEmpty() ? noSelectedT : selectedT).plainCopy()
|
||||
.withStyle(ChatFormatting.YELLOW));
|
||||
menu.selectedAttributes.forEach(at -> {
|
||||
selectedAttributes.add(Component.literal("- ")
|
||||
.append(at.attribute()
|
||||
.format(at.inverted()))
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
});
|
||||
selectedAttributes.add(Component.literal("- ")
|
||||
.append(at.attribute()
|
||||
.format(at.inverted()))
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
});
|
||||
}
|
||||
|
||||
private void referenceItemChanged(ItemStack stack) {
|
||||
|
@ -245,7 +244,7 @@ public class AttributeFilterScreen extends AbstractFilterScreen<AttributeFilterM
|
|||
if (menu.selectedAttributes.size() == 1)
|
||||
selectedAttributes.set(0, selectedT.plainCopy()
|
||||
.withStyle(ChatFormatting.YELLOW));
|
||||
selectedAttributes.add(Component.literal("- ").append(itemAttribute.format(inverted))
|
||||
selectedAttributes.add(Component.literal("- ").append(itemAttribute.format(inverted))
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.Objects;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.simibubi.create.AllDataComponents;
|
||||
|
@ -21,6 +20,7 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.component.DataComponentType;
|
||||
import net.minecraft.core.component.TypedDataComponent;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
|
@ -35,6 +35,7 @@ import net.minecraft.world.item.ItemStack;
|
|||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||
|
@ -80,7 +81,7 @@ public class FilterItem extends Item implements MenuProvider {
|
|||
List<Component> makeSummary = makeSummary(stack);
|
||||
if (makeSummary.isEmpty())
|
||||
return;
|
||||
tooltip.add(Component.literal(" "));
|
||||
tooltip.add(CommonComponents.SPACE);
|
||||
tooltip.addAll(makeSummary);
|
||||
}
|
||||
|
||||
|
@ -98,7 +99,7 @@ public class FilterItem extends Item implements MenuProvider {
|
|||
int count = 0;
|
||||
for (int i = 0; i < filterItems.getSlots(); i++) {
|
||||
if (count > 3) {
|
||||
list.add(Component.literal("- ...")
|
||||
list.add(Component.literal("- ...")
|
||||
.withStyle(ChatFormatting.DARK_GRAY));
|
||||
break;
|
||||
}
|
||||
|
@ -106,7 +107,7 @@ public class FilterItem extends Item implements MenuProvider {
|
|||
ItemStack filterStack = filterItems.getStackInSlot(i);
|
||||
if (filterStack.isEmpty())
|
||||
continue;
|
||||
list.add(Component.literal("- ")
|
||||
list.add(Component.literal("- ")
|
||||
.append(filterStack.getHoverName())
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
count++;
|
||||
|
@ -121,8 +122,8 @@ public class FilterItem extends Item implements MenuProvider {
|
|||
list.add((whitelistMode == AttributeFilterWhitelistMode.WHITELIST_CONJ
|
||||
? CreateLang.translateDirect("gui.attribute_filter.allow_list_conjunctive")
|
||||
: whitelistMode == AttributeFilterWhitelistMode.WHITELIST_DISJ
|
||||
? CreateLang.translateDirect("gui.attribute_filter.allow_list_disjunctive")
|
||||
: CreateLang.translateDirect("gui.attribute_filter.deny_list")).withStyle(ChatFormatting.GOLD));
|
||||
? CreateLang.translateDirect("gui.attribute_filter.allow_list_disjunctive")
|
||||
: CreateLang.translateDirect("gui.attribute_filter.deny_list")).withStyle(ChatFormatting.GOLD));
|
||||
|
||||
int count = 0;
|
||||
List<ItemAttribute.ItemAttributeEntry> attributes = filter.getOrDefault(AllDataComponents.ATTRIBUTE_FILTER_MATCHED_ATTRIBUTES, new ArrayList<>());
|
||||
|
@ -133,11 +134,11 @@ public class FilterItem extends Item implements MenuProvider {
|
|||
continue;
|
||||
boolean inverted = attributeEntry.inverted();
|
||||
if (count > 3) {
|
||||
list.add(Component.literal("- ...")
|
||||
list.add(Component.literal("- ...")
|
||||
.withStyle(ChatFormatting.DARK_GRAY));
|
||||
break;
|
||||
}
|
||||
list.add(Component.literal("- ")
|
||||
list.add(Component.literal("- ")
|
||||
.append(attribute.format(inverted)));
|
||||
count++;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import com.simibubi.create.foundation.gui.widget.IconButton;
|
|||
import com.simibubi.create.foundation.gui.widget.Indicator;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
@ -58,8 +58,8 @@ public class FilterScreen extends AbstractFilterScreen<FilterMenu> {
|
|||
sendOptionUpdate(Option.WHITELIST);
|
||||
});
|
||||
whitelist.setToolTip(allowN);
|
||||
blacklistIndicator = new Indicator(x + 18, y + 69, Lang.IMMUTABLE_EMPTY);
|
||||
whitelistIndicator = new Indicator(x + 36, y + 69, Lang.IMMUTABLE_EMPTY);
|
||||
blacklistIndicator = new Indicator(x + 18, y + 69, CommonComponents.EMPTY);
|
||||
whitelistIndicator = new Indicator(x + 36, y + 69, CommonComponents.EMPTY);
|
||||
addRenderableWidgets(blacklist, whitelist, blacklistIndicator, whitelistIndicator);
|
||||
|
||||
respectNBT = new IconButton(x + 60, y + 75, AllIcons.I_RESPECT_NBT);
|
||||
|
@ -74,8 +74,8 @@ public class FilterScreen extends AbstractFilterScreen<FilterMenu> {
|
|||
sendOptionUpdate(Option.IGNORE_DATA);
|
||||
});
|
||||
ignoreNBT.setToolTip(ignoreDataN);
|
||||
respectNBTIndicator = new Indicator(x + 60, y + 69, Lang.IMMUTABLE_EMPTY);
|
||||
ignoreNBTIndicator = new Indicator(x + 78, y + 69, Lang.IMMUTABLE_EMPTY);
|
||||
respectNBTIndicator = new Indicator(x + 60, y + 69, CommonComponents.EMPTY);
|
||||
ignoreNBTIndicator = new Indicator(x + 78, y + 69, CommonComponents.EMPTY);
|
||||
addRenderableWidgets(respectNBT, ignoreNBT, respectNBTIndicator, ignoreNBTIndicator);
|
||||
|
||||
handleIndicators();
|
||||
|
|
|
@ -19,10 +19,10 @@ import com.simibubi.create.foundation.fluid.FluidIngredient;
|
|||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.codec.ByteBufCodecs;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
|
@ -97,13 +97,13 @@ public class SequencedAssemblyRecipe implements Recipe<RecipeWrapper> {
|
|||
|
||||
for (RecipeHolder<SequencedAssemblyRecipe> holder : all) {
|
||||
if (holder.value().appliesTo(holder.id(), item)) {
|
||||
ProcessingRecipe<?> recipe = holder.value().getNextRecipe(item).getRecipe();
|
||||
ProcessingRecipe<?> recipe = holder.value().getNextRecipe(item).getRecipe();
|
||||
|
||||
if (recipe.getType() == type && recipeClass.isInstance(recipe)) {
|
||||
recipe.enforceNextResult(() -> holder.value().advance(holder.id(), item));
|
||||
R castedRecipe = recipeClass.cast(recipe);
|
||||
result.add(new RecipeHolder<>(recipe.id, castedRecipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,9 +165,9 @@ public class SequencedAssemblyRecipe implements Recipe<RecipeWrapper> {
|
|||
//noinspection DataFlowIssue
|
||||
return getTransitionalItem().getItem() == input.getItem() && input
|
||||
.has(AllDataComponents.SEQUENCED_ASSEMBLY) && input
|
||||
.get(AllDataComponents.SEQUENCED_ASSEMBLY)
|
||||
.id()
|
||||
.equals(id);
|
||||
.get(AllDataComponents.SEQUENCED_ASSEMBLY)
|
||||
.id()
|
||||
.equals(id);
|
||||
}
|
||||
|
||||
private SequencedRecipe<?> getNextRecipe(ItemStack input) {
|
||||
|
@ -244,7 +244,7 @@ public class SequencedAssemblyRecipe implements Recipe<RecipeWrapper> {
|
|||
int step = sequencedAssemblyRecipe.getStep(stack);
|
||||
int total = length * sequencedAssemblyRecipe.loops;
|
||||
List<Component> tooltip = event.getToolTip();
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.add(CreateLang.translateDirect("recipe.sequenced_assembly")
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
tooltip.add(CreateLang.translateDirect("recipe.assembly.progress", step, total)
|
||||
|
@ -261,9 +261,9 @@ public class SequencedAssemblyRecipe implements Recipe<RecipeWrapper> {
|
|||
tooltip.add(CreateLang.translateDirect("recipe.assembly.next", textComponent)
|
||||
.withStyle(ChatFormatting.AQUA));
|
||||
else {
|
||||
tooltip.add(Component.literal("-> ").append(textComponent)
|
||||
.withStyle(ChatFormatting.DARK_AQUA));
|
||||
}
|
||||
tooltip.add(Component.literal("-> ").append(textComponent)
|
||||
.withStyle(ChatFormatting.DARK_AQUA));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,13 +21,12 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
import com.simibubi.create.infrastructure.ponder.AllCreatePonderTags;
|
||||
|
||||
import dev.engine_room.flywheel.lib.transform.TransformStack;
|
||||
import net.createmod.catnip.data.Couple;
|
||||
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||
import net.createmod.catnip.gui.ScreenOpener;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.gui.widget.AbstractSimiWidget;
|
||||
import net.createmod.catnip.gui.widget.ElementWidget;
|
||||
import net.createmod.catnip.data.Couple;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.ponder.foundation.ui.PonderTagScreen;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
|
@ -35,6 +34,7 @@ import net.minecraft.client.gui.components.events.GuiEventListener;
|
|||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -94,9 +94,9 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
public void tick() {
|
||||
super.tick();
|
||||
if (sourceState != null && sourceState.getBlock() != minecraft.level.getBlockState(blockEntity.getSourcePosition())
|
||||
.getBlock()
|
||||
|| targetState != null && targetState.getBlock() != minecraft.level.getBlockState(blockEntity.getTargetPosition())
|
||||
.getBlock())
|
||||
.getBlock()
|
||||
|| targetState != null && targetState.getBlock() != minecraft.level.getBlockState(blockEntity.getTargetPosition())
|
||||
.getBlock())
|
||||
initGathererOptions();
|
||||
}
|
||||
|
||||
|
@ -138,15 +138,15 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
int rows = stats.maxRows();
|
||||
int startIndex = Math.min(blockEntity.targetLine, rows);
|
||||
|
||||
targetLineLabel = new Label(x + 65, y + 109, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
targetLineLabel = new Label(x + 65, y + 109, CommonComponents.EMPTY).withShadow();
|
||||
targetLineLabel.text = target.getLineOptionText(startIndex);
|
||||
|
||||
if (rows > 1) {
|
||||
targetLineSelector = new ScrollInput(x + 61, y + 105, 135, 16).withRange(0, rows)
|
||||
.titled(CreateLang.translateDirect("display_link.display_on"))
|
||||
.inverted()
|
||||
.calling(i -> targetLineLabel.text = target.getLineOptionText(i))
|
||||
.setState(startIndex);
|
||||
.titled(CreateLang.translateDirect("display_link.display_on"))
|
||||
.inverted()
|
||||
.calling(i -> targetLineLabel.text = target.getLineOptionText(i))
|
||||
.setState(startIndex);
|
||||
addRenderableWidget(targetLineSelector);
|
||||
}
|
||||
|
||||
|
@ -154,35 +154,35 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
}
|
||||
|
||||
sourceWidget = new ElementWidget(x + 37, y + 26)
|
||||
.showingElement(GuiGameElement.of(sourceIcon))
|
||||
.withCallback((mX, mY) -> {
|
||||
ScreenOpener.open(new PonderTagScreen(AllCreatePonderTags.DISPLAY_SOURCES));
|
||||
});
|
||||
.showingElement(GuiGameElement.of(sourceIcon))
|
||||
.withCallback((mX, mY) -> {
|
||||
ScreenOpener.open(new PonderTagScreen(AllCreatePonderTags.DISPLAY_SOURCES));
|
||||
});
|
||||
|
||||
sourceWidget.getToolTip().addAll(List.of(
|
||||
CreateLang.translateDirect("display_link.reading_from"),
|
||||
sourceState.getBlock().getName()
|
||||
.withStyle(s -> s.withColor(sources.isEmpty() ? 0xF68989 : 0xF2C16D)),
|
||||
CreateLang.translateDirect("display_link.attached_side"),
|
||||
CreateLang.translateDirect("display_link.view_compatible")
|
||||
.withStyle(ChatFormatting.GRAY)
|
||||
CreateLang.translateDirect("display_link.reading_from"),
|
||||
sourceState.getBlock().getName()
|
||||
.withStyle(s -> s.withColor(sources.isEmpty() ? 0xF68989 : 0xF2C16D)),
|
||||
CreateLang.translateDirect("display_link.attached_side"),
|
||||
CreateLang.translateDirect("display_link.view_compatible")
|
||||
.withStyle(ChatFormatting.GRAY)
|
||||
));
|
||||
|
||||
addRenderableWidget(sourceWidget);
|
||||
|
||||
targetWidget = new ElementWidget(x + 37, y + 105)
|
||||
.showingElement(GuiGameElement.of(targetIcon))
|
||||
.withCallback((mX, mY) -> {
|
||||
ScreenOpener.open(new PonderTagScreen(AllCreatePonderTags.DISPLAY_TARGETS));
|
||||
});
|
||||
.showingElement(GuiGameElement.of(targetIcon))
|
||||
.withCallback((mX, mY) -> {
|
||||
ScreenOpener.open(new PonderTagScreen(AllCreatePonderTags.DISPLAY_TARGETS));
|
||||
});
|
||||
|
||||
targetWidget.getToolTip().addAll(List.of(
|
||||
CreateLang.translateDirect("display_link.writing_to"),
|
||||
targetState.getBlock().getName()
|
||||
.withStyle(s -> s.withColor(target == null ? 0xF68989 : 0xF2C16D)),
|
||||
CreateLang.translateDirect("display_link.targeted_location"),
|
||||
CreateLang.translateDirect("display_link.view_compatible")
|
||||
.withStyle(ChatFormatting.GRAY)
|
||||
CreateLang.translateDirect("display_link.writing_to"),
|
||||
targetState.getBlock().getName()
|
||||
.withStyle(s -> s.withColor(target == null ? 0xF68989 : 0xF2C16D)),
|
||||
CreateLang.translateDirect("display_link.targeted_location"),
|
||||
CreateLang.translateDirect("display_link.view_compatible")
|
||||
.withStyle(ChatFormatting.GRAY)
|
||||
));
|
||||
|
||||
addRenderableWidget(targetWidget);
|
||||
|
@ -190,19 +190,19 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
if (!sources.isEmpty()) {
|
||||
int startIndex = Math.max(sources.indexOf(blockEntity.activeSource), 0);
|
||||
|
||||
sourceTypeLabel = new Label(x + 65, y + 30, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
sourceTypeLabel = new Label(x + 65, y + 30, CommonComponents.EMPTY).withShadow();
|
||||
sourceTypeLabel.text = sources.get(startIndex)
|
||||
.getName();
|
||||
.getName();
|
||||
|
||||
if (sources.size() > 1) {
|
||||
List<Component> options = sources.stream()
|
||||
.map(DisplaySource::getName)
|
||||
.toList();
|
||||
.map(DisplaySource::getName)
|
||||
.toList();
|
||||
sourceTypeSelector = new SelectionScrollInput(x + 61, y + 26, 135, 16).forOptions(options)
|
||||
.writingTo(sourceTypeLabel)
|
||||
.titled(CreateLang.translateDirect("display_link.information_type"))
|
||||
.calling(this::initGathererSourceSubOptions)
|
||||
.setState(startIndex);
|
||||
.writingTo(sourceTypeLabel)
|
||||
.titled(CreateLang.translateDirect("display_link.information_type"))
|
||||
.calling(this::initGathererSourceSubOptions)
|
||||
.setState(startIndex);
|
||||
sourceTypeSelector.onChanged();
|
||||
addRenderableWidget(sourceTypeSelector);
|
||||
} else
|
||||
|
@ -219,8 +219,8 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
|
||||
if (targetLineSelector != null)
|
||||
targetLineSelector
|
||||
.titled(source instanceof SingleLineDisplaySource ? CreateLang.translateDirect("display_link.display_on")
|
||||
: CreateLang.translateDirect("display_link.display_on_multiline"));
|
||||
.titled(source instanceof SingleLineDisplaySource ? CreateLang.translateDirect("display_link.display_on")
|
||||
: CreateLang.translateDirect("display_link.display_on_multiline"));
|
||||
|
||||
configWidgets.forEach(s -> {
|
||||
s.forEach(this::removeWidget);
|
||||
|
@ -229,9 +229,9 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
|
||||
DisplayLinkContext context = new DisplayLinkContext(minecraft.level, blockEntity);
|
||||
configWidgets.forEachWithContext((s, first) -> source.initConfigurationWidgets(context,
|
||||
new ModularGuiLineBuilder(font, s, guiLeft + 60, guiTop + (first ? 51 : 72)), first));
|
||||
new ModularGuiLineBuilder(font, s, guiLeft + 60, guiTop + (first ? 51 : 72)), first));
|
||||
configWidgets
|
||||
.forEach(s -> s.loadValues(blockEntity.getSourceConfig(), this::addRenderableWidget, this::addRenderableOnly));
|
||||
.forEach(s -> s.loadValues(blockEntity.getSourceConfig(), this::addRenderableWidget, this::addRenderableOnly));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -241,12 +241,12 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
|
||||
if (!sources.isEmpty()) {
|
||||
sourceData.putString("Id",
|
||||
sources.get(sourceTypeSelector == null ? 0 : sourceTypeSelector.getState()).id.toString());
|
||||
sources.get(sourceTypeSelector == null ? 0 : sourceTypeSelector.getState()).id.toString());
|
||||
configWidgets.forEach(s -> s.saveValues(sourceData));
|
||||
}
|
||||
|
||||
CatnipServices.NETWORK.sendToServer(new DisplayLinkConfigurationPacket(blockEntity.getBlockPos(), sourceData,
|
||||
targetLineSelector == null ? 0 : targetLineSelector.getState()));
|
||||
targetLineSelector == null ? 0 : targetLineSelector.getState()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -267,22 +267,22 @@ public class DisplayLinkScreen extends AbstractSimiScreen {
|
|||
ms.pushPose();
|
||||
ms.translate(0, guiTop + 46, 0);
|
||||
configWidgets.getFirst()
|
||||
.renderWidgetBG(guiLeft, graphics);
|
||||
.renderWidgetBG(guiLeft, graphics);
|
||||
ms.translate(0, 21, 0);
|
||||
configWidgets.getSecond()
|
||||
.renderWidgetBG(guiLeft, graphics);
|
||||
.renderWidgetBG(guiLeft, graphics);
|
||||
ms.popPose();
|
||||
|
||||
ms.pushPose();
|
||||
TransformStack.of(ms)
|
||||
.pushPose()
|
||||
.translate(x + background.getWidth() + 4, y + background.getHeight() + 4, 100)
|
||||
.scale(40)
|
||||
.rotateXDegrees(-22)
|
||||
.rotateYDegrees(63);
|
||||
.pushPose()
|
||||
.translate(x + background.getWidth() + 4, y + background.getHeight() + 4, 100)
|
||||
.scale(40)
|
||||
.rotateXDegrees(-22)
|
||||
.rotateYDegrees(63);
|
||||
GuiGameElement.of(blockEntity.getBlockState()
|
||||
.setValue(DisplayLinkBlock.FACING, Direction.UP))
|
||||
.render(graphics);
|
||||
.setValue(DisplayLinkBlock.FACING, Direction.UP))
|
||||
.render(graphics);
|
||||
ms.popPose();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,19 +14,21 @@ import com.simibubi.create.content.trains.display.FlapDisplayLayout;
|
|||
import com.simibubi.create.foundation.gui.ModularGuiLineBuilder;
|
||||
|
||||
import net.createmod.catnip.nbt.NBTProcessors;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public abstract class DisplaySource extends DisplayBehaviour {
|
||||
|
||||
public static final List<MutableComponent> EMPTY = ImmutableList.of(Component.empty());
|
||||
public static final MutableComponent EMPTY_LINE = Component.empty();
|
||||
public static final MutableComponent WHITESPACE;
|
||||
public static final MutableComponent EMPTY_LINE = Component.empty();
|
||||
public static final MutableComponent WHITESPACE;
|
||||
|
||||
static {
|
||||
WHITESPACE = Component.literal(" ");
|
||||
WHITESPACE = CommonComponents.space();
|
||||
}
|
||||
|
||||
public abstract List<MutableComponent> provideText(DisplayLinkContext context, DisplayTargetStats stats);
|
||||
|
@ -51,13 +53,21 @@ public abstract class DisplaySource extends DisplayBehaviour {
|
|||
activeTarget.acceptText(line, text, context);
|
||||
}
|
||||
|
||||
public void onSignalReset(DisplayLinkContext context) {};
|
||||
public void onSignalReset(DisplayLinkContext context) {
|
||||
}
|
||||
|
||||
public void populateData(DisplayLinkContext context) {};
|
||||
;
|
||||
|
||||
public void populateData(DisplayLinkContext context) {
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public int getPassiveRefreshTicks() {
|
||||
return 100;
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public boolean shouldPassiveReset() {
|
||||
return true;
|
||||
|
@ -76,7 +86,7 @@ public abstract class DisplaySource extends DisplayBehaviour {
|
|||
}
|
||||
|
||||
public void loadFlapDisplayLayout(DisplayLinkContext context, FlapDisplayBlockEntity flapDisplay,
|
||||
FlapDisplayLayout layout) {
|
||||
FlapDisplayLayout layout) {
|
||||
if (!layout.isLayout("Default"))
|
||||
layout.loadDefault(flapDisplay.getMaxCharCount());
|
||||
}
|
||||
|
@ -89,6 +99,7 @@ public abstract class DisplaySource extends DisplayBehaviour {
|
|||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void initConfigurationWidgets(DisplayLinkContext context, ModularGuiLineBuilder builder,
|
||||
boolean isFirstLine) {}
|
||||
boolean isFirstLine) {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@ import java.util.List;
|
|||
|
||||
import net.createmod.catnip.platform.CatnipServices;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import com.mojang.blaze3d.platform.InputConstants;
|
||||
|
@ -33,6 +31,7 @@ import net.minecraft.client.gui.LayeredDraw;
|
|||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -191,7 +190,7 @@ public class LinkedControllerClientHandler {
|
|||
.getShape(mc.level, selectedLocation);
|
||||
if (!shape.isEmpty())
|
||||
Outliner.getInstance().showAABB("controller", shape.bounds()
|
||||
.move(selectedLocation))
|
||||
.move(selectedLocation))
|
||||
.colored(0xB73C2D)
|
||||
.lineWidth(1 / 16f);
|
||||
|
||||
|
@ -200,8 +199,8 @@ public class LinkedControllerClientHandler {
|
|||
if (linkBehaviour != null) {
|
||||
CatnipServices.NETWORK.sendToServer(new LinkedControllerBindPacket(integer, selectedLocation));
|
||||
CreateLang.translate("linked_controller.key_bound", controls.get(integer)
|
||||
.getTranslatedKeyMessage()
|
||||
.getString())
|
||||
.getTranslatedKeyMessage()
|
||||
.getString())
|
||||
.sendStatus(mc.player);
|
||||
}
|
||||
MODE = Mode.IDLE;
|
||||
|
@ -215,8 +214,7 @@ public class LinkedControllerClientHandler {
|
|||
|
||||
public static void renderOverlay(GuiGraphics guiGraphics, DeltaTracker deltaTracker) {
|
||||
int width1 = guiGraphics.guiWidth();
|
||||
int height1 = guiGraphics.guiHeight();
|
||||
|
||||
int height1 = guiGraphics.guiHeight();
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.options.hideGui)
|
||||
return;
|
||||
|
@ -226,7 +224,7 @@ public class LinkedControllerClientHandler {
|
|||
|
||||
PoseStack poseStack = guiGraphics.pose();
|
||||
poseStack.pushPose();
|
||||
Screen tooltipScreen = new Screen(Lang.IMMUTABLE_EMPTY) {
|
||||
Screen tooltipScreen = new Screen(CommonComponents.EMPTY) {
|
||||
};
|
||||
tooltipScreen.init(mc, width1, height1);
|
||||
|
||||
|
|
|
@ -23,13 +23,12 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.FontHelper.Palette;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.client.renderer.Rect2i;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
|
@ -95,17 +94,17 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
playButton.withCallback(() -> {
|
||||
sendOptionUpdate(Option.PLAY, true);
|
||||
});
|
||||
playIndicator = new Indicator(x + 75, y + 79, Lang.IMMUTABLE_EMPTY);
|
||||
playIndicator = new Indicator(x + 75, y + 79, CommonComponents.EMPTY);
|
||||
pauseButton = new IconButton(x + 93, y + 85, AllIcons.I_PAUSE);
|
||||
pauseButton.withCallback(() -> {
|
||||
sendOptionUpdate(Option.PAUSE, true);
|
||||
});
|
||||
pauseIndicator = new Indicator(x + 93, y + 79, Lang.IMMUTABLE_EMPTY);
|
||||
pauseIndicator = new Indicator(x + 93, y + 79, CommonComponents.EMPTY);
|
||||
resetButton = new IconButton(x + 111, y + 85, AllIcons.I_STOP);
|
||||
resetButton.withCallback(() -> {
|
||||
sendOptionUpdate(Option.STOP, true);
|
||||
});
|
||||
resetIndicator = new Indicator(x + 111, y + 79, Lang.IMMUTABLE_EMPTY);
|
||||
resetIndicator = new Indicator(x + 111, y + 79, CommonComponents.EMPTY);
|
||||
resetIndicator.state = State.RED;
|
||||
addRenderableWidgets(playButton, playIndicator, pauseButton, pauseIndicator, resetButton,
|
||||
resetIndicator);
|
||||
|
@ -122,7 +121,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
});
|
||||
showSettingsButton.setToolTip(CreateLang.translateDirect(_showSettings));
|
||||
addRenderableWidget(showSettingsButton);
|
||||
showSettingsIndicator = new Indicator(x + 9, y + 111, Lang.IMMUTABLE_EMPTY);
|
||||
showSettingsIndicator = new Indicator(x + 9, y + 111, CommonComponents.EMPTY);
|
||||
// addRenderableWidget(showSettingsIndicator);
|
||||
|
||||
extraAreas = ImmutableList.of(new Rect2i(x + BG_TOP.getWidth(), y + BG_TOP.getHeight() + BG_BOTTOM.getHeight() - 62, 84, 92));
|
||||
|
@ -151,7 +150,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
CreateLang.translateDirect("gui.schematicannon.option.replaceWithEmpty"));
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
replaceLevelIndicators.add(new Indicator(x + 33 + i * 18, y + 111, Lang.IMMUTABLE_EMPTY));
|
||||
replaceLevelIndicators.add(new Indicator(x + 33 + i * 18, y + 111, CommonComponents.EMPTY));
|
||||
IconButton replaceLevelButton = new IconButton(x + 33 + i * 18, y + 111, icons.get(i));
|
||||
int replaceMode = i;
|
||||
replaceLevelButton.withCallback(() -> {
|
||||
|
@ -170,7 +169,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
sendOptionUpdate(Option.SKIP_MISSING, !menu.contentHolder.skipMissing);
|
||||
});
|
||||
skipMissingButton.setToolTip(CreateLang.translateDirect("gui.schematicannon.option.skipMissing"));
|
||||
skipMissingIndicator = new Indicator(x + 111, y + 111, Lang.IMMUTABLE_EMPTY);
|
||||
skipMissingIndicator = new Indicator(x + 111, y + 111, CommonComponents.EMPTY);
|
||||
Collections.addAll(placementSettingWidgets, skipMissingButton);
|
||||
|
||||
skipBlockEntitiesButton = new IconButton(x + 135, y + 111, AllIcons.I_SKIP_BLOCK_ENTITIES);
|
||||
|
@ -178,7 +177,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
sendOptionUpdate(Option.SKIP_BLOCK_ENTITIES, !menu.contentHolder.replaceBlockEntities);
|
||||
});
|
||||
skipBlockEntitiesButton.setToolTip(CreateLang.translateDirect("gui.schematicannon.option.skipBlockEntities"));
|
||||
skipBlockEntitiesIndicator = new Indicator(x + 129, y + 111, Lang.IMMUTABLE_EMPTY);
|
||||
skipBlockEntitiesIndicator = new Indicator(x + 129, y + 111, CommonComponents.EMPTY);
|
||||
Collections.addAll(placementSettingWidgets, skipBlockEntitiesButton);
|
||||
|
||||
addRenderableWidgets(placementSettingWidgets);
|
||||
|
@ -208,26 +207,26 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
resetIndicator.state = State.OFF;
|
||||
|
||||
switch (be.state) {
|
||||
case PAUSED:
|
||||
pauseIndicator.state = State.YELLOW;
|
||||
playButton.active = true;
|
||||
pauseButton.active = false;
|
||||
resetButton.active = true;
|
||||
break;
|
||||
case RUNNING:
|
||||
playIndicator.state = State.GREEN;
|
||||
playButton.active = false;
|
||||
pauseButton.active = true;
|
||||
resetButton.active = true;
|
||||
break;
|
||||
case STOPPED:
|
||||
resetIndicator.state = State.RED;
|
||||
playButton.active = true;
|
||||
pauseButton.active = false;
|
||||
resetButton.active = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case PAUSED:
|
||||
pauseIndicator.state = State.YELLOW;
|
||||
playButton.active = true;
|
||||
pauseButton.active = false;
|
||||
resetButton.active = true;
|
||||
break;
|
||||
case RUNNING:
|
||||
playIndicator.state = State.GREEN;
|
||||
playButton.active = false;
|
||||
pauseButton.active = true;
|
||||
resetButton.active = true;
|
||||
break;
|
||||
case STOPPED:
|
||||
resetIndicator.state = State.RED;
|
||||
playButton.active = true;
|
||||
pauseButton.active = false;
|
||||
resetButton.active = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
handleTooltips();
|
||||
|
@ -294,7 +293,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
renderBlueprintHighlight(graphics, x, y);
|
||||
|
||||
GuiGameElement.of(renderedItem).<GuiGameElement
|
||||
.GuiRenderBuilder>at(x + BG_TOP.getWidth(), y + BG_TOP.getHeight() + BG_BOTTOM.getHeight() - 48, -200)
|
||||
.GuiRenderBuilder>at(x + BG_TOP.getWidth(), y + BG_TOP.getHeight() + BG_BOTTOM.getHeight() - 48, -200)
|
||||
.scale(5)
|
||||
.render(graphics);
|
||||
|
||||
|
@ -306,7 +305,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
if (be.missingItem != null) {
|
||||
stringWidth += 16;
|
||||
GuiGameElement.of(be.missingItem).<GuiGameElement
|
||||
.GuiRenderBuilder>at(x + 128, y + 49, 100)
|
||||
.GuiRenderBuilder>at(x + 128, y + 49, 100)
|
||||
.scale(1)
|
||||
.render(graphics);
|
||||
}
|
||||
|
@ -395,8 +394,8 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
|
||||
if (be.hasCreativeCrate) {
|
||||
tooltip.add(CreateLang.translateDirect(_gunpowderLevel, "" + 100));
|
||||
tooltip.add(Component.literal("(").append(AllBlocks.CREATIVE_CRATE.get()
|
||||
.getName())
|
||||
tooltip.add(Component.literal("(").append(AllBlocks.CREATIVE_CRATE.get()
|
||||
.getName())
|
||||
.append(")")
|
||||
.withStyle(DARK_PURPLE));
|
||||
return tooltip;
|
||||
|
@ -404,14 +403,14 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
|
|||
|
||||
int fillPercent = (int) ((be.remainingFuel / (float) be.getShotsPerGunpowder()) * 100);
|
||||
tooltip.add(CreateLang.translateDirect(_gunpowderLevel, fillPercent));
|
||||
tooltip.add(CreateLang.translateDirect(_shotsRemaining, Component.literal(Integer.toString(shotsLeft)).withStyle(BLUE))
|
||||
tooltip.add(CreateLang.translateDirect(_shotsRemaining, Component.literal(Integer.toString(shotsLeft)).withStyle(BLUE))
|
||||
.withStyle(GRAY));
|
||||
if (shotsLeftWithItems != shotsLeft) {
|
||||
tooltip.add(CreateLang
|
||||
.translateDirect(_shotsRemainingWithBackup,
|
||||
Component.literal(Integer.toString(shotsLeftWithItems)).withStyle(BLUE))
|
||||
.withStyle(GRAY));
|
||||
}
|
||||
tooltip.add(CreateLang
|
||||
.translateDirect(_shotsRemainingWithBackup,
|
||||
Component.literal(Integer.toString(shotsLeftWithItems)).withStyle(BLUE))
|
||||
.withStyle(GRAY));
|
||||
}
|
||||
|
||||
return tooltip;
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
|
||||
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.Mirror;
|
||||
|
@ -29,9 +29,9 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlac
|
|||
public class SchematicEditScreen extends AbstractSimiScreen {
|
||||
|
||||
private final List<Component> rotationOptions =
|
||||
CreateLang.translatedOptions("schematic.rotation", "none", "cw90", "cw180", "cw270");
|
||||
CreateLang.translatedOptions("schematic.rotation", "none", "cw90", "cw180", "cw270");
|
||||
private final List<Component> mirrorOptions =
|
||||
CreateLang.translatedOptions("schematic.mirror", "none", "leftRight", "frontBack");
|
||||
CreateLang.translatedOptions("schematic.mirror", "none", "leftRight", "frontBack");
|
||||
private final Component rotationLabel = CreateLang.translateDirect("schematic.rotation");
|
||||
private final Component mirrorLabel = CreateLang.translateDirect("schematic.mirror");
|
||||
|
||||
|
@ -60,12 +60,12 @@ public class SchematicEditScreen extends AbstractSimiScreen {
|
|||
int x = guiLeft;
|
||||
int y = guiTop + 2;
|
||||
|
||||
xInput = new EditBox(font, x + 50, y + 26, 34, 10, Lang.IMMUTABLE_EMPTY);
|
||||
yInput = new EditBox(font, x + 90, y + 26, 34, 10, Lang.IMMUTABLE_EMPTY);
|
||||
zInput = new EditBox(font, x + 130, y + 26, 34, 10, Lang.IMMUTABLE_EMPTY);
|
||||
xInput = new EditBox(font, x + 50, y + 26, 34, 10, CommonComponents.EMPTY);
|
||||
yInput = new EditBox(font, x + 90, y + 26, 34, 10, CommonComponents.EMPTY);
|
||||
zInput = new EditBox(font, x + 130, y + 26, 34, 10, CommonComponents.EMPTY);
|
||||
|
||||
BlockPos anchor = handler.getTransformation()
|
||||
.getAnchor();
|
||||
.getAnchor();
|
||||
if (handler.isDeployed()) {
|
||||
xInput.setValue("" + anchor.getX());
|
||||
yInput.setValue("" + anchor.getY());
|
||||
|
@ -77,7 +77,7 @@ public class SchematicEditScreen extends AbstractSimiScreen {
|
|||
zInput.setValue("" + alt.getZ());
|
||||
}
|
||||
|
||||
for (EditBox widget : new EditBox[] { xInput, yInput, zInput }) {
|
||||
for (EditBox widget : new EditBox[]{xInput, yInput, zInput}) {
|
||||
widget.setMaxLength(6);
|
||||
widget.setBordered(false);
|
||||
widget.setTextColor(0xFFFFFF);
|
||||
|
@ -97,14 +97,14 @@ public class SchematicEditScreen extends AbstractSimiScreen {
|
|||
|
||||
StructurePlaceSettings settings = handler.getTransformation()
|
||||
.toSettings();
|
||||
Label labelR = new Label(x + 50, y + 48, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
Label labelR = new Label(x + 50, y + 48, CommonComponents.EMPTY).withShadow();
|
||||
rotationArea = new SelectionScrollInput(x + 45, y + 43, 118, 18).forOptions(rotationOptions)
|
||||
.titled(rotationLabel.plainCopy())
|
||||
.setState(settings.getRotation()
|
||||
.ordinal())
|
||||
.writingTo(labelR);
|
||||
|
||||
Label labelM = new Label(x + 50, y + 70, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
Label labelM = new Label(x + 50, y + 70, CommonComponents.EMPTY).withShadow();
|
||||
mirrorArea = new SelectionScrollInput(x + 45, y + 65, 118, 18).forOptions(mirrorOptions)
|
||||
.titled(mirrorLabel.plainCopy())
|
||||
.setState(settings.getMirror()
|
||||
|
@ -161,9 +161,9 @@ public class SchematicEditScreen extends AbstractSimiScreen {
|
|||
graphics.drawString(font, title, x + (background.getWidth() - 8 - font.width(title)) / 2, y + 4, 0x505050, false);
|
||||
|
||||
GuiGameElement.of(AllItems.SCHEMATIC.asStack())
|
||||
.<GuiGameElement.GuiRenderBuilder>at(x + background.getWidth() + 6, y + background.getHeight() - 40, -200)
|
||||
.scale(3)
|
||||
.render(graphics);
|
||||
.<GuiGameElement.GuiRenderBuilder>at(x + background.getWidth() + 6, y + background.getHeight() - 40, -200)
|
||||
.scale(3)
|
||||
.render(graphics);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.simibubi.create.content.schematics.client;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import com.simibubi.create.AllItems;
|
||||
|
@ -15,6 +13,7 @@ import net.createmod.catnip.gui.AbstractSimiScreen;
|
|||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class SchematicPromptScreen extends AbstractSimiScreen {
|
||||
|
@ -43,7 +42,7 @@ public class SchematicPromptScreen extends AbstractSimiScreen {
|
|||
int x = guiLeft;
|
||||
int y = guiTop + 2;
|
||||
|
||||
nameField = new EditBox(font, x + 49, y + 26, 131, 10, Lang.IMMUTABLE_EMPTY);
|
||||
nameField = new EditBox(font, x + 49, y + 26, 131, 10, CommonComponents.EMPTY);
|
||||
nameField.setTextColor(-1);
|
||||
nameField.setTextColorUneditable(-1);
|
||||
nameField.setBordered(false);
|
||||
|
@ -84,13 +83,13 @@ public class SchematicPromptScreen extends AbstractSimiScreen {
|
|||
graphics.drawString(font, title, x + (background.getWidth() - 8 - font.width(title)) / 2, y + 4, 0x505050, false);
|
||||
|
||||
GuiGameElement.of(AllItems.SCHEMATIC.asStack())
|
||||
.at(x + 22, y + 24, 0)
|
||||
.render(graphics);
|
||||
.at(x + 22, y + 24, 0)
|
||||
.render(graphics);
|
||||
|
||||
GuiGameElement.of(AllItems.SCHEMATIC_AND_QUILL.asStack())
|
||||
.scale(3)
|
||||
.at(x + background.getWidth() + 6, y + background.getHeight() - 38, -200)
|
||||
.render(graphics);
|
||||
.scale(3)
|
||||
.at(x + background.getWidth() + 6, y + background.getHeight() - 38, -200)
|
||||
.render(graphics);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,12 +21,11 @@ import com.simibubi.create.foundation.gui.widget.SelectionScrollInput;
|
|||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.renderer.Rect2i;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -57,7 +56,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
|
|||
private List<Rect2i> extraAreas = Collections.emptyList();
|
||||
|
||||
public SchematicTableScreen(SchematicTableMenu menu, Inventory playerInventory,
|
||||
Component title) {
|
||||
Component title) {
|
||||
super(menu, playerInventory, title);
|
||||
background = AllGuiTextures.SCHEMATIC_TABLE;
|
||||
}
|
||||
|
@ -74,8 +73,8 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
|
|||
int x = leftPos;
|
||||
int y = topPos + 2;
|
||||
|
||||
schematicsLabel = new Label(x + 51, y + 26, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
schematicsLabel.text = Lang.IMMUTABLE_EMPTY;
|
||||
schematicsLabel = new Label(x + 51, y + 26, CommonComponents.EMPTY).withShadow();
|
||||
schematicsLabel.text = CommonComponents.EMPTY;
|
||||
if (!availableSchematics.isEmpty()) {
|
||||
schematicsArea =
|
||||
new SelectionScrollInput(x + 45, y + 21, 139, 18).forOptions(availableSchematics)
|
||||
|
@ -119,7 +118,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
|
|||
addRenderableWidget(schematicsArea);
|
||||
} else {
|
||||
schematicsArea = null;
|
||||
schematicsLabel.text = Lang.IMMUTABLE_EMPTY;
|
||||
schematicsLabel.text = CommonComponents.EMPTY;
|
||||
}
|
||||
});
|
||||
refreshButton.setToolTip(refresh);
|
||||
|
@ -191,11 +190,11 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
|
|||
if (schematicsLabel != null) {
|
||||
schematicsLabel.colored(0xCCDDFF);
|
||||
String uploadingSchematic = menu.contentHolder.uploadingSchematic;
|
||||
if (uploadingSchematic == null) {
|
||||
schematicsLabel.text = null;
|
||||
} else {
|
||||
schematicsLabel.text = Component.literal(uploadingSchematic);
|
||||
}
|
||||
if (uploadingSchematic == null) {
|
||||
schematicsLabel.text = null;
|
||||
} else {
|
||||
schematicsLabel.text = Component.literal(uploadingSchematic);
|
||||
}
|
||||
}
|
||||
if (schematicsArea != null)
|
||||
schematicsArea.visible = false;
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
|
|||
import com.simibubi.create.foundation.utility.DyeHelper;
|
||||
import com.simibubi.create.foundation.utility.DynamicComponent;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.nbt.NBTHelper;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
|
@ -18,6 +17,7 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.Vec3i;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -150,7 +150,7 @@ public class FlapDisplayBlockEntity extends KineticBlockEntity {
|
|||
FlapDisplaySection flapDisplaySection = sections.get(0);
|
||||
if (componentText == null) {
|
||||
manualLines[lineIndex] = false;
|
||||
flapDisplaySection.setText(Lang.IMMUTABLE_EMPTY);
|
||||
flapDisplaySection.setText(CommonComponents.EMPTY);
|
||||
notifyUpdate();
|
||||
return;
|
||||
}
|
||||
|
@ -314,13 +314,14 @@ public class FlapDisplayBlockEntity extends KineticBlockEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {}
|
||||
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
|
||||
}
|
||||
|
||||
public int getLineColor(int line) {
|
||||
DyeColor color = colour[line];
|
||||
return color == null ? 0xFF_D3C6BA
|
||||
: DyeHelper.getDyeColors(color)
|
||||
.getFirst() | 0xFF_000000;
|
||||
.getFirst() | 0xFF_000000;
|
||||
}
|
||||
|
||||
public boolean isLineGlowing(int line) {
|
||||
|
|
|
@ -29,7 +29,6 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||
|
||||
import net.createmod.catnip.data.Couple;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.math.VecHelper;
|
||||
import net.createmod.catnip.theme.Color;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -38,6 +37,7 @@ import net.minecraft.core.Direction.Axis;
|
|||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
|
@ -51,6 +51,7 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
|
@ -90,7 +91,7 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
firstPositionUpdate = true;
|
||||
arrivalSoundTicks = Integer.MIN_VALUE;
|
||||
derailParticleOffset = VecHelper.offsetRandomly(Vec3.ZERO, world.random, 1.5f)
|
||||
.multiply(1, .25f, 1);
|
||||
.multiply(1, .25f, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -157,7 +158,7 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
}
|
||||
|
||||
public boolean isLocalCoordWithin(BlockPos localPos, int min, int max) {
|
||||
if (!(getContraption()instanceof CarriageContraption cc))
|
||||
if (!(getContraption() instanceof CarriageContraption cc))
|
||||
return false;
|
||||
Direction facing = cc.getAssemblyDirection();
|
||||
Axis axis = facing.getClockWise()
|
||||
|
@ -389,7 +390,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void handleStallInformation(double x, double y, double z, float angle) {}
|
||||
protected void handleStallInformation(double x, double y, double z, float angle) {
|
||||
}
|
||||
|
||||
Vec3 derailParticleOffset;
|
||||
|
||||
|
@ -591,7 +593,7 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
boolean spaceDown = heldControls.contains(4);
|
||||
GlobalStation currentStation = carriage.train.getCurrentStation();
|
||||
if (currentStation != null && spaceDown) {
|
||||
sendPrompt(player, CreateLang.translateDirect("train.arrived_at",
|
||||
sendPrompt(player, CreateLang.translateDirect("train.arrived_at",
|
||||
Component.literal(currentStation.name).withStyle(s -> s.withColor(0x704630))), false);
|
||||
return true;
|
||||
}
|
||||
|
@ -603,7 +605,7 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
|
||||
if (currentStation != null && targetSpeed != 0) {
|
||||
stationMessage = false;
|
||||
sendPrompt(player, CreateLang.translateDirect("train.departing_from",
|
||||
sendPrompt(player, CreateLang.translateDirect("train.departing_from",
|
||||
Component.literal(currentStation.name).withStyle(s -> s.withColor(0x704630))), false);
|
||||
}
|
||||
|
||||
|
@ -617,8 +619,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
double f = (nav.distanceToDestination / navDistanceTotal);
|
||||
int progress = (int) (Mth.clamp(1 - ((1 - f) * (1 - f)), 0, 1) * 30);
|
||||
boolean arrived = progress == 0;
|
||||
MutableComponent whiteComponent = Component.literal(Strings.repeat("|", progress));
|
||||
MutableComponent greenComponent = Component.literal(Strings.repeat("|", 30 - progress));
|
||||
MutableComponent whiteComponent = Component.literal(Strings.repeat("|", progress));
|
||||
MutableComponent greenComponent = Component.literal(Strings.repeat("|", 30 - progress));
|
||||
|
||||
int fromColor = 0x00_FFC244;
|
||||
int toColor = 0x00_529915;
|
||||
|
@ -691,7 +693,7 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
|||
private void cleanUpApproachStationMessage(Player player) {
|
||||
if (!stationMessage)
|
||||
return;
|
||||
player.displayClientMessage(Lang.IMMUTABLE_EMPTY, true);
|
||||
player.displayClientMessage(CommonComponents.EMPTY, true);
|
||||
stationMessage = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.createmod.catnip.nbt.NBTHelper;
|
|||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.util.Mth;
|
||||
|
@ -288,7 +289,7 @@ public class ScheduleRuntime {
|
|||
}
|
||||
|
||||
private int predictForEntry(int index, String currentTitle, int accumulatedTime,
|
||||
Collection<TrainDeparturePrediction> predictions) {
|
||||
Collection<TrainDeparturePrediction> predictions) {
|
||||
ScheduleEntry entry = schedule.entries.get(index);
|
||||
if (!(entry.instruction instanceof DestinationInstruction filter))
|
||||
return accumulatedTime;
|
||||
|
@ -327,7 +328,8 @@ public class ScheduleRuntime {
|
|||
}
|
||||
|
||||
ScheduleEntry scheduleEntry = schedule.entries.get(index);
|
||||
Columns: for (List<ScheduleWaitCondition> list : scheduleEntry.conditions) {
|
||||
Columns:
|
||||
for (List<ScheduleWaitCondition> list : scheduleEntry.conditions) {
|
||||
int total = 0;
|
||||
for (ScheduleWaitCondition condition : list) {
|
||||
if (!(condition instanceof ScheduledDelay wait))
|
||||
|
@ -347,7 +349,7 @@ public class ScheduleRuntime {
|
|||
int size = schedule.entries.size();
|
||||
if (index >= size) {
|
||||
if (!schedule.cyclic) {
|
||||
return new TrainDeparturePrediction(train, time, Component.literal(" "), destination);
|
||||
return new TrainDeparturePrediction(train, time, CommonComponents.space(), destination);
|
||||
}
|
||||
index %= size;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ import net.createmod.catnip.data.IntAttached;
|
|||
import net.createmod.catnip.data.Pair;
|
||||
import net.createmod.catnip.animation.LerpedFloat;
|
||||
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
|
@ -54,6 +53,7 @@ import net.minecraft.client.gui.components.EditBox;
|
|||
import net.minecraft.client.gui.components.Renderable;
|
||||
import net.minecraft.client.renderer.Rect2i;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.FormattedCharSequence;
|
||||
import net.minecraft.util.Mth;
|
||||
|
@ -114,7 +114,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
confirmButton.withCallback(() -> minecraft.player.closeContainer());
|
||||
addRenderableWidget(confirmButton);
|
||||
|
||||
cyclicIndicator = new Indicator(leftPos + 21, topPos + 196, Lang.IMMUTABLE_EMPTY);
|
||||
cyclicIndicator = new Indicator(leftPos + 21, topPos + 196, CommonComponents.EMPTY);
|
||||
cyclicIndicator.state = schedule.cyclic ? State.ON : State.OFF;
|
||||
|
||||
List<Component> tip = new ArrayList<>();
|
||||
|
@ -179,7 +179,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
resetProgress.visible = false;
|
||||
|
||||
scrollInput = new SelectionScrollInput(leftPos + 56, topPos + 65, 143, 16);
|
||||
scrollInputLabel = new Label(leftPos + 59, topPos + 69, Lang.IMMUTABLE_EMPTY).withShadow();
|
||||
scrollInputLabel = new Label(leftPos + 59, topPos + 69, CommonComponents.EMPTY).withShadow();
|
||||
editorConfirm = new IconButton(leftPos + 56 + 168, topPos + 65 + 22, AllIcons.I_CONFIRM);
|
||||
if (allowDeletion)
|
||||
editorDelete = new IconButton(leftPos + 56 - 45, topPos + 65 + 22, AllIcons.I_TRASH);
|
||||
|
@ -325,7 +325,8 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
String filter = destination.getFilterForRegex();
|
||||
if (filter.isBlank())
|
||||
continue;
|
||||
Graphs: for (Iterator<TrackGraph> iterator = viableGraphs.iterator(); iterator.hasNext();) {
|
||||
Graphs:
|
||||
for (Iterator<TrackGraph> iterator = viableGraphs.iterator(); iterator.hasNext(); ) {
|
||||
TrackGraph trackGraph = iterator.next();
|
||||
for (GlobalStation station : trackGraph.getPoints(EdgePointType.STATION)) {
|
||||
if (station.name.matches(filter))
|
||||
|
@ -484,7 +485,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
}
|
||||
|
||||
public int renderScheduleEntry(GuiGraphics graphics, ScheduleEntry entry, int yOffset, int mouseX, int mouseY,
|
||||
float partialTicks) {
|
||||
float partialTicks) {
|
||||
int zLevel = -100;
|
||||
|
||||
AllGuiTextures light = AllGuiTextures.SCHEDULE_CARD_LIGHT;
|
||||
|
@ -536,7 +537,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
}
|
||||
|
||||
public void renderScheduleConditions(GuiGraphics graphics, ScheduleEntry entry, int yOffset, int mouseX, int mouseY,
|
||||
float partialTicks, int cardHeight, int entryIndex) {
|
||||
float partialTicks, int cardHeight, int entryIndex) {
|
||||
int cardWidth = CARD_WIDTH;
|
||||
int cardHeader = CARD_HEADER;
|
||||
|
||||
|
@ -606,7 +607,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
}
|
||||
|
||||
protected int renderInput(GuiGraphics graphics, Pair<ItemStack, Component> pair, int x, int y, boolean clean,
|
||||
int minSize) {
|
||||
int minSize) {
|
||||
ItemStack stack = pair.getFirst();
|
||||
Component text = pair.getSecond();
|
||||
boolean hasItem = !stack.isEmpty();
|
||||
|
@ -651,7 +652,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
if (editingCondition != null || editingDestination != null)
|
||||
return false;
|
||||
|
||||
Component empty = Lang.IMMUTABLE_EMPTY;
|
||||
Component empty = CommonComponents.EMPTY;
|
||||
|
||||
int mx = (int) mouseX;
|
||||
int my = (int) mouseY;
|
||||
|
@ -982,7 +983,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
super.renderForeground(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
GuiGameElement.of(menu.contentHolder).<GuiGameElement
|
||||
.GuiRenderBuilder>at(leftPos + AllGuiTextures.SCHEDULE.getWidth(),
|
||||
.GuiRenderBuilder>at(leftPos + AllGuiTextures.SCHEDULE.getWidth(),
|
||||
topPos + AllGuiTextures.SCHEDULE.getHeight() - 56, -200)
|
||||
.scale(3)
|
||||
.render(graphics);
|
||||
|
@ -1034,7 +1035,7 @@ public class ScheduleScreen extends AbstractSimiContainerScreen<ScheduleMenu> im
|
|||
formattedcharsequence = editingCondition == null ? CreateLang.translateDirect("schedule.instruction.editor")
|
||||
.getVisualOrderText()
|
||||
: CreateLang.translateDirect("schedule.condition.editor")
|
||||
.getVisualOrderText();
|
||||
.getVisualOrderText();
|
||||
graphics.drawString(font, formattedcharsequence, (float) (center - font.width(formattedcharsequence) / 2),
|
||||
(float) topPos + 44, 0x505050, false);
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.simibubi.create.content.trains.station;
|
|||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import com.simibubi.create.AllBlockEntityTypes;
|
||||
import com.simibubi.create.AllMapDecorationTypes;
|
||||
import com.simibubi.create.content.trains.track.TrackTargetingBehaviour;
|
||||
|
@ -15,6 +13,7 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.saveddata.maps.MapDecoration;
|
||||
|
@ -36,7 +35,7 @@ public class StationMarker {
|
|||
BlockPos source = NBTHelper.readBlockPos(tag, "source");
|
||||
BlockPos target = NBTHelper.readBlockPos(tag, "target");
|
||||
Component name = Component.Serializer.fromJson(tag.getString("name"), registries);
|
||||
if (name == null) name = Lang.IMMUTABLE_EMPTY;
|
||||
if (name == null) name = CommonComponents.EMPTY;
|
||||
|
||||
return new StationMarker(source, target, name);
|
||||
}
|
||||
|
|
|
@ -23,14 +23,14 @@ import net.createmod.catnip.platform.CatnipServices;
|
|||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
|
||||
import net.createmod.catnip.gui.UIRenderHelper;
|
||||
import net.createmod.catnip.animation.AnimationTickHolder;
|
||||
import net.createmod.catnip.data.Pair;
|
||||
import net.createmod.catnip.animation.LerpedFloat;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.data.Pair;
|
||||
import net.createmod.catnip.gui.UIRenderHelper;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.util.Mth;
|
||||
|
@ -120,7 +120,7 @@ public class StationScreen extends AbstractStationScreen {
|
|||
addRenderableWidget(colorTypeScroll);
|
||||
|
||||
onTextChanged = s -> trainNameBox.setX(nameBoxX(s, trainNameBox));
|
||||
trainNameBox = new EditBox(font, x + 23, y + 47, background.getWidth() - 75, 10, Lang.IMMUTABLE_EMPTY);
|
||||
trainNameBox = new EditBox(font, x + 23, y + 47, background.getWidth() - 75, 10, CommonComponents.EMPTY);
|
||||
trainNameBox.setBordered(false);
|
||||
trainNameBox.setMaxLength(35);
|
||||
trainNameBox.setTextColor(0xC6C6C6);
|
||||
|
@ -161,7 +161,7 @@ public class StationScreen extends AbstractStationScreen {
|
|||
|
||||
updateAssemblyTooltip(blockEntity.edgePoint.isOnCurve() ? "no_assembly_curve"
|
||||
: !blockEntity.edgePoint.isOrthogonal() ? "no_assembly_diagonal"
|
||||
: trainPresent() && !blockEntity.trainCanDisassemble ? "train_not_aligned" : null);
|
||||
: trainPresent() && !blockEntity.trainCanDisassemble ? "train_not_aligned" : null);
|
||||
}
|
||||
|
||||
private void tickTrainDisplay() {
|
||||
|
@ -263,7 +263,7 @@ public class StationScreen extends AbstractStationScreen {
|
|||
newTrainButton.setToolTip(CreateLang.translateDirect("station.create_train"));
|
||||
return;
|
||||
}
|
||||
for (IconButton ib : new IconButton[] { disassembleTrainButton, newTrainButton }) {
|
||||
for (IconButton ib : new IconButton[]{disassembleTrainButton, newTrainButton}) {
|
||||
List<Component> toolTip = ib.getToolTip();
|
||||
toolTip.clear();
|
||||
toolTip.add(CreateLang.translateDirect("station." + key)
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.client.renderer.MultiBufferSource;
|
|||
import net.minecraft.client.renderer.entity.ItemRenderer;
|
||||
import net.minecraft.client.resources.model.BakedModel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -30,8 +30,8 @@ import net.minecraft.world.phys.Vec3;
|
|||
public class ValueBox extends ChasingAABBOutline {
|
||||
|
||||
protected Component label;
|
||||
protected Component sublabel = Lang.IMMUTABLE_EMPTY;
|
||||
protected Component scrollTooltip = Lang.IMMUTABLE_EMPTY;
|
||||
protected Component sublabel = CommonComponents.EMPTY;
|
||||
protected Component scrollTooltip = CommonComponents.EMPTY;
|
||||
protected Vec3 labelOffset = Vec3.ZERO;
|
||||
|
||||
public int overrideColor = -1;
|
||||
|
@ -112,7 +112,8 @@ public class ValueBox extends ChasingAABBOutline {
|
|||
return outline;
|
||||
}
|
||||
|
||||
public void renderContents(PoseStack ms, MultiBufferSource buffer) {}
|
||||
public void renderContents(PoseStack ms, MultiBufferSource buffer) {
|
||||
}
|
||||
|
||||
public static class ItemValueBox extends ValueBox {
|
||||
ItemStack stack;
|
||||
|
@ -232,13 +233,13 @@ public class ValueBox extends ChasingAABBOutline {
|
|||
}
|
||||
|
||||
private static void drawString(PoseStack ms, MultiBufferSource buffer, Component text, float x, float y,
|
||||
int color) {
|
||||
int color) {
|
||||
Minecraft.getInstance().font.drawInBatch(text, x, y, color, false, ms.last()
|
||||
.pose(), buffer, Font.DisplayMode.NORMAL, 0, LightTexture.FULL_BRIGHT);
|
||||
}
|
||||
|
||||
private static void drawString8x(PoseStack ms, MultiBufferSource buffer, Component text, float x, float y,
|
||||
int color) {
|
||||
int color) {
|
||||
Minecraft.getInstance().font.drawInBatch8xOutline(text.getVisualOrderText(), x, y, color, 0xff333333, ms.last()
|
||||
.pose(), buffer, LightTexture.FULL_BRIGHT);
|
||||
}
|
||||
|
|
|
@ -11,13 +11,13 @@ import com.simibubi.create.foundation.blockEntity.behaviour.ValueBox;
|
|||
import com.simibubi.create.foundation.blockEntity.behaviour.ValueBoxTransform;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.math.VecHelper;
|
||||
import net.createmod.catnip.outliner.Outliner;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -77,7 +77,7 @@ public class EdgeInteractionRenderer {
|
|||
.scale(.469))
|
||||
.add(VecHelper.CENTER_OF_ORIGIN);
|
||||
|
||||
ValueBox box = new ValueBox(Lang.IMMUTABLE_EMPTY, bb, pos).passive(!hit)
|
||||
ValueBox box = new ValueBox(CommonComponents.EMPTY, bb, pos).passive(!hit)
|
||||
.transform(new EdgeValueBoxTransform(offset))
|
||||
.wideOutline();
|
||||
Outliner.getInstance().showOutline("edge", box)
|
||||
|
|
|
@ -9,9 +9,9 @@ import com.simibubi.create.foundation.gui.widget.TooltipArea;
|
|||
|
||||
import net.createmod.catnip.data.Couple;
|
||||
import net.createmod.catnip.data.Pair;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
|
||||
public class ModularGuiLineBuilder {
|
||||
|
||||
|
@ -28,14 +28,14 @@ public class ModularGuiLineBuilder {
|
|||
}
|
||||
|
||||
public ModularGuiLineBuilder addScrollInput(int x, int width, BiConsumer<ScrollInput, Label> inputTransform,
|
||||
String dataKey) {
|
||||
String dataKey) {
|
||||
ScrollInput input = new ScrollInput(x + this.x, y - 4, width, 18);
|
||||
addScrollInput(input, inputTransform, dataKey);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModularGuiLineBuilder addSelectionScrollInput(int x, int width,
|
||||
BiConsumer<SelectionScrollInput, Label> inputTransform, String dataKey) {
|
||||
BiConsumer<SelectionScrollInput, Label> inputTransform, String dataKey) {
|
||||
SelectionScrollInput input = new SelectionScrollInput(x + this.x, y - 4, width, 18);
|
||||
addScrollInput(input, inputTransform, dataKey);
|
||||
return this;
|
||||
|
@ -52,7 +52,7 @@ public class ModularGuiLineBuilder {
|
|||
}
|
||||
|
||||
private <T extends ScrollInput> void addScrollInput(T input, BiConsumer<T, Label> inputTransform, String dataKey) {
|
||||
Label label = new Label(input.getX() + 5, y, Lang.IMMUTABLE_EMPTY);
|
||||
Label label = new Label(input.getX() + 5, y, CommonComponents.EMPTY);
|
||||
label.withShadow();
|
||||
inputTransform.accept(input, label);
|
||||
input.writingTo(label);
|
||||
|
@ -61,7 +61,7 @@ public class ModularGuiLineBuilder {
|
|||
}
|
||||
|
||||
public ModularGuiLineBuilder addIntegerTextInput(int x, int width, BiConsumer<EditBox, TooltipArea> inputTransform,
|
||||
String dataKey) {
|
||||
String dataKey) {
|
||||
return addTextInput(x, width, inputTransform.andThen((editBox, $) -> editBox.setFilter(s -> {
|
||||
if (s.isEmpty())
|
||||
return true;
|
||||
|
@ -75,8 +75,8 @@ public class ModularGuiLineBuilder {
|
|||
}
|
||||
|
||||
public ModularGuiLineBuilder addTextInput(int x, int width, BiConsumer<EditBox, TooltipArea> inputTransform,
|
||||
String dataKey) {
|
||||
EditBox input = new EditBox(font, x + this.x + 5, y, width - 9, 8, Lang.IMMUTABLE_EMPTY);
|
||||
String dataKey) {
|
||||
EditBox input = new EditBox(font, x + this.x + 5, y, width - 9, 8, CommonComponents.EMPTY);
|
||||
input.setBordered(false);
|
||||
input.setTextColor(0xffffff);
|
||||
input.setFocused(false);
|
||||
|
|
|
@ -11,8 +11,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -23,13 +21,16 @@ import net.createmod.catnip.lang.FontHelper.Palette;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
|
||||
import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent;
|
||||
|
||||
public record ItemDescription(ImmutableList<Component> lines, ImmutableList<Component> linesOnShift, ImmutableList<Component> linesOnCtrl) {
|
||||
public record ItemDescription(ImmutableList<Component> lines, ImmutableList<Component> linesOnShift,
|
||||
ImmutableList<Component> linesOnCtrl) {
|
||||
private static final Map<Item, Supplier<String>> CUSTOM_TOOLTIP_KEYS = new IdentityHashMap<>();
|
||||
|
||||
@Nullable
|
||||
|
@ -144,7 +145,7 @@ public record ItemDescription(ImmutableList<Component> lines, ImmutableList<Comp
|
|||
}
|
||||
|
||||
if (!behaviours.isEmpty()) {
|
||||
linesOnShift.add(Lang.IMMUTABLE_EMPTY);
|
||||
linesOnShift.add(CommonComponents.EMPTY);
|
||||
}
|
||||
|
||||
for (Pair<String, String> behaviourPair : behaviours) {
|
||||
|
@ -183,7 +184,7 @@ public record ItemDescription(ImmutableList<Component> lines, ImmutableList<Comp
|
|||
}
|
||||
|
||||
if (hasControls) {
|
||||
MutableComponent tabBuilder = Component.empty();
|
||||
MutableComponent tabBuilder = Component.empty();
|
||||
tabBuilder.append(Component.literal(holdCtrl[0]).withStyle(DARK_GRAY));
|
||||
tabBuilder.append(keyCtrl.plainCopy()
|
||||
.withStyle(ctrl ? WHITE : GRAY));
|
||||
|
@ -192,7 +193,7 @@ public record ItemDescription(ImmutableList<Component> lines, ImmutableList<Comp
|
|||
}
|
||||
|
||||
if (hasDescription) {
|
||||
MutableComponent tabBuilder = Component.empty();
|
||||
MutableComponent tabBuilder = Component.empty();
|
||||
tabBuilder.append(Component.literal(holdDesc[0]).withStyle(DARK_GRAY));
|
||||
tabBuilder.append(keyShift.plainCopy()
|
||||
.withStyle(shift ? WHITE : GRAY));
|
||||
|
@ -201,7 +202,7 @@ public record ItemDescription(ImmutableList<Component> lines, ImmutableList<Comp
|
|||
}
|
||||
|
||||
if (shift || ctrl)
|
||||
list.add(hasDescription && hasControls ? 2 : 1, Lang.IMMUTABLE_EMPTY);
|
||||
list.add(hasDescription && hasControls ? 2 : 1, CommonComponents.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,11 +22,13 @@ import com.simibubi.create.infrastructure.config.CKinetics;
|
|||
import net.createmod.catnip.data.Couple;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.lang.LangBuilder;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent;
|
||||
|
||||
public class KineticStats implements TooltipModifier {
|
||||
|
@ -52,7 +54,7 @@ public class KineticStats implements TooltipModifier {
|
|||
List<Component> kineticStats = getKineticStats(block, context.getEntity());
|
||||
if (!kineticStats.isEmpty()) {
|
||||
List<Component> tooltip = context.getToolTip();
|
||||
tooltip.add(Lang.IMMUTABLE_EMPTY);
|
||||
tooltip.add(CommonComponents.EMPTY);
|
||||
tooltip.addAll(kineticStats);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,14 +11,13 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
|||
|
||||
import dev.engine_room.flywheel.lib.transform.TransformStack;
|
||||
import net.createmod.catnip.config.ui.BaseConfigScreen;
|
||||
import net.createmod.catnip.data.Iterate;
|
||||
import net.createmod.catnip.gui.AbstractSimiScreen;
|
||||
import net.createmod.catnip.gui.ScreenOpener;
|
||||
import net.createmod.catnip.gui.element.BoxElement;
|
||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||
import net.createmod.catnip.lang.FontHelper;
|
||||
import net.createmod.catnip.lang.FontHelper.Palette;
|
||||
import net.createmod.catnip.data.Iterate;
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.theme.Color;
|
||||
import net.createmod.ponder.foundation.ui.PonderTagIndexScreen;
|
||||
import net.minecraft.ChatFormatting;
|
||||
|
@ -31,8 +30,8 @@ import net.minecraft.client.gui.screens.Screen;
|
|||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import net.minecraft.client.renderer.CubeMap;
|
||||
import net.minecraft.client.renderer.PanoramaRenderer;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
|
@ -46,17 +45,17 @@ public class CreateMainMenuScreen extends AbstractSimiScreen {
|
|||
|
||||
private static final Component CURSEFORGE_TOOLTIP;
|
||||
|
||||
static {
|
||||
CURSEFORGE_TOOLTIP = Component.literal("CurseForge").withStyle(s -> s.withColor(0xFC785C).withBold(true));
|
||||
}
|
||||
static {
|
||||
CURSEFORGE_TOOLTIP = Component.literal("CurseForge").withStyle(s -> s.withColor(0xFC785C).withBold(true));
|
||||
}
|
||||
|
||||
private static final Component MODRINTH_TOOLTIP;
|
||||
private static final Component MODRINTH_TOOLTIP;
|
||||
|
||||
static {
|
||||
MODRINTH_TOOLTIP = Component.literal("Modrinth").withStyle(s -> s.withColor(0x3FD32B).withBold(true));
|
||||
}
|
||||
static {
|
||||
MODRINTH_TOOLTIP = Component.literal("Modrinth").withStyle(s -> s.withColor(0x3FD32B).withBold(true));
|
||||
}
|
||||
|
||||
public static final String CURSEFORGE_LINK = "https://www.curseforge.com/minecraft/mc-mods/create";
|
||||
public static final String CURSEFORGE_LINK = "https://www.curseforge.com/minecraft/mc-mods/create";
|
||||
public static final String MODRINTH_LINK = "https://modrinth.com/mod/create";
|
||||
public static final String ISSUE_TRACKER_LINK = "https://github.com/Creators-of-Create/Create/issues";
|
||||
public static final String SUPPORT_LINK = "https://github.com/Creators-of-Create/Create/wiki/Supporting-the-Project";
|
||||
|
@ -122,7 +121,7 @@ public class CreateMainMenuScreen extends AbstractSimiScreen {
|
|||
ms.popPose();
|
||||
}
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.enableBlend();
|
||||
|
||||
ms.pushPose();
|
||||
ms.translate(width / 2 - 32, 32, -10);
|
||||
|
@ -139,9 +138,9 @@ public class CreateMainMenuScreen extends AbstractSimiScreen {
|
|||
|
||||
ms.pushPose();
|
||||
ms.translate(0, 0, 200);
|
||||
graphics.drawCenteredString(font, Component.literal(Create.NAME).withStyle(ChatFormatting.BOLD)
|
||||
.append(
|
||||
Component.literal(" v" + CreateBuildInfo.VERSION).withStyle(ChatFormatting.BOLD, ChatFormatting.WHITE)),
|
||||
graphics.drawCenteredString(font, Component.literal(Create.NAME).withStyle(ChatFormatting.BOLD)
|
||||
.append(
|
||||
Component.literal(" v" + CreateBuildInfo.VERSION).withStyle(ChatFormatting.BOLD, ChatFormatting.WHITE)),
|
||||
width / 2, 89, 0xFF_E4BB67);
|
||||
ms.popPose();
|
||||
|
||||
|
@ -232,7 +231,7 @@ public class CreateMainMenuScreen extends AbstractSimiScreen {
|
|||
protected final float scale;
|
||||
|
||||
public PlatformIconButton(int pX, int pY, int pWidth, int pHeight, AllGuiTextures icon, float scale, OnPress pOnPress, Tooltip tooltip) {
|
||||
super(pX, pY, pWidth, pHeight, Lang.IMMUTABLE_EMPTY, pOnPress, DEFAULT_NARRATION);
|
||||
super(pX, pY, pWidth, pHeight, CommonComponents.EMPTY, pOnPress, DEFAULT_NARRATION);
|
||||
this.icon = icon;
|
||||
this.scale = scale;
|
||||
setTooltip(tooltip);
|
||||
|
|
|
@ -4,8 +4,6 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
|
||||
import org.apache.commons.lang3.mutable.MutableObject;
|
||||
|
||||
import com.simibubi.create.AllItems;
|
||||
|
@ -22,7 +20,9 @@ import net.minecraft.client.gui.screens.PauseScreen;
|
|||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
|
@ -33,7 +33,7 @@ public class OpenCreateMenuButton extends Button {
|
|||
public static final ItemStack ICON = AllItems.GOGGLES.asStack();
|
||||
|
||||
public OpenCreateMenuButton(int x, int y) {
|
||||
super(x, y, 20, 20, Lang.IMMUTABLE_EMPTY, OpenCreateMenuButton::click, DEFAULT_NARRATION);
|
||||
super(x, y, 20, 20, CommonComponents.EMPTY, OpenCreateMenuButton::click, DEFAULT_NARRATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.simibubi.create.content.equipment.clipboard.ClipboardOverrides.Clipbo
|
|||
import com.simibubi.create.foundation.ponder.CreateSceneBuilder;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
|
||||
import net.createmod.catnip.lang.Lang;
|
||||
import net.createmod.catnip.math.Pointing;
|
||||
import net.createmod.ponder.api.PonderPalette;
|
||||
import net.createmod.ponder.api.element.ElementLink;
|
||||
|
@ -17,8 +16,8 @@ import net.createmod.ponder.api.scene.SceneBuildingUtil;
|
|||
import net.createmod.ponder.api.scene.Selection;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
@ -75,7 +74,7 @@ public class DisplayScenes {
|
|||
|
||||
Vec3 target = util.vector().of(3.5, 2.75, 3.25);
|
||||
scene.overlay().showControls(target, Pointing.RIGHT, 60).withItem(AllBlocks.DISPLAY_LINK.asStack())
|
||||
.rightClick();
|
||||
.rightClick();
|
||||
scene.idle(6);
|
||||
scene.overlay().chaseBoundingBoxOutline(PonderPalette.OUTPUT, link, new AABB(board).expandTowards(-2, -1, 0)
|
||||
.deflate(0, 0, 3 / 16f), 60);
|
||||
|
@ -139,7 +138,7 @@ public class DisplayScenes {
|
|||
|
||||
scene.world().hideSection(depot, Direction.SOUTH);
|
||||
scene.idle(5);
|
||||
scene.world().setDisplayBoardText(board, 1, Lang.IMMUTABLE_EMPTY);
|
||||
scene.world().setDisplayBoardText(board, 1, CommonComponents.EMPTY);
|
||||
scene.world().flashDisplayLink(linkPos);
|
||||
scene.idle(5);
|
||||
ElementLink<WorldSectionElement> dirtElement = scene.world().showIndependentSection(dirt, Direction.SOUTH);
|
||||
|
@ -159,8 +158,8 @@ public class DisplayScenes {
|
|||
ElementLink<WorldSectionElement> stressElement = scene.world().showIndependentSection(stresso, Direction.SOUTH);
|
||||
scene.world().moveSection(stressElement, util.vector().of(0, -2, 0), 0);
|
||||
scene.idle(10);
|
||||
scene.world().setDisplayBoardText(board, 1,
|
||||
Component.literal(1024 + " ").append(CreateLang.translateDirect("generic.unit.stress")));
|
||||
scene.world().setDisplayBoardText(board, 1,
|
||||
Component.literal(1024 + " ").append(CreateLang.translateDirect("generic.unit.stress")));
|
||||
scene.world().flashDisplayLink(linkPos);
|
||||
scene.idle(40);
|
||||
scene.world().hideIndependentSection(stressElement, Direction.SOUTH);
|
||||
|
@ -169,9 +168,9 @@ public class DisplayScenes {
|
|||
ElementLink<WorldSectionElement> chestElement = scene.world().showIndependentSection(content, Direction.SOUTH);
|
||||
scene.world().moveSection(chestElement, util.vector().of(0, -3, 0), 0);
|
||||
scene.idle(10);
|
||||
scene.world().setDisplayBoardText(board, 1,
|
||||
Component.literal(418 + " ").append(new ItemStack(Items.DEEPSLATE).getHoverName()));
|
||||
scene.world().setDisplayBoardText(board, 2, Component.literal(14 + " ").append(AllBlocks.COGWHEEL.asStack()
|
||||
scene.world().setDisplayBoardText(board, 1,
|
||||
Component.literal(418 + " ").append(new ItemStack(Items.DEEPSLATE).getHoverName()));
|
||||
scene.world().setDisplayBoardText(board, 2, Component.literal(14 + " ").append(AllBlocks.COGWHEEL.asStack()
|
||||
.getHoverName()));
|
||||
scene.world().flashDisplayLink(linkPos);
|
||||
scene.idle(40);
|
||||
|
@ -188,9 +187,9 @@ public class DisplayScenes {
|
|||
ElementLink<WorldSectionElement> cuckooElement = scene.world().showIndependentSection(cuckoo, Direction.SOUTH);
|
||||
scene.world().moveSection(cuckooElement, util.vector().of(0, -1, 0), 0);
|
||||
scene.idle(10);
|
||||
scene.world().setDisplayBoardText(board, 1,
|
||||
Component.literal("6:00 ").append(CreateLang.translateDirect("generic.daytime.pm")));
|
||||
scene.world().setDisplayBoardText(board, 2, Lang.IMMUTABLE_EMPTY);
|
||||
scene.world().setDisplayBoardText(board, 1,
|
||||
Component.literal("6:00 ").append(CreateLang.translateDirect("generic.daytime.pm")));
|
||||
scene.world().setDisplayBoardText(board, 2, CommonComponents.EMPTY);
|
||||
scene.world().flashDisplayLink(linkPos);
|
||||
scene.idle(90);
|
||||
|
||||
|
@ -289,7 +288,7 @@ public class DisplayScenes {
|
|||
scene.overlay().showControls(target, Pointing.RIGHT, 40).withItem(clipboard)
|
||||
.rightClick();
|
||||
scene.idle(6);
|
||||
scene.world().setDisplayBoardText(board, 0, Component.literal("Create"));
|
||||
scene.world().setDisplayBoardText(board, 0, Component.literal("Create"));
|
||||
scene.idle(25);
|
||||
|
||||
scene.overlay().showText(50)
|
||||
|
@ -338,7 +337,7 @@ public class DisplayScenes {
|
|||
scene.idle(50);
|
||||
|
||||
scene.overlay().showControls(target, Pointing.RIGHT, 40).withItem(new ItemStack(Items.PINK_DYE))
|
||||
.rightClick();
|
||||
.rightClick();
|
||||
scene.idle(6);
|
||||
scene.world().dyeDisplayBoard(board, 0, DyeColor.PINK);
|
||||
scene.idle(25);
|
||||
|
@ -351,14 +350,14 @@ public class DisplayScenes {
|
|||
scene.idle(25);
|
||||
|
||||
scene.overlay().showControls(target.add(0, -.5f, 0), Pointing.RIGHT, 40).withItem(new ItemStack(Items.LIME_DYE))
|
||||
.rightClick();
|
||||
.rightClick();
|
||||
scene.idle(6);
|
||||
scene.world().dyeDisplayBoard(board, 1, DyeColor.LIME);
|
||||
scene.idle(55);
|
||||
|
||||
scene.overlay().showControls(target, Pointing.RIGHT, 40).rightClick();
|
||||
scene.idle(6);
|
||||
scene.world().setDisplayBoardText(board, 0, Lang.IMMUTABLE_EMPTY);
|
||||
scene.world().setDisplayBoardText(board, 0, CommonComponents.EMPTY);
|
||||
scene.idle(25);
|
||||
|
||||
scene.overlay().showText(70)
|
||||
|
@ -451,7 +450,7 @@ public class DisplayScenes {
|
|||
scene.world().moveSection(redstoneBlock, util.vector().of(-1, 0, 1), 0);
|
||||
scene.idle(10);
|
||||
scene.world().flashDisplayLink(linkPos);
|
||||
scene.world().setDisplayBoardText(board, 1, Lang.IMMUTABLE_EMPTY);
|
||||
scene.world().setDisplayBoardText(board, 1, CommonComponents.EMPTY);
|
||||
scene.idle(25);
|
||||
|
||||
scene.overlay().showOutlineWithText(depot, 80)
|
||||
|
|
Loading…
Add table
Reference in a new issue