Skip to content

Commit

Permalink
Fix a couple incomplete recieveCustomData calls (GregTechCEu#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers authored Dec 29, 2023
1 parent 8a2ca32 commit 3ff51be
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
package gregtech.common.metatileentities.multi.electric;

import gregtech.api.GTValues;
import gregtech.api.capability.*;
import gregtech.api.capability.GregtechDataCodes;
import gregtech.api.capability.GregtechTileCapabilities;
import gregtech.api.capability.IEnergyContainer;
import gregtech.api.capability.IMufflerHatch;
import gregtech.api.capability.IWorkable;
import gregtech.api.capability.impl.CleanroomLogic;
import gregtech.api.capability.impl.EnergyContainerList;
import gregtech.api.metatileentity.IDataInfoProvider;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.SimpleGeneratorMetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.*;
import gregtech.api.pattern.*;
import gregtech.api.metatileentity.multiblock.CleanroomType;
import gregtech.api.metatileentity.multiblock.FuelMultiblockController;
import gregtech.api.metatileentity.multiblock.ICleanroomProvider;
import gregtech.api.metatileentity.multiblock.ICleanroomReceiver;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import gregtech.api.metatileentity.multiblock.MultiblockDisplayText;
import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.pattern.MultiblockShapeInfo;
import gregtech.api.pattern.PatternMatchContext;
import gregtech.api.pattern.PatternStringError;
import gregtech.api.pattern.TraceabilityPredicate;
import gregtech.api.util.BlockInfo;
import gregtech.api.util.GTUtility;
import gregtech.api.util.TextComponentUtil;
Expand Down Expand Up @@ -61,7 +77,13 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;

public class MetaTileEntityCleanroom extends MultiblockWithDisplayBase
implements ICleanroomProvider, IWorkable, IDataInfoProvider {
Expand Down Expand Up @@ -643,6 +665,8 @@ public void receiveCustomData(int dataId, PacketBuffer buf) {
if (dataId == GregtechDataCodes.UPDATE_STRUCTURE_SIZE) {
this.lDist = buf.readInt();
this.rDist = buf.readInt();
this.bDist = buf.readInt();
this.fDist = buf.readInt();
this.hDist = buf.readInt();
} else if (dataId == GregtechDataCodes.WORKABLE_ACTIVE) {
this.cleanroomLogic.setActive(buf.readBoolean());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ public void receiveInitialSyncData(PacketBuffer buf) {
this.workingEnabled = buf.readBoolean();
}

@Override
public void receiveCustomData(int dataId, PacketBuffer buf) {
super.receiveCustomData(dataId, buf);
if (dataId == GregtechDataCodes.WORKING_ENABLED) {
this.workingEnabled = buf.readBoolean();
}
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);
Expand Down

0 comments on commit 3ff51be

Please sign in to comment.