<commit_before>--- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java
+++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java
@@ -59,6 +59,9 @@
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
+import jk_5.nailed.server.NailedEventFactory;
+import jk_5.nailed.server.world.DelegatingWorldProvider;
+
 public abstract class ServerConfigurationManager {
     public static final File field_152613_a = new File("banned-players.json");
     public static final File field_152614_b = new File("banned-ips.json");
@@ -114,7 +117,8 @@
         ChunkCoordinates chunkcoordinates = worldserver.func_72861_E();
         this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver);
         NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_);
-        nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldserver.func_72912_H().func_76093_s(), worldserver.field_73011_w.field_76574_g, worldserver.field_73013_u, this.func_72352_l(), worldserver.func_72912_H().func_76067_t()));
+        int dimid = (worldserver.field_73011_w instanceof DelegatingWorldProvider) ? ((DelegatingWorldProvider) worldserver.field_73011_w).wrapped().getTypeId() : 0;
+        nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldserver.func_72912_H().func_76093_s(), dimid, worldserver.field_73013_u, this.func_72352_l(), worldserver.func_72912_H().func_76067_t()));
         nethandlerplayserver.func_147359_a(new S3FPacketCustomPayload("MC|Brand", this.func_72365_p().getServerModName().getBytes(Charsets.UTF_8)));
         nethandlerplayserver.func_147359_a(new S05PacketSpawnPosition(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c));
         nethandlerplayserver.func_147359_a(new S39PacketPlayerAbilities(p_72355_2_.field_71075_bZ));
@@ -123,16 +127,7 @@
         p_72355_2_.func_147099_x().func_150884_b(p_72355_2_);
         this.func_96456_a((ServerScoreboard)worldserver.func_96441_U(), p_72355_2_);
         this.field_72400_f.func_147132_au();
-        ChatComponentTranslation chatcomponenttranslation;
 
-        if (!p_72355_2_.func_70005_c_().equalsIgnoreCase(s)) {
-            chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined.renamed", new Object[] {p_72355_2_.func_145748_c_(), s});
-        } else {
-            chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined", new Object[] {p_72355_2_.func_145748_c_()});
-        }
-
-        chatcomponenttranslation.func_150256_b().func_150238_a(EnumChatFormatting.YELLOW);
-        this.func_148539_a(chatcomponenttranslation);
         this.func_72377_c(p_72355_2_);
         nethandlerplayserver.func_147364_a(p_72355_2_.field_70165_t, p_72355_2_.field_70163_u, p_72355_2_.field_70161_v, p_72355_2_.field_70177_z, p_72355_2_.field_70125_A);
         this.func_72354_b(p_72355_2_, worldserver);
@@ -160,6 +155,8 @@
                 entity.field_98038_p = false;
             }
         }
+
+        NailedEventFactory.firePlayerJoined(p_72355_2_);
     }
 
     protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) {<commit_msg>Don't crash players when respawning in custom worlds, and respect worlds' dimensions<commit_after>--- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java
+++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java
@@ -1,9 +1,5 @@
 package net.minecraft.server.management;
 
-import com.google.common.base.Charsets;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.mojang.authlib.GameProfile;
 import java.io.File;
 import java.net.SocketAddress;
 import java.text.SimpleDateFormat;
@@ -13,8 +9,17 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 import java.util.Map.Entry;
+import java.util.UUID;
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.mojang.authlib.GameProfile;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
 import net.minecraft.entity.Entity;
 import net.minecraft.entity.EntityList;
 import net.minecraft.entity.player.EntityPlayer;
@@ -46,9 +51,7 @@
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.stats.StatList;
 import net.minecraft.stats.StatisticsFile;
-import net.minecraft.util.ChatComponentTranslation;
 import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.util.EnumChatFormatting;
 import net.minecraft.util.IChatComponent;
 import net.minecraft.util.MathHelper;
 import net.minecraft.world.World;
@@ -56,9 +59,10 @@
 import net.minecraft.world.WorldSettings;
 import net.minecraft.world.demo.DemoWorldManager;
 import net.minecraft.world.storage.IPlayerFileData;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
+import jk_5.nailed.server.NailedEventFactory;
+import jk_5.nailed.server.world.DelegatingWorldProvider;
+
 public abstract class ServerConfigurationManager {
     public static final File field_152613_a = new File("banned-players.json");
     public static final File field_152614_b = new File("banned-ips.json");
@@ -114,7 +118,8 @@
         ChunkCoordinates chunkcoordinates = worldserver.func_72861_E();
         this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver);
         NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_);
-        nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldserver.func_72912_H().func_76093_s(), worldserver.field_73011_w.field_76574_g, worldserver.field_73013_u, this.func_72352_l(), worldserver.func_72912_H().func_76067_t()));
+        int dimid = (worldserver.field_73011_w instanceof DelegatingWorldProvider) ? ((DelegatingWorldProvider) worldserver.field_73011_w).wrapped().getTypeId() : 0;
+        nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldserver.func_72912_H().func_76093_s(), dimid, worldserver.field_73013_u, this.func_72352_l(), worldserver.func_72912_H().func_76067_t()));
         nethandlerplayserver.func_147359_a(new S3FPacketCustomPayload("MC|Brand", this.func_72365_p().getServerModName().getBytes(Charsets.UTF_8)));
         nethandlerplayserver.func_147359_a(new S05PacketSpawnPosition(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c));
         nethandlerplayserver.func_147359_a(new S39PacketPlayerAbilities(p_72355_2_.field_71075_bZ));
@@ -123,16 +128,7 @@
         p_72355_2_.func_147099_x().func_150884_b(p_72355_2_);
         this.func_96456_a((ServerScoreboard)worldserver.func_96441_U(), p_72355_2_);
         this.field_72400_f.func_147132_au();
-        ChatComponentTranslation chatcomponenttranslation;
 
-        if (!p_72355_2_.func_70005_c_().equalsIgnoreCase(s)) {
-            chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined.renamed", new Object[] {p_72355_2_.func_145748_c_(), s});
-        } else {
-            chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined", new Object[] {p_72355_2_.func_145748_c_()});
-        }
-
-        chatcomponenttranslation.func_150256_b().func_150238_a(EnumChatFormatting.YELLOW);
-        this.func_148539_a(chatcomponenttranslation);
         this.func_72377_c(p_72355_2_);
         nethandlerplayserver.func_147364_a(p_72355_2_.field_70165_t, p_72355_2_.field_70163_u, p_72355_2_.field_70161_v, p_72355_2_.field_70177_z, p_72355_2_.field_70125_A);
         this.func_72354_b(p_72355_2_, worldserver);
@@ -160,6 +156,8 @@
                 entity.field_98038_p = false;
             }
         }
+
+        NailedEventFactory.firePlayerJoined(p_72355_2_);
     }
 
     protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) {
@@ -366,7 +364,8 @@
             entityplayermp1.func_70107_b(entityplayermp1.field_70165_t, entityplayermp1.field_70163_u + 1.0D, entityplayermp1.field_70161_v);
         }
 
-        entityplayermp1.field_71135_a.func_147359_a(new S07PacketRespawn(entityplayermp1.field_71093_bK, entityplayermp1.field_70170_p.field_73013_u, entityplayermp1.field_70170_p.func_72912_H().func_76067_t(), entityplayermp1.field_71134_c.func_73081_b()));
+        int dimid = (worldserver.field_73011_w instanceof DelegatingWorldProvider) ? ((DelegatingWorldProvider) worldserver.field_73011_w).wrapped().getTypeId() : 0;
+        entityplayermp1.field_71135_a.func_147359_a(new S07PacketRespawn(dimid, entityplayermp1.field_70170_p.field_73013_u, entityplayermp1.field_70170_p.func_72912_H().func_76067_t(), entityplayermp1.field_71134_c.func_73081_b()));
         chunkcoordinates1 = worldserver.func_72861_E();
         entityplayermp1.field_71135_a.func_147364_a(entityplayermp1.field_70165_t, entityplayermp1.field_70163_u, entityplayermp1.field_70161_v, entityplayermp1.field_70177_z, entityplayermp1.field_70125_A);
         entityplayermp1.field_71135_a.func_147359_a(new S05PacketSpawnPosition(chunkcoordinates1.field_71574_a, chunkcoordinates1.field_71572_b, chunkcoordinates1.field_71573_c));
{'fraction_non_alphanumeric': 0.11115719618415595, 'fraction_numerical': 0.1306511820821236, 'mean_word_length': 5.3495720868992755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2895662', 'n_tokens_mistral': 4148, 'n_tokens_neox': 3527, 'n_words': 368}