mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Initial 1.13.2 update. Major thing to note is that Dimensions have been completely revamped.
DimensionType is not unique per Dimension. See DimensionManager for more details. Vanilla now has a chunk loading system, so Forge's will need to be deprecated/adapted.
This commit is contained in:
1 parent
9a1688599a
commit
ca72710937
361 files changed
+3166
-3547
No files matched your search
@@ -31,6 +31,7 @@ import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.storage.AnvilChunkLoader;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.storage.SessionLockException;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.WorldWorkerManager.IWorker;
|
||||
@@ -40,7 +41,7 @@ public class ChunkGenWorker implements IWorker
|
||||
private final CommandSource listener;
|
||||
protected final BlockPos start;
|
||||
protected final int total;
|
||||
private final int dim;
|
||||
private final DimensionType dim;
|
||||
private final Queue<BlockPos> queue;
|
||||
private final int notificationFrequency;
|
||||
private int lastNotification = 0;
|
||||
@@ -48,7 +49,7 @@ public class ChunkGenWorker implements IWorker
|
||||
private int genned = 0;
|
||||
private Boolean keepingLoaded;
|
||||
|
||||
public ChunkGenWorker(CommandSource listener, BlockPos start, int total, int dim, int interval)
|
||||
public ChunkGenWorker(CommandSource listener, BlockPos start, int total, DimensionType dim, int interval)
|
||||
{
|
||||
this.listener = listener;
|
||||
this.start = start;
|
||||
@@ -99,11 +100,10 @@ public class ChunkGenWorker implements IWorker
|
||||
@Override
|
||||
public boolean doWork()
|
||||
{
|
||||
WorldServer world = DimensionManager.getWorld(dim);
|
||||
WorldServer world = DimensionManager.getWorld(listener.getServer(), dim, false, false);
|
||||
if (world == null)
|
||||
{
|
||||
DimensionManager.initDimension(dim);
|
||||
world = DimensionManager.getWorld(dim);
|
||||
world = DimensionManager.initWorld(listener.getServer(), dim);
|
||||
if (world == null)
|
||||
{
|
||||
listener.sendFeedback(new TextComponentTranslation("commands.forge.gen.dim_fail", dim), true);
|
||||
@@ -131,7 +131,7 @@ public class ChunkGenWorker implements IWorker
|
||||
// While we work we don't want to cause world load spam so pause unloading the world.
|
||||
if (keepingLoaded == null)
|
||||
{
|
||||
keepingLoaded = DimensionManager.keepDimensionLoaded(dim, true);
|
||||
keepingLoaded = DimensionManager.keepLoaded(dim, true);
|
||||
}
|
||||
|
||||
if (++lastNotification >= notificationFrequency || lastNotifcationTime < System.currentTimeMillis() - 60*1000)
|
||||
@@ -180,9 +180,9 @@ public class ChunkGenWorker implements IWorker
|
||||
if (queue.size() == 0)
|
||||
{
|
||||
listener.sendFeedback(new TextComponentTranslation("commands.forge.gen.complete", genned, total, dim), true);
|
||||
if (keepingLoaded != null && keepingLoaded)
|
||||
if (keepingLoaded != null && !keepingLoaded)
|
||||
{
|
||||
DimensionManager.keepDimensionLoaded(dim, false);
|
||||
DimensionManager.keepLoaded(dim, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,15 +19,16 @@
|
||||
|
||||
package net.minecraftforge.server.command;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.IntSortedSet;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.Commands;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.mojang.brigadier.builder.ArgumentBuilder;
|
||||
|
||||
@@ -39,10 +40,15 @@ public class CommandDimensions
|
||||
.requires(cs->cs.hasPermissionLevel(0)) //permission
|
||||
.executes(ctx -> {
|
||||
ctx.getSource().sendFeedback(new TextComponentTranslation("commands.forge.dimensions.list"), true);
|
||||
for (Map.Entry<DimensionType, IntSortedSet> entry : DimensionManager.getRegisteredDimensions().entrySet())
|
||||
{
|
||||
ctx.getSource().sendFeedback(new TextComponentString(entry.getKey().getName() + ": " + entry.getValue()), true);
|
||||
Map<String, List<String>> types = new HashMap<>();
|
||||
for (DimensionType dim : DimensionType.func_212681_b()) {
|
||||
String key = dim.getModType() == null ? "Vanilla" : dim.getModType().getRegistryName().toString();
|
||||
types.computeIfAbsent(key, k -> new ArrayList<>()).add(DimensionType.func_212678_a(dim).toString());
|
||||
}
|
||||
|
||||
types.keySet().stream().sorted().forEach(key -> {
|
||||
ctx.getSource().sendFeedback(new TextComponentString(key + ": " + types.get(key).stream().sorted().collect(Collectors.joining(", "))), true);
|
||||
});
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
|
||||
package net.minecraftforge.server.command;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -29,27 +27,23 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.ArgumentBuilder;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.Commands;
|
||||
import net.minecraft.command.ISuggestionProvider;
|
||||
import net.minecraft.command.arguments.BlockPosArgument;
|
||||
import net.minecraft.command.arguments.DimensionArgument;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
@@ -75,16 +69,15 @@ class CommandEntity
|
||||
.requires(cs->cs.hasPermissionLevel(2)) //permission
|
||||
.then(Commands.argument("filter", StringArgumentType.string())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(ForgeRegistries.ENTITIES.getKeys().stream().map(id -> id.toString()), builder))
|
||||
.then(Commands.argument("dim", IntegerArgumentType.integer())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder))
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), IntegerArgumentType.getInteger(ctx, "dim")))
|
||||
.then(Commands.argument("dim", DimensionArgument.func_212595_a())
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), DimensionArgument.func_212592_a(ctx, "dim")))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().dimension.getId()))
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().dimension.getType()))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), "*", ctx.getSource().getWorld().dimension.getId()));
|
||||
.executes(ctx -> execute(ctx.getSource(), "*", ctx.getSource().getWorld().dimension.getType()));
|
||||
}
|
||||
|
||||
private static int execute(CommandSource sender, String filter, int dim) throws CommandSyntaxException
|
||||
private static int execute(CommandSource sender, String filter, DimensionType dim) throws CommandSyntaxException
|
||||
{
|
||||
final String cleanFilter = filter.replace("?", ".?").replace("*", ".*?");
|
||||
|
||||
@@ -93,7 +86,7 @@ class CommandEntity
|
||||
if (names.isEmpty())
|
||||
throw INVALID_FILTER.create();
|
||||
|
||||
WorldServer world = DimensionManager.getWorld(dim);
|
||||
WorldServer world = DimensionManager.getWorld(sender.getServer(), dim, false, false);
|
||||
if (world == null)
|
||||
throw INVALID_DIMENSION.create(dim);
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.Commands;
|
||||
import net.minecraft.command.ISuggestionProvider;
|
||||
import net.minecraft.command.arguments.BlockPosArgument;
|
||||
import net.minecraft.command.arguments.DimensionArgument;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
@@ -52,14 +53,13 @@ class CommandGenerate
|
||||
.requires(cs->cs.hasPermissionLevel(4)) //permission
|
||||
.then(Commands.argument("pos", BlockPosArgument.blockPos())
|
||||
.then(Commands.argument("count", IntegerArgumentType.integer(1))
|
||||
.then(Commands.argument("dim", IntegerArgumentType.integer())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder))
|
||||
.then(Commands.argument("dim", DimensionArgument.func_212595_a())
|
||||
.then(Commands.argument("interval", IntegerArgumentType.integer())
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), getInt(ctx, "dim"), getInt(ctx, "interval")))
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.func_212592_a(ctx, "dim"), getInt(ctx, "interval")))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), getInt(ctx, "dim"), -1))
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.func_212592_a(ctx, "dim"), -1))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), ctx.getSource().getWorld().dimension.getId(), -1))
|
||||
.executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), ctx.getSource().getWorld().dimension.getType(), -1))
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -69,14 +69,14 @@ class CommandGenerate
|
||||
return IntegerArgumentType.getInteger(ctx, name);
|
||||
}
|
||||
|
||||
private static int execute(CommandSource source, BlockPos pos, int count, int dim, int interval) throws CommandException
|
||||
private static int execute(CommandSource source, BlockPos pos, int count, DimensionType dim, int interval) throws CommandException
|
||||
{
|
||||
BlockPos chunkpos = new BlockPos(pos.getX() >> 4, 0, pos.getZ() >> 4);
|
||||
|
||||
ChunkGenWorker worker = new ChunkGenWorker(source, chunkpos, count, dim, interval);
|
||||
source.sendFeedback(worker.getStartMessage(source), true);
|
||||
WorldWorkerManager.addWorker(worker);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -19,36 +19,24 @@
|
||||
|
||||
package net.minecraftforge.server.command;
|
||||
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.Commands;
|
||||
import net.minecraft.command.ISuggestionProvider;
|
||||
import net.minecraft.command.arguments.BlockPosArgument;
|
||||
import net.minecraft.command.arguments.DimensionArgument;
|
||||
import net.minecraft.command.arguments.EntityArgument;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.util.ITeleporter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.builder.ArgumentBuilder;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.IntSortedSet;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class CommandSetDimension
|
||||
{
|
||||
@@ -59,24 +47,23 @@ public class CommandSetDimension
|
||||
return Commands.literal("setdimension")
|
||||
.requires(cs->cs.hasPermissionLevel(2)) //permission
|
||||
.then(Commands.argument("targets", EntityArgument.multipleEntities())
|
||||
.then(Commands.argument("dim", IntegerArgumentType.integer())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder))
|
||||
.then(Commands.argument("dim", DimensionArgument.func_212595_a())
|
||||
.then(Commands.argument("pos", BlockPosArgument.blockPos())
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), IntegerArgumentType.getInteger(ctx, "dim"), BlockPosArgument.getBlockPos(ctx, "pos")))
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.func_212592_a(ctx, "dim"), BlockPosArgument.getBlockPos(ctx, "pos")))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), IntegerArgumentType.getInteger(ctx, "dim"), new BlockPos(ctx.getSource().getPos())))
|
||||
.executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.func_212592_a(ctx, "dim"), new BlockPos(ctx.getSource().getPos())))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private static int execute(CommandSource sender, Collection<? extends Entity> entities, int dim, BlockPos pos) throws CommandSyntaxException
|
||||
private static int execute(CommandSource sender, Collection<? extends Entity> entities, DimensionType dim, BlockPos pos) throws CommandSyntaxException
|
||||
{
|
||||
entities.removeIf(CommandSetDimension::checkEntity);
|
||||
if (entities.isEmpty())
|
||||
throw NO_ENTITIES.create();
|
||||
|
||||
if (!DimensionManager.isDimensionRegistered(dim))
|
||||
throw INVALID_DIMENSION.create(dim);
|
||||
//if (!DimensionManager.isDimensionRegistered(dim))
|
||||
// throw INVALID_DIMENSION.create(dim);
|
||||
|
||||
final ITeleporter teleporter = new CommandTeleporter(pos);
|
||||
entities.stream().filter(e -> e.dimension == dim).forEach(e -> sender.sendFeedback(new TextComponentTranslation("commands.forge.setdim.invalid.nochange", e.getDisplayName(), dim), true));
|
||||
|
||||
@@ -21,33 +21,31 @@ package net.minecraftforge.server.command;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.builder.ArgumentBuilder;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.Commands;
|
||||
import net.minecraft.command.ISuggestionProvider;
|
||||
import net.minecraft.command.arguments.DimensionArgument;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
class CommandTps
|
||||
{
|
||||
private static final DynamicCommandExceptionType INVALID_DIMENSION = new DynamicCommandExceptionType(dim -> new TextComponentTranslation("commands.forge.tps.invalid", dim, DimensionManager.getIDStream().sorted().map(id -> id.toString()).collect(Collectors.joining(", "))));
|
||||
private static final DynamicCommandExceptionType INVALID_DIMENSION = new DynamicCommandExceptionType(dim -> new TextComponentTranslation("commands.forge.tps.invalid", dim, StreamSupport.stream(DimensionType.func_212681_b().spliterator(), false).map(d -> DimensionType.func_212678_a(d).toString()).sorted().collect(Collectors.joining(", "))));
|
||||
private static final DecimalFormat TIME_FORMATTER = new DecimalFormat("########0.000");
|
||||
|
||||
static ArgumentBuilder<CommandSource, ?> register()
|
||||
{
|
||||
return Commands.literal("tps")
|
||||
.requires(cs->cs.hasPermissionLevel(0)) //permission
|
||||
.then(Commands.argument("dim", IntegerArgumentType.integer())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder))
|
||||
.executes(ctx -> sendTime(ctx.getSource(), IntegerArgumentType.getInteger(ctx, "dim")))
|
||||
.then(Commands.argument("dim", DimensionArgument.func_212595_a())
|
||||
.executes(ctx -> sendTime(ctx.getSource(), DimensionArgument.func_212592_a(ctx, "dim")))
|
||||
)
|
||||
.executes(ctx -> {
|
||||
for (Integer dim : (Iterable<Integer>)DimensionManager.getIDStream().sorted()::iterator)
|
||||
for (DimensionType dim : DimensionType.func_212681_b())
|
||||
sendTime(ctx.getSource(), dim);
|
||||
|
||||
double meanTickTime = mean(ctx.getSource().getServer().tickTimeArray) * 1.0E-6D;
|
||||
@@ -59,26 +57,16 @@ class CommandTps
|
||||
);
|
||||
}
|
||||
|
||||
private static long[] getTimes(int dim)
|
||||
private static int sendTime(CommandSource cs, DimensionType dim) throws CommandSyntaxException
|
||||
{
|
||||
//TODO: Implement, needs patch.
|
||||
return null;
|
||||
}
|
||||
|
||||
private static int sendTime(CommandSource cs, int dim) throws CommandSyntaxException
|
||||
{
|
||||
long[] times = getTimes(dim);
|
||||
long[] times = cs.getServer().getTickTime(dim);
|
||||
|
||||
if (times == null)
|
||||
throw INVALID_DIMENSION.create(dim);
|
||||
throw INVALID_DIMENSION.create(DimensionType.func_212678_a(dim));
|
||||
|
||||
double worldTickTime = mean(times) * 1.0E-6D;
|
||||
double worldTPS = Math.min(1000.0 / worldTickTime, 20);
|
||||
DimensionType type = DimensionManager.getProviderType(dim);
|
||||
if (type == null)
|
||||
cs.sendFeedback(new TextComponentTranslation("commands.forge.tps.summary.basic", dim, TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), true);
|
||||
else
|
||||
cs.sendFeedback(new TextComponentTranslation("commands.forge.tps.summary.named", dim, type.getName(), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), true);
|
||||
cs.sendFeedback(new TextComponentTranslation("commands.forge.tps.summary.named", dim.getId(), DimensionType.func_212678_a(dim), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), true);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
@@ -154,21 +155,6 @@ class CommandTrack
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates a world dimension ID into a name
|
||||
*
|
||||
* @param dimId The dimension ID
|
||||
* @return The name of the dimension
|
||||
*/
|
||||
protected static String getWorldName(int dimId)
|
||||
{
|
||||
DimensionType type = DimensionManager.getProviderType(dimId);
|
||||
if (type == null)
|
||||
return "Dim " + dimId;
|
||||
else
|
||||
return type.getName();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TrackResultsEntity
|
||||
@@ -185,7 +171,7 @@ class CommandTrack
|
||||
double averageTimings = data.getAverageTimings();
|
||||
String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "�s" : "ms");
|
||||
|
||||
return new TextComponentTranslation("commands.forge.tracking.timing_entry", entity.getType().getRegistryName(), TrackResults.getWorldName(entity.world.dimension.getId()), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
return new TextComponentTranslation("commands.forge.tracking.timing_entry", entity.getType().getRegistryName(), DimensionType.func_212678_a(entity.world.dimension.getType()), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -205,7 +191,7 @@ class CommandTrack
|
||||
|
||||
double averageTimings = data.getAverageTimings();
|
||||
String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "�s" : "ms");
|
||||
return new TextComponentTranslation("commands.forge.tracking.timing_entry", te.getType().getRegistryName(), TrackResults.getWorldName(te.getWorld().dimension.getId()), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
return new TextComponentTranslation("commands.forge.tracking.timing_entry", te.getType().getRegistryName(), DimensionType.func_212678_a(te.getWorld().dimension.getType()), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user