1.19-pre1
This commit is contained in:
parent
05d443c51d
commit
3cb62b0291
95 changed files with 451 additions and 403 deletions
|
@ -28,7 +28,7 @@ import com.mojang.datafixers.util.Pair;
|
|||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
|
||||
import net.minecraft.client.item.ModelPredicateProviderRegistry;
|
||||
import net.minecraft.client.item.UnclampedModelPredicateProvider;
|
||||
|
@ -170,18 +170,18 @@ public class TechRebornClient implements ClientModInitializer {
|
|||
BlockRenderLayerMap.INSTANCE.putFluid(fluid.getFlowingFluid(), RenderLayer.getTranslucent());
|
||||
}
|
||||
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.INDUSTRIAL_GRINDER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.FUSION_CONTROL_COMPUTER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.INDUSTRIAL_BLAST_FURNACE, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.VACUUM_FREEZER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.FLUID_REPLICATOR, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.INDUSTRIAL_SAWMILL, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.DISTILLATION_TOWER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.IMPLOSION_COMPRESSOR, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.GREENHOUSE_CONTROLLER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.STORAGE_UNIT, StorageUnitRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.CABLE, CableCoverRenderer::new);
|
||||
BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.WIND_MILL, TurbineRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.INDUSTRIAL_GRINDER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.FUSION_CONTROL_COMPUTER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.INDUSTRIAL_BLAST_FURNACE, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.VACUUM_FREEZER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.FLUID_REPLICATOR, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.INDUSTRIAL_SAWMILL, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.DISTILLATION_TOWER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.IMPLOSION_COMPRESSOR, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.GREENHOUSE_CONTROLLER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.STORAGE_UNIT, StorageUnitRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.CABLE, CableCoverRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.WIND_MILL, TurbineRenderer::new);
|
||||
|
||||
registerPredicateProvider(
|
||||
BatpackItem.class,
|
||||
|
|
|
@ -33,7 +33,7 @@ import net.minecraft.network.PacketByteBuf;
|
|||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -169,7 +169,7 @@ public final class GuiType<T extends BlockEntity> implements IMachineGuiHandler
|
|||
|
||||
@Override
|
||||
public Text getDisplayName() {
|
||||
return new LiteralText("What is this for?");
|
||||
return Text.literal("What is this for?");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -35,9 +35,9 @@ import net.minecraft.nbt.NbtCompound;
|
|||
import net.minecraft.nbt.NbtHelper;
|
||||
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -265,7 +265,7 @@ public class CableBlockEntity extends BlockEntity
|
|||
@Override
|
||||
public void addInfo(List<Text> info, boolean isReal, boolean hasData) {
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.transferRate")
|
||||
Text.translatable("techreborn.tooltip.transferRate")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(PowerSystem.getLocalizedPower(getCableType().transferRate))
|
||||
|
@ -274,17 +274,17 @@ public class CableBlockEntity extends BlockEntity
|
|||
);
|
||||
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.tier")
|
||||
Text.translatable("techreborn.tooltip.tier")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(
|
||||
new LiteralText(StringUtils.toFirstCapitalAllLowercase(getCableType().tier.toString()))
|
||||
Text.literal(StringUtils.toFirstCapitalAllLowercase(getCableType().tier.toString()))
|
||||
.formatted(Formatting.GOLD)
|
||||
)
|
||||
);
|
||||
|
||||
if (!getCableType().canKill) {
|
||||
info.add(new TranslatableText("techreborn.tooltip.cable.can_cover").formatted(Formatting.GRAY));
|
||||
info.add(Text.translatable("techreborn.tooltip.cable.can_cover").formatted(Formatting.GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -217,41 +217,41 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
|
|||
}
|
||||
|
||||
info.add(
|
||||
new TranslatableText("reborncore.tooltip.energy.maxEnergy")
|
||||
Text.translatable("reborncore.tooltip.energy.maxEnergy")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(
|
||||
new LiteralText(PowerSystem.getLocalizedPower(getMaxStoredPower()))
|
||||
Text.literal(PowerSystem.getLocalizedPower(getMaxStoredPower()))
|
||||
.formatted(Formatting.GOLD)
|
||||
)
|
||||
);
|
||||
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.generationRate.day")
|
||||
Text.translatable("techreborn.tooltip.generationRate.day")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(
|
||||
new LiteralText(PowerSystem.getLocalizedPower(panel.generationRateD))
|
||||
Text.literal(PowerSystem.getLocalizedPower(panel.generationRateD))
|
||||
.formatted(Formatting.GOLD)
|
||||
)
|
||||
);
|
||||
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.generationRate.night")
|
||||
Text.translatable("techreborn.tooltip.generationRate.night")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(
|
||||
new LiteralText(PowerSystem.getLocalizedPower(panel.generationRateN))
|
||||
Text.literal(PowerSystem.getLocalizedPower(panel.generationRateN))
|
||||
.formatted(Formatting.GOLD)
|
||||
)
|
||||
);
|
||||
|
||||
info.add(
|
||||
new TranslatableText("reborncore.tooltip.energy.tier")
|
||||
Text.translatable("reborncore.tooltip.energy.tier")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(
|
||||
new LiteralText(StringUtils.toFirstCapitalAllLowercase(getTier().toString()))
|
||||
Text.literal(StringUtils.toFirstCapitalAllLowercase(getTier().toString()))
|
||||
.formatted(Formatting.GOLD)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -33,7 +33,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -63,7 +63,7 @@ public class AlarmBlockEntity extends BlockEntity
|
|||
}
|
||||
|
||||
if (entity instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, MessageIDs.alarmID, new TranslatableText("techreborn.message.alarm")
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, MessageIDs.alarmID, Text.translatable("techreborn.message.alarm")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(" Alarm ")
|
||||
.append(String.valueOf(selectedSound)));
|
||||
|
|
|
@ -29,9 +29,9 @@ import net.minecraft.block.entity.BlockEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -87,22 +87,22 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity
|
|||
|
||||
public Text getStateText() {
|
||||
if (state == -1) {
|
||||
return LiteralText.EMPTY;
|
||||
return Text.empty();
|
||||
} else if (state == 0) {
|
||||
return new TranslatableText("gui.techreborn.fusion.norecipe");
|
||||
return Text.translatable("gui.techreborn.fusion.norecipe");
|
||||
} else if (state == 1) {
|
||||
FusionReactorRecipe r = getCurrentRecipeFromID();
|
||||
if (r == null) {
|
||||
return new TranslatableText("gui.techreborn.fusion.charging");
|
||||
return Text.translatable("gui.techreborn.fusion.charging");
|
||||
}
|
||||
int percentage = percentage(r.getStartEnergy(), getEnergy());
|
||||
return new TranslatableText("gui.techreborn.fusion.chargingdetailed",
|
||||
return Text.translatable("gui.techreborn.fusion.chargingdetailed",
|
||||
new Object[]{StringUtils.getPercentageText(percentage)}
|
||||
);
|
||||
} else if (state == 2) {
|
||||
return new TranslatableText("gui.techreborn.fusion.crafting");
|
||||
return Text.translatable("gui.techreborn.fusion.crafting");
|
||||
}
|
||||
return LiteralText.EMPTY;
|
||||
return Text.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package techreborn.blockentity.machine.tier0.block;
|
||||
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
/**
|
||||
* <b>Interface describing different statuses of a Processing Machine</b>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package techreborn.blockentity.machine.tier0.block.blockbreaker;
|
||||
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.common.util.Color;
|
||||
import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
|
||||
|
||||
|
@ -14,13 +14,13 @@ import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
|
|||
* @author SimonFlapse
|
||||
*/
|
||||
enum BlockBreakerStatus implements ProcessingStatus {
|
||||
IDLE(new TranslatableText("gui.techreborn.block_breaker.idle"), Color.BLUE),
|
||||
IDLE_PAUSED(new TranslatableText("gui.techreborn.block.idle_redstone"), Color.BLUE),
|
||||
OUTPUT_FULL(new TranslatableText("gui.techreborn.block.output_full"), Color.RED),
|
||||
NO_ENERGY(new TranslatableText("gui.techreborn.block.no_energy"), Color.RED),
|
||||
INTERRUPTED(new TranslatableText("gui.techreborn.block.interrupted"), Color.RED),
|
||||
OUTPUT_BLOCKED(new TranslatableText("gui.techreborn.block.output_blocked"), Color.RED),
|
||||
PROCESSING(new TranslatableText("gui.techreborn.block_breaker.processing"), Color.DARK_GREEN);
|
||||
IDLE(Text.translatable("gui.techreborn.block_breaker.idle"), Color.BLUE),
|
||||
IDLE_PAUSED(Text.translatable("gui.techreborn.block.idle_redstone"), Color.BLUE),
|
||||
OUTPUT_FULL(Text.translatable("gui.techreborn.block.output_full"), Color.RED),
|
||||
NO_ENERGY(Text.translatable("gui.techreborn.block.no_energy"), Color.RED),
|
||||
INTERRUPTED(Text.translatable("gui.techreborn.block.interrupted"), Color.RED),
|
||||
OUTPUT_BLOCKED(Text.translatable("gui.techreborn.block.output_blocked"), Color.RED),
|
||||
PROCESSING(Text.translatable("gui.techreborn.block_breaker.processing"), Color.DARK_GREEN);
|
||||
|
||||
private final Text text;
|
||||
private final int color;
|
||||
|
@ -40,12 +40,12 @@ enum BlockBreakerStatus implements ProcessingStatus {
|
|||
progress = Math.max(progress, 0);
|
||||
|
||||
if (this == PROCESSING) {
|
||||
return new TranslatableText("gui.techreborn.block.progress.active", new LiteralText("" + progress + "%"));
|
||||
return Text.translatable("gui.techreborn.block.progress.active", Text.literal("" + progress + "%"));
|
||||
} else if (this == IDLE || this == INTERRUPTED) {
|
||||
return new TranslatableText("gui.techreborn.block.progress.stopped");
|
||||
return Text.translatable("gui.techreborn.block.progress.stopped");
|
||||
}
|
||||
|
||||
return new TranslatableText("gui.techreborn.block.progress.paused", new LiteralText("" + progress + "%"));
|
||||
return Text.translatable("gui.techreborn.block.progress.paused", Text.literal("" + progress + "%"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package techreborn.blockentity.machine.tier0.block.blockplacer;
|
||||
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.common.util.Color;
|
||||
import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
|
||||
|
||||
|
@ -14,12 +14,12 @@ import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
|
|||
* @author SimonFlapse
|
||||
*/
|
||||
enum BlockPlacerStatus implements ProcessingStatus {
|
||||
IDLE(new TranslatableText("gui.techreborn.block_placer.idle"), Color.BLUE),
|
||||
IDLE_PAUSED(new TranslatableText("gui.techreborn.block.idle_redstone"), Color.BLUE),
|
||||
NO_ENERGY(new TranslatableText("gui.techreborn.block.no_energy"), Color.RED),
|
||||
INTERRUPTED(new TranslatableText("gui.techreborn.block.interrupted"), Color.RED),
|
||||
OUTPUT_BLOCKED(new TranslatableText("gui.techreborn.block.output_blocked"), Color.RED),
|
||||
PROCESSING(new TranslatableText("gui.techreborn.block_placer.processing"), Color.DARK_GREEN);
|
||||
IDLE(Text.translatable("gui.techreborn.block_placer.idle"), Color.BLUE),
|
||||
IDLE_PAUSED(Text.translatable("gui.techreborn.block.idle_redstone"), Color.BLUE),
|
||||
NO_ENERGY(Text.translatable("gui.techreborn.block.no_energy"), Color.RED),
|
||||
INTERRUPTED(Text.translatable("gui.techreborn.block.interrupted"), Color.RED),
|
||||
OUTPUT_BLOCKED(Text.translatable("gui.techreborn.block.output_blocked"), Color.RED),
|
||||
PROCESSING(Text.translatable("gui.techreborn.block_placer.processing"), Color.DARK_GREEN);
|
||||
|
||||
private final Text text;
|
||||
private final int color;
|
||||
|
@ -39,11 +39,11 @@ enum BlockPlacerStatus implements ProcessingStatus {
|
|||
progress = Math.max(progress, 0);
|
||||
|
||||
if (this == PROCESSING) {
|
||||
return new TranslatableText("gui.techreborn.block.progress.active", new LiteralText("" + progress + "%"));
|
||||
return Text.translatable("gui.techreborn.block.progress.active", Text.literal("" + progress + "%"));
|
||||
} else if (this == IDLE || this == INTERRUPTED) {
|
||||
return new TranslatableText("gui.techreborn.block.progress.stopped");
|
||||
return Text.translatable("gui.techreborn.block.progress.stopped");
|
||||
} else {
|
||||
return new TranslatableText("gui.techreborn.block.progress.paused", new LiteralText("" + progress + "%"));
|
||||
return Text.translatable("gui.techreborn.block.progress.paused", Text.literal("" + progress + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -124,6 +124,11 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
private CraftingInventory getCraftingInventory() {
|
||||
if (inventoryCrafting == null) {
|
||||
inventoryCrafting = new CraftingInventory(new ScreenHandler(null, -1) {
|
||||
@Override
|
||||
public ItemStack transferSlot(PlayerEntity player, int index) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse(PlayerEntity playerIn) {
|
||||
return false;
|
||||
|
|
|
@ -433,6 +433,11 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
|||
super(null, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferSlot(PlayerEntity player, int index) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse(final PlayerEntity playerEntity) {
|
||||
return true;
|
||||
|
|
|
@ -28,9 +28,9 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -181,18 +181,18 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
|
|||
if (isReal || hasData) {
|
||||
if (!this.tank.getFluidInstance().isEmpty()) {
|
||||
info.add(
|
||||
new LiteralText(String.valueOf(this.tank.getFluidAmount()))
|
||||
.append(new TranslatableText("techreborn.tooltip.unit.divider"))
|
||||
Text.literal(String.valueOf(this.tank.getFluidAmount()))
|
||||
.append(Text.translatable("techreborn.tooltip.unit.divider"))
|
||||
.append(WordUtils.capitalize(FluidUtils.getFluidName(this.tank.getFluid())))
|
||||
);
|
||||
} else {
|
||||
info.add(new TranslatableText("techreborn.tooltip.unit.empty"));
|
||||
info.add(Text.translatable("techreborn.tooltip.unit.empty"));
|
||||
}
|
||||
}
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.unit.capacity")
|
||||
Text.translatable("techreborn.tooltip.unit.capacity")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(new LiteralText(String.valueOf(this.tank.getFluidValueCapacity()))
|
||||
.append(Text.literal(String.valueOf(this.tank.getFluidValueCapacity()))
|
||||
.formatted(Formatting.GOLD))
|
||||
);
|
||||
}
|
||||
|
|
|
@ -33,9 +33,9 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -423,27 +423,27 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
|
|||
if (isReal || hasData) {
|
||||
if (!this.isEmpty()) {
|
||||
info.add(
|
||||
new LiteralText(String.valueOf(this.getCurrentCapacity()))
|
||||
.append(new TranslatableText("techreborn.tooltip.unit.divider"))
|
||||
Text.literal(String.valueOf(this.getCurrentCapacity()))
|
||||
.append(Text.translatable("techreborn.tooltip.unit.divider"))
|
||||
.append(this.getStoredStack().getName())
|
||||
);
|
||||
} else {
|
||||
info.add(new TranslatableText("techreborn.tooltip.unit.empty"));
|
||||
info.add(Text.translatable("techreborn.tooltip.unit.empty"));
|
||||
}
|
||||
}
|
||||
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.unit.capacity")
|
||||
Text.translatable("techreborn.tooltip.unit.capacity")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(
|
||||
new LiteralText(String.valueOf(this.getMaxCapacity()))
|
||||
Text.literal(String.valueOf(this.getMaxCapacity()))
|
||||
.formatted(Formatting.GOLD)
|
||||
.append(" ")
|
||||
.append(new TranslatableText("techreborn.tooltip.unit.items"))
|
||||
.append(Text.translatable("techreborn.tooltip.unit.items"))
|
||||
.append(" (")
|
||||
.append(String.valueOf(this.getMaxCapacity() / 64))
|
||||
.append(" ")
|
||||
.append(new TranslatableText("techreborn.tooltip.unit.stacks"))
|
||||
.append(Text.translatable("techreborn.tooltip.unit.stacks"))
|
||||
.append(")")
|
||||
)
|
||||
);
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.block.entity.BlockEntityType;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -146,28 +146,28 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity implements
|
|||
@Override
|
||||
public void addInfo(List<Text> info, boolean isReal, boolean hasData) {
|
||||
info.add(
|
||||
new TranslatableText("reborncore.tooltip.energy.inputRate")
|
||||
Text.translatable("reborncore.tooltip.energy.inputRate")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(PowerSystem.getLocalizedPower(getMaxInput(null)))
|
||||
.formatted(Formatting.GOLD)
|
||||
);
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.input_tier")
|
||||
Text.translatable("techreborn.tooltip.input_tier")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(StringUtils.toFirstCapitalAllLowercase(inputTier.toString()))
|
||||
.formatted(Formatting.GOLD)
|
||||
);
|
||||
info.add(
|
||||
new TranslatableText("reborncore.tooltip.energy.outputRate")
|
||||
Text.translatable("reborncore.tooltip.energy.outputRate")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(PowerSystem.getLocalizedPower(getMaxOutput(null)))
|
||||
.formatted(Formatting.GOLD)
|
||||
);
|
||||
info.add(
|
||||
new TranslatableText("techreborn.tooltip.output_tier")
|
||||
Text.translatable("techreborn.tooltip.output_tier")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(": ")
|
||||
.append(StringUtils.toFirstCapitalAllLowercase(outputTier.toString()))
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -82,6 +82,6 @@ public class BlockFusionCoil extends Block {
|
|||
@Override
|
||||
public void appendTooltip(ItemStack stack, @Nullable BlockView worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||
super.appendTooltip(stack, worldIn, tooltip, flagIn);
|
||||
tooltip.add(new TranslatableText("techreborn.tooltip.fusion_coil").formatted(Formatting.BLUE));
|
||||
tooltip.add(Text.translatable("techreborn.tooltip.fusion_coil").formatted(Formatting.BLUE));
|
||||
}
|
||||
}
|
|
@ -35,8 +35,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.EnumProperty;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -126,11 +126,11 @@ public class PlayerDetectorBlock extends BlockMachineBase {
|
|||
|
||||
if (playerIn instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, MessageIDs.playerDetectorID,
|
||||
new TranslatableText("techreborn.message.detects")
|
||||
Text.translatable("techreborn.message.detects")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(" ")
|
||||
.append(
|
||||
new LiteralText(StringUtils.toFirstCapital(newType.asString()))
|
||||
Text.literal(StringUtils.toFirstCapital(newType.asString()))
|
||||
.formatted(color)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -33,14 +33,13 @@ import net.minecraft.state.StateManager;
|
|||
import net.minecraft.state.property.BooleanProperty;
|
||||
import net.minecraft.state.property.DirectionProperty;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.BaseBlockEntityProvider;
|
||||
|
@ -113,7 +112,7 @@ public class ResinBasinBlock extends BaseBlockEntityProvider {
|
|||
if (worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock() != TRContent.RUBBER_LOG) {
|
||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
|
||||
WorldUtils.dropItem(this.asItem(), worldIn, pos);
|
||||
placer.sendSystemMessage(new TranslatableText("techreborn.tooltip.invalid_basin_placement"), UUID.randomUUID());
|
||||
placer.sendMessage(Text.translatable("techreborn.tooltip.invalid_basin_placement"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.state.property.BooleanProperty;
|
|||
import net.minecraft.state.property.DirectionProperty;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -161,7 +161,7 @@ public class BlockAlarm extends BaseBlockEntityProvider {
|
|||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, @Nullable BlockView worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||
tooltip.add(new TranslatableText("techreborn.tooltip.alarm").formatted(Formatting.GRAY));
|
||||
tooltip.add(Text.translatable("techreborn.tooltip.alarm").formatted(Formatting.GRAY));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ import net.minecraft.util.Hand;
|
|||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
|
@ -111,7 +112,7 @@ public class BlockRubberLog extends PillarBlock {
|
|||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) {
|
||||
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, AbstractRandom random) {
|
||||
super.randomTick(state, worldIn, pos, random);
|
||||
if (state.get(AXIS) != Direction.Axis.Y) return;
|
||||
if (!state.get(SHOULD_SAP)) return;
|
||||
|
|
|
@ -40,9 +40,9 @@ import net.minecraft.fluid.Fluid;
|
|||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
@ -116,19 +116,19 @@ public class StackToolTipHandler implements ItemTooltipCallback {
|
|||
}
|
||||
|
||||
if (item == TRContent.Upgrades.SUPERCONDUCTOR.item && Screen.hasControlDown()) {
|
||||
tooltipLines.add(new LiteralText(Formatting.GOLD + "Blame obstinate_3 for this"));
|
||||
tooltipLines.add(Text.literal(Formatting.GOLD + "Blame obstinate_3 for this"));
|
||||
}
|
||||
|
||||
if (item == TRContent.OMNI_TOOL) {
|
||||
tooltipLines.add(new LiteralText(Formatting.YELLOW + I18n.translate("techreborn.tooltip.omnitool_motto")));
|
||||
tooltipLines.add(Text.literal(Formatting.YELLOW + I18n.translate("techreborn.tooltip.omnitool_motto")));
|
||||
}
|
||||
|
||||
if (block == TRContent.Machine.INDUSTRIAL_CENTRIFUGE.block && Screen.hasControlDown()) {
|
||||
tooltipLines.add(new LiteralText("Round and round it goes"));
|
||||
tooltipLines.add(Text.literal("Round and round it goes"));
|
||||
}
|
||||
|
||||
if (UNOBTAINABLE_ORES.contains(block)) {
|
||||
tooltipLines.add(new TranslatableText("techreborn.tooltip.unobtainable").formatted(Formatting.AQUA));
|
||||
tooltipLines.add(Text.translatable("techreborn.tooltip.unobtainable").formatted(Formatting.AQUA));
|
||||
} else if (OreDepthSyncHandler.getOreDepthMap().containsKey(block)) {
|
||||
OreDepth oreDepth = OreDepthSyncHandler.getOreDepthMap().get(block);
|
||||
Text text = getOreDepthText(oreDepth);
|
||||
|
@ -140,10 +140,10 @@ public class StackToolTipHandler implements ItemTooltipCallback {
|
|||
return Registry.ITEM.getId(item).getNamespace().equals("techreborn");
|
||||
}
|
||||
|
||||
private static TranslatableText getOreDepthText(OreDepth depth) {
|
||||
return new TranslatableText("techreborn.tooltip.ores.%s".formatted(depth.dimension().name().toLowerCase(Locale.ROOT)),
|
||||
new LiteralText(String.valueOf(depth.minY())).formatted(Formatting.YELLOW),
|
||||
new LiteralText(String.valueOf(depth.maxY())).formatted(Formatting.YELLOW)
|
||||
private static Text getOreDepthText(OreDepth depth) {
|
||||
return Text.translatable("techreborn.tooltip.ores.%s".formatted(depth.dimension().name().toLowerCase(Locale.ROOT)),
|
||||
Text.literal(String.valueOf(depth.minY())).formatted(Formatting.YELLOW),
|
||||
Text.literal(String.valueOf(depth.maxY())).formatted(Formatting.YELLOW)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.events;
|
|||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
|
@ -63,7 +63,7 @@ public class ToolTipAssistUtils {
|
|||
|
||||
// Add reminder that they can use shift to calculate the entire stack
|
||||
if (shouldStackCalculate && !shiftHeld) {
|
||||
tips.add(new LiteralText(instructColour + I18n.translate("techreborn.tooltip.stack_info")));
|
||||
tips.add(Text.literal(instructColour + I18n.translate("techreborn.tooltip.stack_info")));
|
||||
}
|
||||
|
||||
return tips;
|
||||
|
@ -82,10 +82,10 @@ public class ToolTipAssistUtils {
|
|||
String[] infoLines = info.split("\\r?\\n");
|
||||
|
||||
for (String infoLine : infoLines) {
|
||||
list.add(1, new LiteralText(infoColour + infoLine));
|
||||
list.add(1, Text.literal(infoColour + infoLine));
|
||||
}
|
||||
} else {
|
||||
list.add(new LiteralText(instructColour + I18n.translate("techreborn.tooltip.more_info")));
|
||||
list.add(Text.literal(instructColour + I18n.translate("techreborn.tooltip.more_info")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,11 +104,11 @@ public class ToolTipAssistUtils {
|
|||
}
|
||||
|
||||
private static Text getPositive(String text, int value, String unit) {
|
||||
return new LiteralText(posColour + getStatStringUnit(text, value, unit));
|
||||
return Text.literal(posColour + getStatStringUnit(text, value, unit));
|
||||
}
|
||||
|
||||
private static Text getNegative(String text, int value, String unit) {
|
||||
return new LiteralText(negColour + getStatStringUnit(text, value, unit));
|
||||
return Text.literal(negColour + getStatStringUnit(text, value, unit));
|
||||
}
|
||||
|
||||
private static String getStatStringUnit(String text, int value, String unit) {
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.client.gui;
|
|||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
||||
|
@ -75,7 +75,7 @@ public class GuiAESU extends GuiBase<BuiltScreenHandler> {
|
|||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
Text text = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -59,7 +59,7 @@ public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
|
|||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
Text text = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPower(blockEntity.getMaxStoredPower()));
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.client.gui;
|
|||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientChunkManager;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -54,7 +54,7 @@ public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
|
|||
addDrawableChild(new GuiButtonUpDown(x + 64 + 24, y + 40, this, b -> onClick(-1), UpDownButtonType.REWIND));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 36, y + 40, this, b -> onClick(-5), UpDownButtonType.FASTREWIND));
|
||||
|
||||
addDrawableChild(new ButtonWidget(x + 10, y + 70, 155, 20, new LiteralText("Toggle Loaded Chunks"), b -> ClientChunkManager.toggleLoadedChunks(blockEntity.getPos())));
|
||||
addDrawableChild(new ButtonWidget(x + 10, y + 70, 155, 20, Text.literal("Toggle Loaded Chunks"), b -> ClientChunkManager.toggleLoadedChunks(blockEntity.getPos())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,7 +64,7 @@ public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
|
|||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = new LiteralText("Radius: ")
|
||||
Text text = Text.literal("Radius: ")
|
||||
.append(String.valueOf(blockEntity.getRadius()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.client.gui;
|
|||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -89,7 +89,7 @@ public class GuiFusionReactor extends GuiBase<BuiltScreenHandler> {
|
|||
addHologramButton(6, 4, 212, layer).clickHandler(this::hologramToggle);
|
||||
drawCentredText(matrixStack, blockEntity.getStateText(), 20, Color.BLUE.darker().getColor(), layer);
|
||||
if (blockEntity.state == 2) {
|
||||
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPower(blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer);
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPower(blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer);
|
||||
}
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
|
@ -101,19 +101,19 @@ public class GuiFusionReactor extends GuiBase<BuiltScreenHandler> {
|
|||
if (stackSize.get().getLeft() > 0) {
|
||||
|
||||
drawCentredText(matrixStack,
|
||||
new LiteralText("Required Coils: ")
|
||||
Text.literal("Required Coils: ")
|
||||
.append(String.valueOf(stackSize.get().getLeft()))
|
||||
.append("x64 +")
|
||||
.append(String.valueOf(stackSize.get().getRight()))
|
||||
, 25, 0xFFFFFF, layer);
|
||||
} else {
|
||||
drawCentredText(matrixStack, new LiteralText("Required Coils: ").append(String.valueOf(stackSize.get().getRight())), 25, 0xFFFFFF, layer);
|
||||
drawCentredText(matrixStack, Text.literal("Required Coils: ").append(String.valueOf(stackSize.get().getRight())), 25, 0xFFFFFF, layer);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, new LiteralText("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, new LiteralText(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, Text.literal("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, Text.literal(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF);
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, this.blockEntity.getEnergy(), this.blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
|
@ -70,7 +70,7 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
|
|||
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
|
||||
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
|
||||
.split("\\r?\\n"))
|
||||
.map(LiteralText::new)
|
||||
.map(Text::literal)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
matrixStack.push();
|
||||
|
@ -93,7 +93,7 @@ public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
|
|||
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
|
||||
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
|
||||
.split("\\r?\\n"))
|
||||
.map(LiteralText::new)
|
||||
.map(Text::literal)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
matrixStack.push();
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
@ -60,7 +60,7 @@ public class GuiIDSU extends GuiBase<BuiltScreenHandler> {
|
|||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
|
||||
Text text = new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(idsu.getEnergy()))
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(idsu.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(idsu.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.client.gui.widget.ButtonWidget;
|
|||
import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -83,7 +83,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
}
|
||||
}
|
||||
|
||||
renderTooltip(matrices, new LiteralText(message), mouseX, mouseY);
|
||||
renderTooltip(matrices, Text.literal(message), mouseX, mouseY);
|
||||
};
|
||||
|
||||
addDrawableChild(new TexturedButtonWidget(
|
||||
|
@ -99,7 +99,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
|
|||
16,
|
||||
b -> onClick(),
|
||||
tooltipSupplier,
|
||||
LiteralText.EMPTY));
|
||||
Text.empty()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
|
@ -58,7 +58,7 @@ public class GuiLESU extends GuiBase<BuiltScreenHandler> {
|
|||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPowerNoSuffix( blockEntity.getEnergy()))
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix( blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
|
@ -60,7 +60,7 @@ public class GuiMFE extends GuiBase<BuiltScreenHandler> {
|
|||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
|
||||
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy()))
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPower(mfe.getMaxStoredPower()))
|
||||
, 35, 0, 58, layer);
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
|
@ -58,7 +58,7 @@ public class GuiMFSU extends GuiBase<BuiltScreenHandler> {
|
|||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(matrixStack, new LiteralText(PowerSystem.getLocalizedPowerNoSuffix(mfsu.getEnergy()) + "/" + PowerSystem.getLocalizedPower(mfsu.getMaxStoredPower())), 35, 0, 58, layer);
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfsu.getEnergy()) + "/" + PowerSystem.getLocalizedPower(mfsu.getMaxStoredPower())), 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
|
|
|
@ -28,9 +28,9 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||
import net.minecraft.client.gui.screen.ConfirmChatLinkScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
|
@ -43,12 +43,12 @@ public class GuiManual extends Screen {
|
|||
private static final Identifier MANUAL_TEXTURE = new Identifier("techreborn", "textures/gui/manual.png");
|
||||
int guiWidth = 207;
|
||||
int guiHeight = 195;
|
||||
private static final Text text1 = new TranslatableText("techreborn.manual.wiki");
|
||||
private static final Text text2 = new TranslatableText("techreborn.manual.discord");
|
||||
private static final Text text3 = new TranslatableText("techreborn.manual.refund");
|
||||
private static final Text text1 = Text.translatable("techreborn.manual.wiki");
|
||||
private static final Text text2 = Text.translatable("techreborn.manual.discord");
|
||||
private static final Text text3 = Text.translatable("techreborn.manual.refund");
|
||||
|
||||
public GuiManual() {
|
||||
super(new LiteralText("gui.manual"));
|
||||
super(Text.literal("gui.manual"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,14 +56,14 @@ public class GuiManual extends Screen {
|
|||
int y = (height / 2) - guiHeight / 2;
|
||||
if (client == null) { return; }
|
||||
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 40, 60, 20, new TranslatableText("techreborn.manual.wikibtn"), var1 -> client.setScreen(new ConfirmChatLinkScreen(t -> {
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 40, 60, 20, Text.translatable("techreborn.manual.wikibtn"), var1 -> client.setScreen(new ConfirmChatLinkScreen(t -> {
|
||||
if (t) {
|
||||
Util.getOperatingSystem().open("http://wiki.techreborn.ovh");
|
||||
}
|
||||
this.client.setScreen(this);
|
||||
}, "http://wiki.techreborn.ovh", false))));
|
||||
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 90, 60, 20, new TranslatableText("techreborn.manual.discordbtn"), var1 -> client.setScreen(new ConfirmChatLinkScreen(t -> {
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 90, 60, 20, Text.translatable("techreborn.manual.discordbtn"), var1 -> client.setScreen(new ConfirmChatLinkScreen(t -> {
|
||||
if (t) {
|
||||
Util.getOperatingSystem().open("https://discord.gg/teamreborn");
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class GuiManual extends Screen {
|
|||
}, "https://discord.gg/teamreborn", false))));
|
||||
|
||||
if (TechRebornConfig.allowManualRefund) {
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 140, 60, 20, new TranslatableText("techreborn.manual.refundbtn"), var1 -> {
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 140, 60, 20, Text.translatable("techreborn.manual.refundbtn"), var1 -> {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createRefundPacket());
|
||||
this.client.setScreen(null);
|
||||
}));
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
||||
|
@ -65,7 +65,7 @@ public class GuiPlayerDetector extends GuiBase<BuiltScreenHandler> {
|
|||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = new LiteralText("Radius: ").append(String.valueOf(blockEntity.getCurrentRadius()));
|
||||
Text text = Text.literal("Radius: ").append(String.valueOf(blockEntity.getCurrentRadius()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.generator.SolarPanelBlockEntity;
|
||||
|
@ -49,10 +49,10 @@ public class GuiSolar extends GuiBase<BuiltScreenHandler> {
|
|||
builder.drawMultiEnergyBar(matrixStack, this, 156, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
|
||||
if (!blockEntity.isGenerating()) {
|
||||
builder.drawText(matrixStack, this, new TranslatableText("techreborn.message.panel_blocked"), 10, 20, 12066591);
|
||||
builder.drawText(matrixStack, this, Text.translatable("techreborn.message.panel_blocked"), 10, 20, 12066591);
|
||||
}
|
||||
|
||||
builder.drawText(matrixStack, this, new LiteralText("Generating: " + blockEntity.getGenerationRate() + " E/t"), 10, 30, 0);
|
||||
builder.drawText(matrixStack, this, Text.literal("Generating: " + blockEntity.getGenerationRate() + " E/t"), 10, 30, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
|
@ -59,26 +59,26 @@ public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
|
|||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
|
||||
// Draw in/out labels
|
||||
builder.drawText(matrixStack, this, new TranslatableText("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, new TranslatableText("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
|
||||
|
||||
int storedAmount = storageEntity.storedAmount;
|
||||
|
||||
if (storedAmount == 0 && !storageEntity.isLocked()) {
|
||||
textRenderer.draw(matrixStack, new TranslatableText("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
} else {
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.storage.store"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.storage.store"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, storageEntity.getDisplayedStack().getName(), 10, 30, 4210752);
|
||||
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.storage.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.storage.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(matrixStack, String.valueOf(storedAmount), 10, 60, 4210752);
|
||||
|
||||
String percentFilled = String.valueOf((int) ((double) storedAmount / (double) storageEntity.getMaxCapacity() * 100));
|
||||
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.fluid.FluidUtils;
|
||||
|
@ -57,27 +57,27 @@ public class GuiTankUnit extends GuiBase<BuiltScreenHandler> {
|
|||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
|
||||
// Draw input/out
|
||||
builder.drawText(matrixStack, this, new TranslatableText("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, new TranslatableText("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.in"), 100, 43, 4210752);
|
||||
builder.drawText(matrixStack, this, Text.translatable("gui.techreborn.unit.out"), 140, 43, 4210752);
|
||||
|
||||
|
||||
FluidInstance fluid = tankEntity.getTank().getFluidInstance();
|
||||
|
||||
if (fluid.isEmpty()) {
|
||||
textRenderer.draw(matrixStack, new TranslatableText("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
|
||||
} else {
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.tank.type"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.tank.type"), 10, 20, 4210752);
|
||||
textRenderer.draw(matrixStack, FluidUtils.getFluidName(fluid).replace("_", " "), 10, 30, 4210752);
|
||||
|
||||
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.tank.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.tank.amount"), 10, 50, 4210752);
|
||||
textRenderer.draw(matrixStack, fluid.getAmount().toString(), 10, 60, 4210752);
|
||||
|
||||
String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getFluidValueCapacity().getRawValue() * 100));
|
||||
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.used").append(percentFilled + "%"), 10, 70, 4210752);
|
||||
|
||||
textRenderer.draw(matrixStack, new TranslatableText("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
textRenderer.draw(matrixStack, Text.translatable("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import net.minecraft.world.BlockRenderView;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.client.RenderUtil;
|
||||
|
@ -54,7 +55,6 @@ import reborncore.common.util.Color;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBakedModel {
|
||||
|
@ -66,7 +66,7 @@ public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBa
|
|||
public abstract ModelIdentifier getFluidModel();
|
||||
|
||||
@Override
|
||||
public void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context) {
|
||||
public void emitItemQuads(ItemStack stack, Supplier<AbstractRandom> randomSupplier, RenderContext context) {
|
||||
Fluid fluid = Fluids.EMPTY;
|
||||
if (stack.getItem() instanceof ItemFluidInfo fluidInfo) {
|
||||
fluid = fluidInfo.getFluid(stack);
|
||||
|
@ -106,12 +106,12 @@ public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBa
|
|||
}
|
||||
|
||||
@Override
|
||||
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
|
||||
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<AbstractRandom> randomSupplier, RenderContext context) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState blockState, @Nullable Direction direction, Random random) {
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction face, AbstractRandom random) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import net.minecraft.client.texture.SpriteAtlasTexture;
|
|||
import net.minecraft.client.util.ModelIdentifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
import java.util.Random;
|
||||
|
@ -45,7 +46,7 @@ public class DynamicCellBakedModel extends BaseDynamicFluidBakedModel {
|
|||
private static final ModelIdentifier CELL_GLASS = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_glass"), "inventory");
|
||||
|
||||
@Override
|
||||
public void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context) {
|
||||
public void emitItemQuads(ItemStack stack, Supplier<AbstractRandom> randomSupplier, RenderContext context) {
|
||||
super.emitItemQuads(stack, randomSupplier, context);
|
||||
|
||||
BakedModelManager bakedModelManager = MinecraftClient.getInstance().getBakedModelManager();
|
||||
|
|
|
@ -39,9 +39,6 @@ import java.io.IOException;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
|
||||
/*
|
||||
* Credits to JsonDestroyer
|
||||
*/
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ModelHelper {
|
||||
|
||||
|
@ -61,7 +58,7 @@ public class ModelHelper {
|
|||
|
||||
public static Reader getReaderForResource(Identifier location) throws IOException {
|
||||
Identifier file = new Identifier(location.getNamespace(), location.getPath() + ".json");
|
||||
Resource resource = MinecraftClient.getInstance().getResourceManager().getResource(file);
|
||||
Resource resource = MinecraftClient.getInstance().getResourceManager().getResource(file).orElseThrow();
|
||||
return new BufferedReader(new InputStreamReader(resource.getInputStream(), Charsets.UTF_8));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import net.minecraft.client.render.block.BlockRenderManager;
|
|||
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import techreborn.blockentity.cable.CableBlockEntity;
|
||||
import techreborn.blocks.cable.CableBlock;
|
||||
|
||||
|
@ -56,7 +57,7 @@ public class CableCoverRenderer implements BlockEntityRenderer<CableBlockEntity>
|
|||
final BlockRenderManager blockRenderManager = MinecraftClient.getInstance().getBlockRenderManager();
|
||||
BlockState coverState = blockEntity.getCover() != null ? blockEntity.getCover() : Blocks.OAK_PLANKS.getDefaultState();
|
||||
VertexConsumer consumer = vertexConsumers.getBuffer(RenderLayers.getBlockLayer(coverState));
|
||||
blockRenderManager.renderBlock(coverState, blockEntity.getPos(), blockEntity.getWorld(), matrices, consumer, true, new Random());
|
||||
blockRenderManager.renderBlock(coverState, blockEntity.getPos(), blockEntity.getWorld(), matrices, consumer, true, AbstractRandom.create());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package techreborn.client.render.entitys;
|
||||
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.render.entity.EntityRenderer;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.TntMinecartEntityRenderer;
|
||||
|
@ -41,10 +42,12 @@ import techreborn.init.TRContent;
|
|||
* Created by Mark on 13/03/2016.
|
||||
*/
|
||||
public class NukeRenderer extends EntityRenderer<EntityNukePrimed> {
|
||||
private final BlockRenderManager blockRenderManager;
|
||||
|
||||
public NukeRenderer(EntityRendererFactory.Context ctx) {
|
||||
super(ctx);
|
||||
this.shadowRadius = 0.5F;
|
||||
this.blockRenderManager = ctx.getBlockRenderManager();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -68,7 +71,7 @@ public class NukeRenderer extends EntityRenderer<EntityNukePrimed> {
|
|||
|
||||
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-90.0F));
|
||||
matrixStack.translate(-0.5D, -0.5D, 0.5D);
|
||||
TntMinecartEntityRenderer.renderFlashingBlock(TRContent.NUKE.getDefaultState(), matrixStack, vertexConsumerProvider, i, entity.getFuse() / 5 % 2 == 0);
|
||||
TntMinecartEntityRenderer.renderFlashingBlock(blockRenderManager, TRContent.NUKE.getDefaultState(), matrixStack, vertexConsumerProvider, i, entity.getFuse() / 5 % 2 == 0);
|
||||
matrixStack.pop();
|
||||
super.render(entity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,11 @@ public class DestructoPackScreenHandler extends ScreenHandler {
|
|||
buildContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferSlot(PlayerEntity player, int index) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse(PlayerEntity arg0) {
|
||||
return true;
|
||||
|
|
|
@ -35,7 +35,7 @@ import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
|
|||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -62,7 +62,7 @@ public class FluidGeneratorRecipeCategory implements DisplayCategory<FluidGenera
|
|||
|
||||
@Override
|
||||
public Text getTitle() {
|
||||
return new TranslatableText(identifier.toString());
|
||||
return Text.translatable(identifier.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,7 +77,7 @@ public class FluidGeneratorRecipeCategory implements DisplayCategory<FluidGenera
|
|||
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 108, bounds.y + 8, 14, 50), recipeDisplay.getTotalEnergy(), ReiPlugin.EntryAnimation.upwards(5000), point -> {
|
||||
List<Text> list = Lists.newArrayList();
|
||||
list.add(Text.of("Energy"));
|
||||
list.add(new TranslatableText("techreborn.jei.recipe.generator.total", recipeDisplay.getTotalEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.translatable("techreborn.jei.recipe.generator.total", recipeDisplay.getTotalEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.of(""));
|
||||
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
|
||||
return Tooltip.create(point, list);
|
||||
|
|
|
@ -37,7 +37,7 @@ import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
|||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -63,7 +63,7 @@ public class FluidReplicatorRecipeCategory implements DisplayCategory<FluidRepli
|
|||
|
||||
@Override
|
||||
public Text getTitle() {
|
||||
return new TranslatableText(rebornRecipeType.name().toString());
|
||||
return Text.translatable(rebornRecipeType.name().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,7 +80,7 @@ public class FluidReplicatorRecipeCategory implements DisplayCategory<FluidRepli
|
|||
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 8, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), point -> {
|
||||
List<Text> list = Lists.newArrayList();
|
||||
list.add(Text.of("Energy"));
|
||||
list.add(new TranslatableText("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.translatable("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.of(""));
|
||||
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
|
||||
return Tooltip.create(point, list);
|
||||
|
@ -90,7 +90,7 @@ public class FluidReplicatorRecipeCategory implements DisplayCategory<FluidRepli
|
|||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 46 + 21, bounds.y + 30, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
widgets.add(ReiPlugin.createFluidDisplay(new Rectangle(bounds.x + 46 + 46, bounds.y + 8, 16, 50), recipeDisplay.getOutputEntries().get(0).get(0).cast(), ReiPlugin.EntryAnimation.upwards(5000)));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 24, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 24, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.leftAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -31,7 +31,7 @@ import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
|
|||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
|
@ -53,7 +53,7 @@ public abstract class AbstractEnergyConsumingMachineCategory<R extends RebornRec
|
|||
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 8, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), point -> {
|
||||
List<Text> list = Lists.newArrayList();
|
||||
list.add(Text.of("Energy"));
|
||||
list.add(new TranslatableText("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.translatable("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.of(""));
|
||||
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
|
||||
return Tooltip.create(point, list);
|
||||
|
|
|
@ -33,7 +33,7 @@ import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
|||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import techreborn.compat.rei.MachineRecipeDisplay;
|
||||
|
@ -56,7 +56,7 @@ public abstract class AbstractMachineCategory<R extends RebornRecipe> implements
|
|||
|
||||
@Override
|
||||
public Text getTitle() {
|
||||
return new TranslatableText(rebornRecipeType.name().toString());
|
||||
return Text.translatable(rebornRecipeType.name().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -52,7 +52,7 @@ public class AssemblingMachineCategory<R extends RebornRecipe> extends AbstractE
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 101 - 9, bounds.y + 45 - 19)).entries(getOutput(recipeDisplay, 0)).disableBackground().markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 76 - 9, bounds.y + 48 - 19, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,9 +28,9 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -55,14 +55,14 @@ public class BlastFurnaceCategory<R extends RebornRecipe> extends AbstractEnergy
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 101 + 20 - 17, bounds.y + 45 - 19)).entries(getOutput(recipeDisplay, 1)).disableBackground().markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 76 - 17, bounds.y + 48 - 19, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
|
||||
Text neededHeat = new LiteralText(String.valueOf(recipeDisplay.getHeat())).append(" ").append(new TranslatableText("techreborn.jei.recipe.heat"));
|
||||
Text neededHeat = Text.literal(String.valueOf(recipeDisplay.getHeat())).append(" ").append(Text.translatable("techreborn.jei.recipe.heat"));
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), neededHeat)
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
);
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 24, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 24, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.leftAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -54,7 +54,7 @@ public class DistillationTowerCategory<R extends RebornRecipe> extends AbstractE
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 101 + 40 - 23, bounds.y + 45 - 19)).entries(getOutput(recipeDisplay, 2)).disableBackground().markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 76 - 23, bounds.y + 48 - 19, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -55,7 +55,7 @@ public class ElectrolyzerCategory<R extends RebornRecipe> extends AbstractEnergy
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 55 + 17 - 9 + 40, bounds.y + 36 - 22)).entries(getOutput(recipeDisplay, 3)).disableBackground().markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 55 + 21, bounds.y + 36 + 4, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.UP));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 17, bounds.getMaxY() - 13), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 17, bounds.getMaxY() - 13), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -32,7 +32,7 @@ import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
|
|||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
|
@ -56,7 +56,7 @@ public class GrinderCategory<R extends RebornRecipe> extends AbstractMachineCate
|
|||
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 18, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), point -> {
|
||||
List<Text> list = Lists.newArrayList();
|
||||
list.add(Text.of("Energy"));
|
||||
list.add(new TranslatableText("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.translatable("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
|
||||
list.add(Text.of(""));
|
||||
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
|
||||
return Tooltip.create(point, list);
|
||||
|
@ -69,7 +69,7 @@ public class GrinderCategory<R extends RebornRecipe> extends AbstractMachineCate
|
|||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 55 + 21, bounds.y + 36 + 4, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
widgets.add(ReiPlugin.createFluidDisplay(new Rectangle(bounds.x + 55 - 26, bounds.y + 18, 16, 50), getInput(recipeDisplay, 1).get(0).cast(), ReiPlugin.EntryAnimation.downwards(5000)));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 51, bounds.y + 15), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 51, bounds.y + 15), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.leftAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -52,7 +52,7 @@ public class ImplosionCompressorCategory<R extends RebornRecipe> extends Abstrac
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 97 + 18 - 15, bounds.y + 45 - 19)).entries(getOutput(recipeDisplay, 1)).markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 76 - 15, bounds.y + 48 - 19, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -54,7 +54,7 @@ public class IndustrialCentrifugeCategory<R extends RebornRecipe> extends Abstra
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 116 - 17, bounds.y + 64 - 19)).entries(getOutput(recipeDisplay, 3)).markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 76 - 17, bounds.y + 48 - 19, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 24, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 24, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.leftAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -51,7 +51,7 @@ public class OneInputOneOutputCategory<R extends RebornRecipe> extends AbstractE
|
|||
widgets.add(Widgets.createSlot(new Point(bounds.x + 46 + 46, bounds.y + 26)).entries(getOutput(recipeDisplay, 0)).disableBackground().markOutput());
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 46 + 21, bounds.y + 30, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -53,7 +53,7 @@ public class SawmillCategory<R extends RebornRecipe> extends AbstractEnergyConsu
|
|||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 55 + 21, bounds.y + 30, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
widgets.add(ReiPlugin.createFluidDisplay(new Rectangle(bounds.x + 55 - 26, bounds.y + 8, 16, 50), getInput(recipeDisplay, 1).get(0).cast(), ReiPlugin.EntryAnimation.downwards(5000)));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 51, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 51, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.leftAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -28,7 +28,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
|
@ -53,7 +53,7 @@ public class TwoInputsCenterOutputCategory<R extends RebornRecipe> extends Abstr
|
|||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 29 + 21, bounds.y + 30, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.RIGHT));
|
||||
widgets.add(ReiPlugin.createProgressBar(bounds.x + 29 + 71, bounds.y + 30, recipeDisplay.getTime() * 50, GuiBuilder.ProgressDirection.LEFT));
|
||||
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), new TranslatableText("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 5), Text.translatable("techreborn.jei.recipe.processing.time.3", new DecimalFormat("###.##").format(recipeDisplay.getTime() / 20.0)))
|
||||
.shadow(false)
|
||||
.rightAligned()
|
||||
.color(0xFF404040, 0xFFBBBBBB)
|
||||
|
|
|
@ -31,7 +31,7 @@ import me.shedaniel.rei.plugin.client.categories.crafting.DefaultCraftingCategor
|
|||
import me.shedaniel.rei.plugin.common.displays.crafting.DefaultCraftingDisplay;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import techreborn.api.recipe.recipes.RollingMachineRecipe;
|
||||
import techreborn.compat.rei.ReiPlugin;
|
||||
|
@ -51,7 +51,7 @@ public class RollingMachineCategory extends DefaultCraftingCategory {
|
|||
|
||||
@Override
|
||||
public Text getTitle() {
|
||||
return new TranslatableText(rebornRecipeType.name().toString());
|
||||
return Text.translatable(rebornRecipeType.name().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.item.Items;
|
|||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.village.TradeOffer;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
import net.minecraft.world.poi.PointOfInterestType;
|
||||
|
@ -28,9 +29,9 @@ public class TRVillager {
|
|||
ELECTRICIAN_ID, 1, 1, TRContent.Machine.SOLID_FUEL_GENERATOR.block);
|
||||
|
||||
public static final VillagerProfession METALLURGIST_PROFESSION = Registry.register(Registry.VILLAGER_PROFESSION, METALLURGIST_ID,
|
||||
VillagerProfessionBuilder.create().id(METALLURGIST_ID).workstation(METALLURGIST_POI).workSound(SoundEvents.ENTITY_VILLAGER_WORK_TOOLSMITH).build());
|
||||
VillagerProfessionBuilder.create().id(METALLURGIST_ID).workstation(RegistryKey.of(Registry.POINT_OF_INTEREST_TYPE_KEY, METALLURGIST_ID)).workSound(SoundEvents.ENTITY_VILLAGER_WORK_TOOLSMITH).build());
|
||||
public static final VillagerProfession ELECTRICIAN_PROFESSION = Registry.register(Registry.VILLAGER_PROFESSION,ELECTRICIAN_ID,
|
||||
VillagerProfessionBuilder.create().id(ELECTRICIAN_ID).workstation(ELECTRICIAN_POI).workSound(ModSounds.CABLE_SHOCK).build());
|
||||
VillagerProfessionBuilder.create().id(ELECTRICIAN_ID).workstation(RegistryKey.of(Registry.POINT_OF_INTEREST_TYPE_KEY, ELECTRICIAN_ID)).workSound(ModSounds.CABLE_SHOCK).build());
|
||||
|
||||
private TRVillager() {/* No instantiation. */}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.mojang.brigadier.context.CommandContext;
|
|||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -69,11 +69,11 @@ public class TechRebornTemplates {
|
|||
process(processor);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ctx.getSource().sendError(new LiteralText(e.getMessage()));
|
||||
ctx.getSource().sendError(Text.literal(e.getMessage()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctx.getSource().sendFeedback(new LiteralText("done"), true);
|
||||
ctx.getSource().sendFeedback(Text.literal("done"), true);
|
||||
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -49,9 +49,9 @@ import net.minecraft.sound.SoundCategory;
|
|||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
|
@ -124,7 +124,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
if (!blockState.isAir() && !canPlace && (!(blockState.getBlock() instanceof FluidFillable) || !((FluidFillable) blockState.getBlock()).canFillWithFluid(world, pos, blockState, fluid))) {
|
||||
return hitResult != null && this.placeFluid(player, world, hitResult.getBlockPos().offset(hitResult.getSide()), null, filledCell);
|
||||
} else {
|
||||
if (world.getDimension().isUltrawarm() && fluid.isIn(FluidTags.WATER)) {
|
||||
if (world.getDimension().ultrawarm() && fluid.isIn(FluidTags.WATER)) {
|
||||
int i = pos.getX();
|
||||
int j = pos.getY();
|
||||
int k = pos.getZ();
|
||||
|
@ -167,7 +167,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
Fluid fluid = getFluid(itemStack);
|
||||
if (fluid != Fluids.EMPTY) {
|
||||
// TODO use translation keys for fluid and the cell https://fabric.asie.pl/wiki/tutorial:lang?s[]=translation might be useful
|
||||
return new LiteralText(new TranslatableText("item.techreborn.cell.fluid").getString().replace("$fluid$", FluidUtils.getFluidName(fluid)));
|
||||
return Text.literal(Text.translatable("item.techreborn.cell.fluid").getString().replace("$fluid$", FluidUtils.getFluidName(fluid)));
|
||||
}
|
||||
return super.getName(itemStack);
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.dynamic.GlobalPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.GlobalPos;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -66,17 +66,17 @@ public class FrequencyTransmitterItem extends Item {
|
|||
.ifPresent(tag -> stack.getOrCreateNbt().put("pos", tag));
|
||||
|
||||
if (context.getPlayer() instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, MessageIDs.freqTransmitterID, new TranslatableText("techreborn.message.setTo")
|
||||
.append(new LiteralText(" X:").formatted(Formatting.GRAY))
|
||||
.append(new LiteralText(String.valueOf(pos.getX())).formatted(Formatting.GOLD))
|
||||
.append(new LiteralText(" Y:").formatted(Formatting.GRAY))
|
||||
.append(new LiteralText(String.valueOf(pos.getY())).formatted(Formatting.GOLD))
|
||||
.append(new LiteralText(" Z:").formatted(Formatting.GRAY))
|
||||
.append(new LiteralText(String.valueOf(pos.getZ())).formatted(Formatting.GOLD))
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, MessageIDs.freqTransmitterID, Text.translatable("techreborn.message.setTo")
|
||||
.append(Text.literal(" X:").formatted(Formatting.GRAY))
|
||||
.append(Text.literal(String.valueOf(pos.getX())).formatted(Formatting.GOLD))
|
||||
.append(Text.literal(" Y:").formatted(Formatting.GRAY))
|
||||
.append(Text.literal(String.valueOf(pos.getY())).formatted(Formatting.GOLD))
|
||||
.append(Text.literal(" Z:").formatted(Formatting.GRAY))
|
||||
.append(Text.literal(String.valueOf(pos.getZ())).formatted(Formatting.GOLD))
|
||||
.append(" ")
|
||||
.append(new TranslatableText("techreborn.message.in").formatted(Formatting.GRAY))
|
||||
.append(Text.translatable("techreborn.message.in").formatted(Formatting.GRAY))
|
||||
.append(" ")
|
||||
.append(new LiteralText(getDimName(globalPos.getDimension()).toString()).formatted(Formatting.GOLD)));
|
||||
.append(Text.literal(getDimName(globalPos.getDimension()).toString()).formatted(Formatting.GOLD)));
|
||||
}
|
||||
|
||||
return ActionResult.SUCCESS;
|
||||
|
@ -98,11 +98,11 @@ public class FrequencyTransmitterItem extends Item {
|
|||
|
||||
if (player instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, MessageIDs.freqTransmitterID,
|
||||
new TranslatableText("techreborn.message.coordsHaveBeen")
|
||||
Text.translatable("techreborn.message.coordsHaveBeen")
|
||||
.formatted(Formatting.GRAY)
|
||||
.append(" ")
|
||||
.append(
|
||||
new TranslatableText("techreborn.message.cleared")
|
||||
Text.translatable("techreborn.message.cleared")
|
||||
.formatted(Formatting.GOLD)
|
||||
)
|
||||
);
|
||||
|
@ -116,10 +116,10 @@ public class FrequencyTransmitterItem extends Item {
|
|||
public void appendTooltip(ItemStack stack, @Nullable World worldIn, List<Text> tooltip, TooltipContext flagIn) {
|
||||
getPos(stack)
|
||||
.ifPresent(globalPos -> {
|
||||
tooltip.add(new LiteralText(Formatting.GRAY + "X: " + Formatting.GOLD + globalPos.getPos().getX()));
|
||||
tooltip.add(new LiteralText(Formatting.GRAY + "Y: " + Formatting.GOLD + globalPos.getPos().getY()));
|
||||
tooltip.add(new LiteralText(Formatting.GRAY + "Z: " + Formatting.GOLD + globalPos.getPos().getZ()));
|
||||
tooltip.add(new LiteralText(Formatting.DARK_GRAY + getDimName(globalPos.getDimension()).toString()));
|
||||
tooltip.add(Text.literal(Formatting.GRAY + "X: " + Formatting.GOLD + globalPos.getPos().getX()));
|
||||
tooltip.add(Text.literal(Formatting.GRAY + "Y: " + Formatting.GOLD + globalPos.getPos().getY()));
|
||||
tooltip.add(Text.literal(Formatting.GRAY + "Z: " + Formatting.GOLD + globalPos.getPos().getZ()));
|
||||
tooltip.add(Text.literal(Formatting.DARK_GRAY + getDimName(globalPos.getDimension()).toString()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.command.BlockDataObject;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
|
@ -63,15 +63,15 @@ public class DebugToolItem extends Item {
|
|||
if (context.getWorld().isClient) {
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
sendMessage(context, new LiteralText(getRegistryName(block)));
|
||||
sendMessage(context, Text.literal(getRegistryName(block)));
|
||||
|
||||
for (Entry<Property<?>, Comparable<?>> entry : blockState.getEntries().entrySet()) {
|
||||
sendMessage(context, new LiteralText(getPropertyString(entry)));
|
||||
sendMessage(context, Text.literal(getPropertyString(entry)));
|
||||
}
|
||||
|
||||
EnergyStorage energyStorage = EnergyStorage.SIDED.find(context.getWorld(), context.getBlockPos(), context.getSide());
|
||||
if (energyStorage != null) {
|
||||
sendMessage(context, new LiteralText(getRCPower(energyStorage)));
|
||||
sendMessage(context, Text.literal(getRCPower(energyStorage)));
|
||||
}
|
||||
|
||||
BlockEntity blockEntity = context.getWorld().getBlockEntity(context.getBlockPos());
|
||||
|
@ -79,7 +79,7 @@ public class DebugToolItem extends Item {
|
|||
return ActionResult.CONSUME;
|
||||
}
|
||||
|
||||
sendMessage(context, new LiteralText(getBlockEntityType(blockEntity)));
|
||||
sendMessage(context, Text.literal(getBlockEntityType(blockEntity)));
|
||||
|
||||
sendMessage(context, getBlockEntityTags(blockEntity));
|
||||
|
||||
|
@ -90,7 +90,7 @@ public class DebugToolItem extends Item {
|
|||
if (context.getWorld().isClient || context.getPlayer() == null) {
|
||||
return;
|
||||
}
|
||||
context.getPlayer().sendSystemMessage(message, Util.NIL_UUID);
|
||||
context.getPlayer().sendMessage(message);
|
||||
}
|
||||
|
||||
private String getPropertyString(Entry<Property<?>, Comparable<?>> entryIn) {
|
||||
|
@ -136,7 +136,7 @@ public class DebugToolItem extends Item {
|
|||
}
|
||||
|
||||
private Text getBlockEntityTags(BlockEntity blockEntity){
|
||||
MutableText s = new LiteralText("BlockEntity Tags:").formatted(Formatting.GREEN);
|
||||
MutableText s = Text.literal("BlockEntity Tags:").formatted(Formatting.GREEN);
|
||||
|
||||
BlockDataObject bdo = new BlockDataObject(blockEntity, blockEntity.getPos());
|
||||
s.append(bdo.getNbt().toString());
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.nbt.NbtHelper;
|
|||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -97,10 +97,10 @@ public class PaintingToolItem extends Item {
|
|||
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
|
||||
BlockState blockState = getCover(stack);
|
||||
if (blockState != null) {
|
||||
tooltip.add((new TranslatableText(blockState.getBlock().getTranslationKey())).formatted(Formatting.GRAY));
|
||||
tooltip.add((new TranslatableText("techreborn.tooltip.painting_tool.apply")).formatted(Formatting.GOLD));
|
||||
tooltip.add((Text.translatable(blockState.getBlock().getTranslationKey())).formatted(Formatting.GRAY));
|
||||
tooltip.add((Text.translatable("techreborn.tooltip.painting_tool.apply")).formatted(Formatting.GOLD));
|
||||
} else {
|
||||
tooltip.add((new TranslatableText("techreborn.tooltip.painting_tool.select")).formatted(Formatting.GOLD));
|
||||
tooltip.add((Text.translatable("techreborn.tooltip.painting_tool.select")).formatted(Formatting.GOLD));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ import net.minecraft.entity.LivingEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -69,7 +69,7 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
ItemUtils.switchActive(stack, cost, messageId, entity);
|
||||
stack.getOrCreateNbt().putBoolean("AOE5", false);
|
||||
if (entity instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, messageId, new TranslatableText("techreborn.message.setTo").formatted(Formatting.GRAY).append(" ").append(new LiteralText("3*3").formatted(Formatting.GOLD)));
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, messageId, Text.translatable("techreborn.message.setTo").formatted(Formatting.GRAY).append(" ").append(Text.literal("3*3").formatted(Formatting.GOLD)));
|
||||
}
|
||||
} else {
|
||||
if (isAOE5(stack)) {
|
||||
|
@ -78,7 +78,7 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
} else {
|
||||
stack.getOrCreateNbt().putBoolean("AOE5", true);
|
||||
if (entity instanceof ServerPlayerEntity serverPlayerEntity) {
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, messageId, new TranslatableText("techreborn.message.setTo").formatted(Formatting.GRAY).append(" ").append(new LiteralText("5*5").formatted(Formatting.GOLD)));
|
||||
ChatUtils.sendNoSpamMessage(serverPlayerEntity, messageId, Text.translatable("techreborn.message.setTo").formatted(Formatting.GRAY).append(" ").append(Text.literal("5*5").formatted(Formatting.GOLD)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,9 +149,9 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
ItemUtils.buildActiveTooltip(stack, tooltip);
|
||||
if (ItemUtils.isActive(stack)) {
|
||||
if (isAOE5(stack)) {
|
||||
tooltip.add(new LiteralText("5*5").formatted(Formatting.RED));
|
||||
tooltip.add(Text.literal("5*5").formatted(Formatting.RED));
|
||||
} else {
|
||||
tooltip.add(new LiteralText("3*3").formatted(Formatting.RED));
|
||||
tooltip.add(Text.literal("3*3").formatted(Formatting.RED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package techreborn.world;
|
||||
|
||||
import net.minecraft.block.sapling.SaplingGenerator;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
|
@ -35,7 +36,7 @@ import java.util.Random;
|
|||
public class RubberSaplingGenerator extends SaplingGenerator {
|
||||
@Nullable
|
||||
@Override
|
||||
protected RegistryEntry<? extends ConfiguredFeature<?, ?>> getTreeFeature(Random random, boolean bees) {
|
||||
protected RegistryEntry<? extends ConfiguredFeature<?, ?>> getTreeFeature(AbstractRandom random, boolean bees) {
|
||||
return WorldGenerator.getEntry(BuiltinRegistries.CONFIGURED_FEATURE, WorldGenerator.RUBBER_TREE_FEATURE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,13 +64,13 @@ public class RubberTreeSpikeDecorator extends TreeDecorator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void generate(TestableWorld world, BiConsumer<BlockPos, BlockState> replacer, Random random, List<BlockPos> logPositions, List<BlockPos> leavesPositions) {
|
||||
logPositions.stream()
|
||||
public void generate(Generator generator) {
|
||||
generator.getLogPositions().stream()
|
||||
.max(Comparator.comparingInt(BlockPos::getY))
|
||||
.ifPresent(blockPos -> {
|
||||
for (int i = 0; i < spireHeight; i++) {
|
||||
BlockPos sPos = blockPos.up(i);
|
||||
replacer.accept(sPos, provider.getBlockState(random, sPos));
|
||||
generator.replace(sPos, provider.getBlockState(generator.getRandom(), sPos));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.world;
|
|||
|
||||
import net.fabricmc.fabric.api.biome.v1.*;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tag.BiomeTags;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.collection.DataPool;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -35,6 +36,7 @@ import net.minecraft.util.registry.Registry;
|
|||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.feature.*;
|
||||
import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize;
|
||||
|
@ -72,7 +74,9 @@ public class WorldGenerator {
|
|||
|
||||
BiomeModifications.create(new Identifier("techreborn", "features"))
|
||||
.add(ModificationPhase.ADDITIONS, BiomeSelectors.all(), oreModifier())
|
||||
.add(ModificationPhase.ADDITIONS, BiomeSelectors.categories(Biome.Category.FOREST, Biome.Category.TAIGA, Biome.Category.SWAMP), rubberTreeModifier());
|
||||
.add(ModificationPhase.ADDITIONS, BiomeSelectors.tag(BiomeTags.IS_FOREST)
|
||||
.or(BiomeSelectors.tag(BiomeTags.IS_TAIGA))
|
||||
.or(BiomeSelectors.includeByKey(BiomeKeys.SWAMP)), rubberTreeModifier());
|
||||
}
|
||||
|
||||
private static BiConsumer<BiomeSelectionContext, BiomeModificationContext> oreModifier() {
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.13.3",
|
||||
"fabric": ">=0.51.1",
|
||||
"fabricloader": ">=0.14.5",
|
||||
"fabric": ">=0.52.4",
|
||||
"reborncore": "*",
|
||||
"team_reborn_energy": ">=2.2.0",
|
||||
"fabric-biome-api-v1": ">=3.0.0",
|
||||
"minecraft": "~1.18.2-beta.1"
|
||||
"minecraft": "~1.19-beta.1"
|
||||
},
|
||||
"accessWidener": "techreborn.accesswidener",
|
||||
"authors": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue