mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Update forge mappings to 20201028-1.16.3 (#7435)
This commit is contained in:
1 parent
6e0e67b14d
commit
53eedb0f10
93 files changed
+598
-588
No files matched your search
@@ -141,7 +141,7 @@ public class ChunkGenWorker implements IWorker
|
||||
|
||||
if (queue.size() == 0)
|
||||
{
|
||||
listener.sendFeedback(new TranslationTextComponent("commands.forge.gen.complete", genned, total, dim.func_234923_W_().func_240901_a_()), true);
|
||||
listener.sendFeedback(new TranslationTextComponent("commands.forge.gen.complete", genned, total, dim.getDimensionKey().getLocation()), true);
|
||||
/* TODO: Readd if/when we introduce world unloading, or get Mojang to do it.
|
||||
if (keepingLoaded != null && !keepingLoaded)
|
||||
DimensionManager.keepLoaded(dim, false);
|
||||
|
||||
@@ -45,11 +45,11 @@ public class CommandDimensions
|
||||
.requires(cs->cs.hasPermissionLevel(0)) //permission
|
||||
.executes(ctx -> {
|
||||
ctx.getSource().sendFeedback(new TranslationTextComponent("commands.forge.dimensions.list"), true);
|
||||
final Registry<DimensionType> reg = ctx.getSource().func_241861_q().func_243612_b(Registry.field_239698_ad_);
|
||||
final Registry<DimensionType> reg = ctx.getSource().func_241861_q().getRegistry(Registry.DIMENSION_TYPE_KEY);
|
||||
|
||||
Map<ResourceLocation, List<ResourceLocation>> types = new HashMap<>();
|
||||
for (ServerWorld dim : ctx.getSource().getServer().getWorlds()) {
|
||||
types.computeIfAbsent(reg.getKey(dim.func_230315_m_()), k -> new ArrayList<>()).add(dim.func_234923_W_().func_240901_a_());
|
||||
types.computeIfAbsent(reg.getKey(dim.getDimensionType()), k -> new ArrayList<>()).add(dim.getDimensionKey().getLocation());
|
||||
}
|
||||
|
||||
types.keySet().stream().sorted().forEach(key -> {
|
||||
|
||||
@@ -69,11 +69,11 @@ class CommandEntity
|
||||
.then(Commands.argument("filter", StringArgumentType.string())
|
||||
.suggests((ctx, builder) -> ISuggestionProvider.suggest(ForgeRegistries.ENTITIES.getKeys().stream().map(ResourceLocation::toString).map(StringArgumentType::escapeIfRequired), builder))
|
||||
.then(Commands.argument("dim", DimensionArgument.getDimension())
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), DimensionArgument.getDimensionArgument(ctx, "dim").func_234923_W_()))
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), DimensionArgument.getDimensionArgument(ctx, "dim").getDimensionKey()))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().func_234923_W_()))
|
||||
.executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().getDimensionKey()))
|
||||
)
|
||||
.executes(ctx -> execute(ctx.getSource(), "*", ctx.getSource().getWorld().func_234923_W_()));
|
||||
.executes(ctx -> execute(ctx.getSource(), "*", ctx.getSource().getWorld().getDimensionKey()));
|
||||
}
|
||||
|
||||
private static int execute(CommandSource sender, String filter, RegistryKey<World> dim) throws CommandSyntaxException
|
||||
@@ -92,7 +92,7 @@ class CommandEntity
|
||||
Map<ResourceLocation, MutablePair<Integer, Map<ChunkPos, Integer>>> list = Maps.newHashMap();
|
||||
world.getEntities().forEach(e -> {
|
||||
MutablePair<Integer, Map<ChunkPos, Integer>> info = list.computeIfAbsent(e.getType().getRegistryName(), k -> MutablePair.of(0, Maps.newHashMap()));
|
||||
ChunkPos chunk = new ChunkPos(e.func_233580_cy_());
|
||||
ChunkPos chunk = new ChunkPos(e.getPosition());
|
||||
info.left++;
|
||||
info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1);
|
||||
});
|
||||
|
||||
@@ -58,15 +58,15 @@ class CommandTps
|
||||
|
||||
private static int sendTime(CommandSource cs, ServerWorld dim) throws CommandSyntaxException
|
||||
{
|
||||
long[] times = cs.getServer().getTickTime(dim.func_234923_W_());
|
||||
long[] times = cs.getServer().getTickTime(dim.getDimensionKey());
|
||||
|
||||
if (times == null) // Null means the world is unloaded. Not invalid. That's taken car of by DimensionArgument itself.
|
||||
times = UNLOADED;
|
||||
|
||||
final Registry<DimensionType> reg = cs.func_241861_q().func_243612_b(Registry.field_239698_ad_);
|
||||
final Registry<DimensionType> reg = cs.func_241861_q().getRegistry(Registry.DIMENSION_TYPE_KEY);
|
||||
double worldTickTime = mean(times) * 1.0E-6D;
|
||||
double worldTPS = Math.min(1000.0 / worldTickTime, 20);
|
||||
cs.sendFeedback(new TranslationTextComponent("commands.forge.tps.summary.named", dim.func_234923_W_().func_240901_a_().toString(), reg.getKey(dim.func_230315_m_()), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), false);
|
||||
cs.sendFeedback(new TranslationTextComponent("commands.forge.tps.summary.named", dim.getDimensionKey().getLocation().toString(), reg.getKey(dim.getDimensionType()), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), false);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -153,11 +153,11 @@ class CommandTrack
|
||||
if (entity == null)
|
||||
return new TranslationTextComponent("commands.forge.tracking.invalid");
|
||||
|
||||
BlockPos pos = entity.func_233580_cy_();
|
||||
BlockPos pos = entity.getPosition();
|
||||
double averageTimings = data.getAverageTimings();
|
||||
String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "\u03bcs" : "ms");
|
||||
|
||||
return new TranslationTextComponent("commands.forge.tracking.timing_entry", entity.getType().getRegistryName(), entity.world.func_234923_W_().func_240901_a_().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
return new TranslationTextComponent("commands.forge.tracking.timing_entry", entity.getType().getRegistryName(), entity.world.getDimensionKey().getLocation().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ class CommandTrack
|
||||
|
||||
double averageTimings = data.getAverageTimings();
|
||||
String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "\u03bcs" : "ms");
|
||||
return new TranslationTextComponent("commands.forge.tracking.timing_entry", te.getType().getRegistryName(), te.getWorld().func_234923_W_().func_240901_a_().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
return new TranslationTextComponent("commands.forge.tracking.timing_entry", te.getType().getRegistryName(), te.getWorld().getDimensionKey().getLocation().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ public class ConfigCommand {
|
||||
File f = new File(configFileName);
|
||||
context.getSource().sendFeedback(new TranslationTextComponent("commands.config.getwithtype",
|
||||
modId, type,
|
||||
new StringTextComponent(f.getName()).func_240701_a_(TextFormatting.UNDERLINE).
|
||||
func_240700_a_((style) -> style.func_240715_a_(new ClickEvent(ClickEvent.Action.OPEN_FILE, f.getAbsolutePath())))
|
||||
new StringTextComponent(f.getName()).mergeStyle(TextFormatting.UNDERLINE).
|
||||
modifyStyle((style) -> style.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, f.getAbsolutePath())))
|
||||
), true);
|
||||
} else {
|
||||
context.getSource().sendFeedback(new TranslationTextComponent("commands.config.noconfig", modId, type),
|
||||
|
||||
Reference in new issue
Block a user