mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
* Fix #3237 by correctly utilising the keepLooking argument. * Explain within SimpleNetworkWrapper's javadoc that the execute of the handler isn't on the main Minecraft thread.
This commit is contained in:
1 parent
dc871ea273
commit
5802a3b0b6
2 files changed
+6
-1
No files matched your search
+5
@@ -26,6 +26,7 @@ import java.util.EnumMap;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
import net.minecraft.util.IThreadListener;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import io.netty.channel.ChannelHandler;
|
||||
@@ -104,6 +105,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
* </pre>
|
||||
* </code>
|
||||
*
|
||||
* Note: As of Minecraft 1.8 packets are by default handled on the network thread.
|
||||
* That means that your {@link IMessageHandler} can not interact with most game objects directly.
|
||||
* Minecraft provides a convenient way to make your code execute on the main thread instead using {@link IThreadListener#addScheduledTask(Runnable)}.
|
||||
* The way to obtain an {@link IThreadListener} is using either the {@link net.minecraft.client.Minecraft} instance (client side) or a {@link net.minecraft.world.WorldServer} instance (server side).
|
||||
*
|
||||
* @author cpw
|
||||
*
|
||||
|
||||
@@ -332,7 +332,7 @@ public class EntityRegistry
|
||||
return er;
|
||||
}
|
||||
localClazz = localClazz.getSuperclass();
|
||||
keepLooking = (!Object.class.equals(localClazz));
|
||||
keepLooking &= (!Object.class.equals(localClazz));
|
||||
}
|
||||
while (keepLooking);
|
||||
|
||||
|
||||
Reference in new issue
Block a user