Changes

3 bytes added ,  13:04, 3 January 2021
m
changed name of EntityPlayerMP to ServerPlayerEntity
Line 45: Line 45:  
     ctx.get().enqueueWork(() -> {
 
     ctx.get().enqueueWork(() -> {
 
         // Work that needs to be threadsafe (most work)
 
         // Work that needs to be threadsafe (most work)
         EntityPlayerMP sender = ctx.get().getSender(); // the client that sent this packet
+
         ServerPlayerEntity sender = ctx.get().getSender(); // the client that sent this packet
 
         // do stuff
 
         // do stuff
 
     });
 
     });
Line 65: Line 65:  
<br>
 
<br>
 
To avoid this problem, a general rule of thumb is to only access blocks and tile entities if <code><nowiki>world.isBlockLoaded(pos)</nowiki></code> is true.}}
 
To avoid this problem, a general rule of thumb is to only access blocks and tile entities if <code><nowiki>world.isBlockLoaded(pos)</nowiki></code> is true.}}
      
== Sending Packets ==
 
== Sending Packets ==
2

edits