code stringlengths 31 2.05k | label_name stringclasses 5
values | label int64 0 4 |
|---|---|---|
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(satID);
super.writeData(output);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
satID = input.readInt();
super.readData(input);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
side = input.readForgeDirection();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeForgeDirection(side);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeForgeDirection(side);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
side = input.readForgeDirection();
} | Base | 1 |
public boolean getTurtleConnect() {
if (container instanceof LogisticsTileGenericPipe) {
return container.getTurtleConnect();
}
return false;
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
isOpaqueClientSide = input.readBoolean();
} | Base | 1 |
public void setTurtleConnect(Boolean flag) {
if (container instanceof LogisticsTileGenericPipe) {
container.setTurtleConnect(flag);
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeBoolean(isOpaque());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
pipeId = input.readInt();
} | Base | 1 |
public void setTurtleConnect(boolean flag) {
SimpleServiceLocator.ccProxy.setTurtleConnect(flag, this);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(pipeId);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
if (orientation == null) {
output.writeBoolean(false);
} else {
output.writeBoolean(true);
output.writeEnum(orientation);
}
} | Base | 1 |
public void setOnPipe(CoreMultiBlockPipe pipe) {
((HSTubeCurve) pipe).orientation = this;
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
if (input.readBoolean()) {
orientation = input.readEnum(CurveOrientation.class);
}
} | Base | 1 |
public void rotatePositions(IPositionRotateble set) {
renderOrientation.rotatePositions(set);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
if (orientation == null) {
output.writeBoolean(false);
} else {
output.writeBoolean(true);
output.writeEnum(orientation);
}
} | Base | 1 |
TubeGainRenderOrientation(ForgeDirection dir) {
this.dir = dir;
} | Base | 1 |
public void rotatePositions(IPositionRotateble set) {
renderOrientation.rotateOrientation(set);
} | Base | 1 |
public void setOnPipe(CoreMultiBlockPipe pipe) {
((HSTubeGain) pipe).orientation = this;
} | Base | 1 |
public void rotateOrientation(IPositionRotateble set) {
if (this == EAST) {
set.rotateRight();
} else if (this == WEST) {
set.rotateLeft();
} else if (this == SOUTH) {
set.rotateLeft();
set.rotateLeft();
}
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
if (input.readBoolean()) {
orientation = input.readEnum(TubeGainOrientation.class);
}
} | Base | 1 |
TubeGainOrientation(TubeGainRenderOrientation render, DoubleCoordinates off, ForgeDirection dir) {
renderOrientation = render;
offset = off;
this.dir = dir;
} | Base | 1 |
public void rotatePositions(IPositionRotateble set) {
renderOrientation.rotateOrientation(set);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
if (orientation == null) {
output.writeBoolean(false);
} else {
output.writeBoolean(true);
output.writeEnum(orientation);
}
} | Base | 1 |
public void setOnPipe(CoreMultiBlockPipe pipe) {
((HSTubeLine) pipe).orientation = this;
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
if (input.readBoolean()) {
orientation = input.readEnum(TubeLineOrientation.class);
}
} | Base | 1 |
TubeLineRenderOrientation(ForgeDirection dir) {
this.dir = dir;
} | Base | 1 |
TubeLineOrientation(TubeLineRenderOrientation render, DoubleCoordinates off, ForgeDirection dir) {
renderOrientation = render;
offset = off;
this.dir = dir;
} | Base | 1 |
public void rotateOrientation(IPositionRotateble set) {
if (this == EAST_WEST) {
set.rotateLeft();
}
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
if (input.readBoolean()) {
orientation = input.readEnum(CurveSOrientation.class);
}
} | Base | 1 |
public void rotatePositions(IPositionRotateble set) {
renderOrientation.rotatePositions(set);
} | Base | 1 |
public void setOnPipe(CoreMultiBlockPipe pipe) {
((HSTubeSCurve) pipe).orientation = this;
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
if (orientation == null) {
output.writeBoolean(false);
} else {
output.writeBoolean(true);
output.writeEnum(orientation);
}
} | Base | 1 |
public void rotatePositions(IPositionRotateble set) {
if (this == SOUTH) {
set.rotateLeft();
set.rotateLeft();
} else if (this == EAST) {
set.rotateRight();
} else if (this == WEST) {
set.rotateLeft();
}
} | Base | 1 |
public ITubeRenderOrientation getRenderOrientation() {
return this;
} | Base | 1 |
public DoubleCoordinates getOffset() {
return new DoubleCoordinates(0, 0, 0);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
orientation = input.readEnum(SpeedupDirection.class);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeEnum(orientation);
} | Base | 1 |
public void setOnPipe(CoreMultiBlockPipe pipe) {
((HSTubeSpeedup) pipe).orientation = this;
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {} | Base | 1 |
public void readData_LP(LPDataInput input) throws IOException {
if (input.readBoolean()) {
ByteBuf buf = input.readByteBuf();
readData(buf);
}
} | Base | 1 |
public void writeData_LP(LPDataOutput output) throws IOException {
output.writeBoolean(true);
ByteBuf buf = Unpooled.buffer(128);
writeData(buf);
output.writeByteBuf(buf);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
ByteBuf buf = Unpooled.buffer(128);
this.writeData(buf);
output.writeByteBuf(buf);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
ByteBuf buf = input.readByteBuf();
this.readData(buf);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeByte(mask);
output.writeByte(isBCPipeMask);
output.writeByte(isTDPipeMask);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
byte newMask = input.readByte();
if (newMask != mask) {
mask = newMask;
dirty = true;
}
newMask = input.readByte();
if (newMask != isBCPipeMask) {
isBCPipeMask = newMask;
dirty = true;
}
newMask = input.readByte();
if (newMask ... | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
pipeConnectionMatrix.writeData(output);
textureMatrix.writeData(output);
bcRenderState.writeData_LP(output); //Always needs to be last. Different length depending on proxy loading state.
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
pipeConnectionMatrix.readData(input);
textureMatrix.readData(input);
bcRenderState.readData_LP(input); //Always needs to be last. Different length depending on proxy loading state.
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
for (int i = 0; i < iconIndexes.length; i++) {
int icon = input.readByte();
if (iconIndexes[i] != icon) {
iconIndexes[i] = icon;
dirty = true;
}
}
textureIndex = input.readInt();
isRouted = input.readBoolean();
isRoutedInDir = inpu... | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
for (int iconIndexe : iconIndexes) {
output.writeByte(iconIndexe);
}
output.writeInt(textureIndex);
output.writeBoolean(isRouted);
output.writeBooleanArray(isRoutedInDir);
output.writeBooleanArray(isSubPowerInDir);
output.writeBoolean(has... | Base | 1 |
public void setCCType(Object type) {
ccObject = type;
} | Base | 1 |
public DictResource(LPDataInput input) throws IOException {
stack = input.readItemIdentifierStack();
requester = null;
BitSet bits = input.readBitSet();
use_od = bits.get(0);
ignore_dmg = bits.get(1);
ignore_nbt = bits.get(2);
use_category = bits.get(3);
} | Base | 1 |
public Object getCCType() {
return ccObject;
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeItemIdentifierStack(stack);
BitSet bits = new BitSet();
bits.set(0, use_od);
bits.set(1, ignore_dmg);
bits.set(2, ignore_nbt);
bits.set(3, use_category);
output.writeBitSet(bits);
} | Base | 1 |
public Object getCCType() {
return ccObject;
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeItemIdentifier(liquid.getItemIdentifier());
output.writeInt(amount);
} | Base | 1 |
public FluidResource(LPDataInput input) throws IOException {
liquid = FluidIdentifier.get(input.readItemIdentifier());
amount = input.readInt();
target = null;
} | Base | 1 |
public void setCCType(Object type) {
ccObject = type;
} | Base | 1 |
public ItemResource(LPDataInput input) throws IOException {
stack = input.readItemIdentifierStack();
requester = null;
} | Base | 1 |
public void setCCType(Object type) {
ccObject = type;
} | Base | 1 |
public Object getCCType() {
return ccObject;
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeItemIdentifierStack(stack);
} | Base | 1 |
public static IResource readResource(LPDataInput input) throws IOException {
int id = input.readInt();
if (id == -1) {
return null;
}
return ResourceNetwork.values()[id].readData(input);
} | Base | 1 |
ItemResource(ItemResource.class) {
@Override
protected IResource readData(LPDataInput input) throws IOException {
return new ItemResource(input);
}
}, | Base | 1 |
public static void writeResource(LPDataOutput output, IResource resource) throws IOException {
if (resource == null) {
output.writeInt(-1);
return;
}
ResourceNetwork[] values = ResourceNetwork.values();
for (ResourceNetwork value : values) {
if (value.clazz.isAssignableFrom(resource.getClass())) {
... | Base | 1 |
FluidResource(FluidResource.class) {
@Override
protected IResource readData(LPDataInput input) throws IOException {
return new FluidResource(input);
}
}; | Base | 1 |
DictResource(DictResource.class) {
@Override
protected IResource readData(LPDataInput input) throws IOException {
return new DictResource(input);
}
}, | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
output.writeByte(dir.ordinal());
output.writeBoolean(finalPipe);
output.writeBoolean(startPipe);
output.writeInt(length);
for (PipeRoutingConnectionType type : PipeRoutin... | Base | 1 |
public LaserData readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
dir = ForgeDirection.values()[input.readByte()];
finalPipe = input.readBoolean();
startPipe = input.readBoolean();
length = input.readInt();
connectionType = EnumSet... | Base | 1 |
private static byte[] compress(byte[] content) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
GZIPOutputStream gzipOutputStream = new GZIPOutputStream(byteArrayOutputStream);
gzipOutputStream.write(content);
gzipOutputStream.close();
} catch (IOException e) {
throw... | Base | 1 |
public void setPause(boolean flag) {
clientCompressorThread.setPause(flag);
} | Base | 1 |
public void clear() {
clientCompressorThread.clear();
clientDecompressorThread.clear();
} | Base | 1 |
private void handlePacketData(final Pair<EntityPlayer, byte[]> playerDataPair) {
try {
LPDataIOWrapper.provideData(playerDataPair.getValue2(), input -> {
PacketHandler.onPacketData(input, playerDataPair.getValue1());
});
} catch (IOException e) {
System.err.println("IO Error in handlePacketData... | Base | 1 |
private static byte[] decompress(byte[] contentBytes) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
GZIPInputStream gzip = new GZIPInputStream(new ByteArrayInputStream(contentBytes));
int buffer = 0;
while ((buffer = gzip.read()) != -1) {
out.write(buffer);
}
} catch (IOExcepti... | Base | 1 |
public void run() {
while (true) {
boolean flag;
do {
flag = false;
byte[] buffer = null;
synchronized (queue) {
if (queue.size() > 0) {
flag = true;
buffer = queue.getFirst();
queue.removeFirst();
}
}
if (flag && buffer != null) {
byte[] pack... | Base | 1 |
public ClientPacketBufferHandlerThread() {} | Base | 1 |
public void clientTick(ClientTickEvent event) {
if (event.phase != Phase.END) {
return;
}
clientDecompressorThread.clientTickEnd();
} | Base | 1 |
public void run() {
while (true) {
try {
synchronized (clientList) {
if (!pause && clientList.size() > 0) {
clientBuffer = LPDataIOWrapper.collectData(output -> {
output.writeBytes(clientBuffer);
clearLock.lock();
try {
for (ModernPacket packet : clientList) {... | Base | 1 |
public void addPacketToCompressor(ModernPacket packet) {
clientCompressorThread.addPacketToCompressor(packet);
} | Base | 1 |
public void handlePacket(byte[] content) {
clientDecompressorThread.handlePacket(content);
} | Base | 1 |
public void queueFailedPacket(ModernPacket packet, EntityPlayer player) {
clientDecompressorThread.queueFailedPacket(packet, player);
} | Base | 1 |
private void handlePacketData(final Pair<EntityPlayer, byte[]> playerDataPair) {
try {
LPDataIOWrapper.provideData(playerDataPair.getValue2(), input -> {
PacketHandler.onPacketData(input, playerDataPair.getValue1());
});
} catch (IOException e) {
System.err.println("IO Error in handlePacketData... | Base | 1 |
public void handlePacket(byte[] content, EntityPlayer player) {
serverDecompressorThread.handlePacket(content, player);
} | Base | 1 |
private static byte[] decompress(byte[] contentBytes) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
GZIPInputStream gzip = new GZIPInputStream(new ByteArrayInputStream(contentBytes));
int buffer = 0;
while ((buffer = gzip.read()) != -1) {
out.write(buffer);
}
} catch (IOExcepti... | Base | 1 |
public void clear(final EntityPlayer player) {
new Thread() {
@Override
public void run() {
serverCompressorThread.clear(player);
serverDecompressorThread.clear(player);
}
}.start();
} | Base | 1 |
private static byte[] compress(byte[] content) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
GZIPOutputStream gzipOutputStream = new GZIPOutputStream(byteArrayOutputStream);
gzipOutputStream.write(content);
gzipOutputStream.close();
} catch (IOException e) {
throw... | Base | 1 |
public void serverTick(ServerTickEvent event) {
if (event.phase != Phase.END) {
return;
}
serverDecompressorThread.serverTickEnd();
} | Base | 1 |
public void addPacketToCompressor(ModernPacket packet, EntityPlayer player) {
serverCompressorThread.addPacketToCompressor(packet, player);
} | Base | 1 |
public void setPause(boolean flag) {
serverCompressorThread.setPause(flag);
} | Base | 1 |
public ServerPacketBufferHandlerThread() {} | Base | 1 |
public ExitRoute readExitRoute(World world) throws IOException {
IRouter destination = readIRouter(world);
IRouter root = readIRouter(world);
ForgeDirection exitOri = readForgeDirection();
ForgeDirection insertOri = readForgeDirection();
EnumSet<PipeRoutingConnectionType> connectionDetails = readEnumSet(Pipe... | Base | 1 |
public void writeExitRoute(ExitRoute route) throws IOException {
writeIRouter(route.destination);
writeIRouter(route.root);
writeForgeDirection(route.exitOrientation);
writeForgeDirection(route.insertOrientation);
writeEnumSet(route.connectionDetails, PipeRoutingConnectionType.class);
writeDouble(route.dis... | Base | 1 |
public String readUTF() throws IOException {
byte[] arr = readByteArray();
if (arr == null) {
return null;
} else {
return new String(arr, UTF_8);
}
} | Base | 1 |
public <T> LinkedList<T> readLinkedList(IReadListObject<T> reader) throws IOException {
int size = readInt();
if (size == -1) {
return null;
}
LinkedList<T> list = new LinkedList<>();
for (int i = 0; i < size; i++) {
list.add(reader.readObject(this));
}
return list;
} | Base | 1 |
public <T> ArrayList<T> readArrayList(IReadListObject<T> reader) throws IOException {
int size = readInt();
if (size == -1) {
return null;
}
ArrayList<T> list = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
list.add(reader.readObject(this));
}
return list;
} | Base | 1 |
public IOrderInfoProvider readOrderInfo() throws IOException {
ItemIdentifierStack stack = readItemIdentifierStack();
int routerId = localBuffer.readInt();
boolean isFinished = localBuffer.readBoolean();
boolean inProgress = localBuffer.readBoolean();
IOrderInfoProvider.ResourceType type = readEnum(IOrderInf... | Base | 1 |
public static void writeData(ByteBuf dataBuffer, LPDataOutputConsumer dataOutputConsumer) throws IOException {
LPDataIOWrapper lpData = getInstance(dataBuffer);
dataOutputConsumer.accept(lpData);
lpData.unsetBuffer();
} | Base | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.