Skip to content

Commit 954ed7a

Browse files
committed
update docs
1 parent 0ec33f0 commit 954ed7a

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/main/java/gregtech/client/utils/ClientHandlerHooks.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import gregtech.api.metatileentity.MetaTileEntity;
55
import gregtech.api.metatileentity.registry.MTERegistry;
66

7-
import net.minecraft.client.network.NetHandlerPlayClient;
87
import net.minecraft.nbt.NBTTagCompound;
9-
import net.minecraft.network.PacketBuffer;
10-
import net.minecraft.network.play.server.SPacketChunkData;
118
import net.minecraft.util.ResourceLocation;
129
import net.minecraft.util.math.BlockPos;
1310
import net.minecraft.world.World;
@@ -20,20 +17,22 @@
2017
public class ClientHandlerHooks {
2118

2219
/**
23-
* Initializes any MetaTileEntities right before {@link Chunk#read(PacketBuffer, int, boolean) Chunk.read()} is
24-
* called in
25-
* {@link NetHandlerPlayClient#handleChunkData(SPacketChunkData) handleChunkData()}.
20+
* Creates a MetaTileEntity from each tag and sets them in the world
2621
*
27-
* @param packetIn Chunk Data Packet
22+
* @param world typically client world
23+
* @param tagCompounds list of TileEntity tag data
2824
*/
2925
public static void handleTags(World world, List<NBTTagCompound> tagCompounds) {
30-
tagCompounds.forEach(tagCompound -> handleTag(world, tagCompound));
26+
for (NBTTagCompound tagCompound : tagCompounds) {
27+
handleTag(world, tagCompound);
28+
}
3129
}
3230

3331
/**
34-
* Initializes the MetaTileEntity before it handles
32+
* Creates a MetaTileEntity from the tag and sets it in the world
3533
*
36-
* @param packetIn Tile Entity Update Packet
34+
* @param world typically client world
35+
* @param tagCompound TileEntity tag data
3736
*/
3837
public static void handleTag(World world, NBTTagCompound tagCompound) {
3938
MetaTileEntity mte = fromTag(tagCompound);
@@ -45,8 +44,7 @@ public static void handleTag(World world, NBTTagCompound tagCompound) {
4544
}
4645

4746
/**
48-
* Creates the correct MetaTileEntity from the given tag and sets the tile entity to the world
49-
* IF a TileEntity doesn't already exist at the position
47+
* Creates the correct MetaTileEntity from the given tag
5048
*
5149
* @param tag TileEntity tag data
5250
*/
@@ -60,6 +58,13 @@ private static MetaTileEntity fromTag(NBTTagCompound tag) {
6058
return null;
6159
}
6260

61+
/**
62+
* Sets a copy of the MetaTileEntity to the world IF a TileEntity doesn't already exist at the position
63+
*
64+
* @param world client world
65+
* @param mte MetaTileEntity to set in world
66+
* @param pos Position to place the MetaTileEntity
67+
*/
6368
private static void placeTile(World world, MetaTileEntity mte, BlockPos pos) {
6469
// set te in world directly
6570
// check if world contains a TE at this pos?

src/main/java/gregtech/mixins/minecraft/ClientHandlerMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public void initClientTiles(SPacketChunkData packetIn, CallbackInfo ci) {
3737
}
3838

3939
/**
40-
* Initializes the MetaTileEntity before it handles
40+
* Initializes the MetaTileEntity before {@link gregtech.api.metatileentity.SyncedTileEntityBase#handleUpdateTag
41+
* handleUpdateTag()} is called
4142
*
4243
* @param packetIn Tile Entity Update Packet
4344
*/

0 commit comments

Comments
 (0)