mappings
This commit is contained in:
1 parent
42ba5a9f03
commit
cf817c2e39
25 files changed
+91
-92
No files matched your search
@@ -175,7 +175,7 @@ public class BlockInfo
|
||||
Material material = state.getMaterial();
|
||||
Block block = state.getBlock();
|
||||
String metastring = "";
|
||||
for (net.minecraft.state.property.Property<?> iproperty : state.method_28501())// getProperties())
|
||||
for (net.minecraft.state.property.Property<?> iproperty : state.getProperties())
|
||||
{
|
||||
metastring += ", "+iproperty.getName() + '='+state.get(iproperty);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class CarpetProfiler
|
||||
private static String getSectionString(World world, String section)
|
||||
{
|
||||
return String.format("%s.%s%s",
|
||||
world.method_27983().method_29177().toString().replaceFirst("minecraft:", ""),
|
||||
world.method_27983().getValue().toString().replaceFirst("minecraft:", ""),
|
||||
section, // ^ getDImension getId
|
||||
world.isClient ? " (Client)" : "");
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class CarpetProfiler
|
||||
private static String getEntityString(World world, Entity e)
|
||||
{
|
||||
return String.format("%s.%s%s",
|
||||
world.method_27983().method_29177().toString().replaceFirst("minecraft:", ""),
|
||||
world.method_27983().getValue().toString().replaceFirst("minecraft:", ""),
|
||||
Registry.ENTITY_TYPE.getId(e.getType()).toString().replaceFirst("minecraft:", ""),
|
||||
world.isClient ? " (Client)" : "");
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class CarpetProfiler
|
||||
private static String getTEntityString(World world, BlockEntity be)
|
||||
{
|
||||
return String.format("%s.%s%s",
|
||||
world.method_27983().method_29177().toString().replaceFirst("minecraft:", ""),
|
||||
world.method_27983().getValue().toString().replaceFirst("minecraft:", ""),
|
||||
Registry.BLOCK_ENTITY_TYPE.getId(be.getType()).toString().replaceFirst("minecraft:", ""),
|
||||
world.isClient ? " (Client)" : "");
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import carpet.helpers.TickSpeed;
|
||||
import carpet.logging.LoggerRegistry;
|
||||
import carpet.logging.logHelpers.PacketCounter;
|
||||
import carpet.mixins.PlayerListHeaderS2CPacketMixin;
|
||||
import net.minecraft.class_5321;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerListHeaderS2CPacket;
|
||||
@@ -13,6 +12,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.text.BaseText;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -59,17 +59,17 @@ public class HUDController
|
||||
|
||||
if (LoggerRegistry.__mobcaps)
|
||||
LoggerRegistry.getLogger("mobcaps").log((option, player) -> {
|
||||
class_5321<DimensionType> dim = player.world.method_27983(); //getDimType
|
||||
RegistryKey<DimensionType> dim = player.world.method_27983(); //getDimType
|
||||
switch (option)
|
||||
{
|
||||
case "overworld":
|
||||
dim = DimensionType.field_24753; // OW
|
||||
dim = DimensionType.OVERWORLD_REGISTRY_KEY;
|
||||
break;
|
||||
case "nether":
|
||||
dim = DimensionType.field_24754; // nrther
|
||||
dim = DimensionType.THE_NETHER_REGISTRY_KEY;
|
||||
break;
|
||||
case "end":
|
||||
dim = DimensionType.field_24755; // end
|
||||
dim = DimensionType.THE_END_REGISTRY_KEY;
|
||||
break;
|
||||
}
|
||||
return new BaseText[]{SpawnReporter.printMobcapsForDimension(server.getWorld(dim), false).get(0)};
|
||||
|
||||
@@ -252,7 +252,7 @@ public class Messenger
|
||||
//message source
|
||||
public static void m(ServerCommandSource source, Object ... fields)
|
||||
{
|
||||
source.sendFeedback(Messenger.c(fields),source.getMinecraftServer().getWorld(DimensionType.field_24753) != null); //OW
|
||||
source.sendFeedback(Messenger.c(fields),source.getMinecraftServer().getWorld(DimensionType.OVERWORLD_REGISTRY_KEY) != null); //OW
|
||||
}
|
||||
public static void m(PlayerEntity player, Object ... fields)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ import carpet.mixins.WeightedPickerEntryMixin;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||
import net.minecraft.class_5321;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.entity.EntityType;
|
||||
@@ -19,6 +18,7 @@ import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.SpawnHelper;
|
||||
import net.minecraft.world.World;
|
||||
@@ -39,19 +39,19 @@ public class SpawnReporter
|
||||
public static boolean mock_spawns = false;
|
||||
|
||||
public static Long track_spawns = 0L;
|
||||
public static final HashMap<class_5321<DimensionType>, Integer> chunkCounts = new HashMap<>();
|
||||
public static final HashMap<RegistryKey<DimensionType>, Integer> chunkCounts = new HashMap<>();
|
||||
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Object2LongMap<EntityType>> spawn_stats = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Object2LongMap<EntityType>> spawn_stats = new HashMap<>();
|
||||
public static double mobcap_exponent = 0.0D;
|
||||
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> spawn_attempts = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> overall_spawn_ticks = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> spawn_ticks_full = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> spawn_ticks_fail = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> spawn_ticks_succ = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> spawn_ticks_spawns = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, Long> spawn_cap_count = new HashMap<>();
|
||||
public static final HashMap<Pair<class_5321<DimensionType>, SpawnGroup>, EvictingQueue<Pair<EntityType, BlockPos>>> spawned_mobs = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> spawn_attempts = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> overall_spawn_ticks = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> spawn_ticks_full = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> spawn_ticks_fail = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> spawn_ticks_succ = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> spawn_ticks_spawns = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, Long> spawn_cap_count = new HashMap<>();
|
||||
public static final HashMap<Pair<RegistryKey<DimensionType>, SpawnGroup>, EvictingQueue<Pair<EntityType, BlockPos>>> spawned_mobs = new HashMap<>();
|
||||
public static final HashMap<SpawnGroup, Integer> spawn_tries = new HashMap<>();
|
||||
public static BlockPos lower_spawning_limit = null;
|
||||
public static BlockPos upper_spawning_limit = null;
|
||||
@@ -75,7 +75,7 @@ public class SpawnReporter
|
||||
return;
|
||||
}
|
||||
}
|
||||
Pair<class_5321<DimensionType>, SpawnGroup> key = Pair.of(mob.world.method_27983(), cat);
|
||||
Pair<RegistryKey<DimensionType>, SpawnGroup> key = Pair.of(mob.world.method_27983(), cat);
|
||||
long count = spawn_stats.get(key).getOrDefault(mob.getType(), 0L);
|
||||
spawn_stats.get(key).put(mob.getType(), count + 1);
|
||||
spawned_mobs.get(key).put(Pair.of(mob.getType(), pos));
|
||||
@@ -85,7 +85,7 @@ public class SpawnReporter
|
||||
|
||||
public static List<BaseText> printMobcapsForDimension(ServerWorld world, boolean multiline)
|
||||
{
|
||||
class_5321<DimensionType> dim = world.method_27983();
|
||||
RegistryKey<DimensionType> dim = world.method_27983();
|
||||
String name = dim.toString();
|
||||
List<BaseText> lst = new ArrayList<>();
|
||||
if (multiline)
|
||||
@@ -305,9 +305,9 @@ public class SpawnReporter
|
||||
{
|
||||
spawn_tries.put(enumcreaturetype, 1);
|
||||
}
|
||||
for (class_5321<DimensionType> dim : Arrays.asList(DimensionType.field_24753, DimensionType.field_24754, DimensionType.field_24755))
|
||||
for (RegistryKey<DimensionType> dim : Arrays.asList(DimensionType.OVERWORLD_REGISTRY_KEY, DimensionType.THE_NETHER_REGISTRY_KEY, DimensionType.THE_END_REGISTRY_KEY))
|
||||
{
|
||||
Pair<class_5321<DimensionType>, SpawnGroup> key = Pair.of(dim, enumcreaturetype);
|
||||
Pair<RegistryKey<DimensionType>, SpawnGroup> key = Pair.of(dim, enumcreaturetype);
|
||||
overall_spawn_ticks.put(key, 0L);
|
||||
spawn_attempts.put(key, 0L);
|
||||
spawn_ticks_full.put(key, 0L);
|
||||
@@ -345,15 +345,15 @@ public class SpawnReporter
|
||||
{
|
||||
//String type_code = String.format("%s", enumcreaturetype);
|
||||
boolean there_are_mobs_to_list = false;
|
||||
for (class_5321<DimensionType> dim: Arrays.asList(DimensionType.field_24753, DimensionType.field_24754, DimensionType.field_24755)) //String world_code: new String[] {"", " (N)", " (E)"})
|
||||
for (RegistryKey<DimensionType> dim: Arrays.asList(DimensionType.OVERWORLD_REGISTRY_KEY, DimensionType.THE_NETHER_REGISTRY_KEY, DimensionType.THE_END_REGISTRY_KEY)) //String world_code: new String[] {"", " (N)", " (E)"})
|
||||
{
|
||||
Pair<class_5321<DimensionType>, SpawnGroup> code = Pair.of(dim, enumcreaturetype);
|
||||
Pair<RegistryKey<DimensionType>, SpawnGroup> code = Pair.of(dim, enumcreaturetype);
|
||||
if (spawn_ticks_spawns.get(code) > 0L)
|
||||
{
|
||||
there_are_mobs_to_list = true;
|
||||
double hours = overall_spawn_ticks.get(code)/72000.0;
|
||||
report.add(Messenger.s(String.format(" > %s (%.1f min), %.1f m/t, {%.1f%%F / %.1f%%- / %.1f%%+}; %.2f s/att",
|
||||
code.getRight()+((code.getLeft()==DimensionType.field_24753)?"":( (code.getLeft()==DimensionType.field_24754)?"(N)":"(E)" )), // OW, nether
|
||||
code.getRight()+((code.getLeft()==DimensionType.OVERWORLD_REGISTRY_KEY)?"":( (code.getLeft()==DimensionType.THE_NETHER_REGISTRY_KEY)?"(N)":"(E)" )), // OW, nether
|
||||
60*hours,
|
||||
(1.0D*spawn_cap_count.get(code))/ spawn_attempts.get(code),
|
||||
(100.0D*spawn_ticks_full.get(code))/ spawn_attempts.get(code),
|
||||
|
||||
Reference in new issue
Block a user