code stringlengths 31 2.05k | label_name stringclasses 5 values | label int64 0 4 |
|---|---|---|
public boolean matches(InetAddress socketAddress) {
return socketAddress.isAnyLocalAddress()
|| socketAddress.isLoopbackAddress()
|| socketAddress.isLinkLocalAddress()
|| socketAddress.isSiteLocalAddress();
} | Base | 1 |
public static Map processResponse(Response samlResponse, String target)
throws SAMLException {
List assertions = null;
SAMLServiceManager.SOAPEntry partnerdest = null;
Subject assertionSubject = null;
if (samlResponse.isSigned()) {
// verify the signature
boolean isSignedandValid = verifySignature(samlResponse);
if (!isSignedandValid) {
throw new SAMLException(bundle.getString("invalidResponse"));
}
}
// check Assertion and get back a Map of relevant data including,
// Subject, SOAPEntry for the partner and the List of Assertions.
Map ssMap = verifyAssertionAndGetSSMap(samlResponse);
if (debug.messageEnabled()) {
debug.message("processResponse: ssMap = " + ssMap);
}
if (ssMap == null) {
throw new SAMLException(bundle.getString("invalidAssertion"));
}
assertionSubject = (com.sun.identity.saml.assertion.Subject)
ssMap.get(SAMLConstants.SUBJECT);
if (assertionSubject == null) {
throw new SAMLException(bundle.getString("nullSubject"));
}
partnerdest = (SAMLServiceManager.SOAPEntry)ssMap
.get(SAMLConstants.SOURCE_SITE_SOAP_ENTRY);
if (partnerdest == null) {
throw new SAMLException(bundle.getString("failedAccountMapping"));
}
assertions = (List)ssMap.get(SAMLConstants.POST_ASSERTION);
Map sessMap = null;
try {
sessMap = getAttributeMap(partnerdest, assertions,
assertionSubject, target);
} catch (Exception se) {
debug.error("SAMLUtils.processResponse :" , se);
throw new SAMLException(
bundle.getString("failProcessResponse"));
}
return sessMap;
} | Class | 2 |
public void shutdown() {
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Non-Managed connection could not be closed. Whoops!", e);
}
}
} | Base | 1 |
private static String getDatabaseUrl(DatabaseConfiguration dbConfig) {
int port = dbConfig.getDatabasePort();
return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + "://" + dbConfig.getDatabaseHost()
+ ((port == 0) ? "" : (":" + port)) + "/" + dbConfig.getDatabaseName();
} | Base | 1 |
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection)
throws DatabaseServiceException {
try {
// logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection);
if (connection != null && !forceNewConnection) {
// logger.debug("connection closed::{}", connection.isClosed());
if (!connection.isClosed()) {
if (logger.isDebugEnabled()) {
logger.debug("Returning existing connection::{}", connection);
}
return connection;
}
}
Class.forName(type.getClassPath());
DriverManager.setLoginTimeout(10);
String dbURL = getDatabaseUrl(databaseConfiguration);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguration.getDatabasePassword());
if (logger.isDebugEnabled()) {
logger.debug("*** Acquired New connection for ::{} **** ", dbURL);
}
return connection;
} catch (ClassNotFoundException e) {
logger.error("Jdbc Driver not found", e);
throw new DatabaseServiceException(e.getMessage());
} catch (SQLException e) {
logger.error("SQLException::Couldn't get a Connection!", e);
throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage());
}
} | Base | 1 |
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection)
throws DatabaseServiceException {
try {
if (connection != null && !forceNewConnection) {
// logger.info("connection closed::{}", connection.isClosed());
if (!connection.isClosed()) {
if (logger.isDebugEnabled()) {
logger.debug("Returning existing connection::{}", connection);
}
return connection;
}
}
String dbURL = getDatabaseUrl(databaseConfiguration);
Class.forName(type.getClassPath());
// logger.info("*** type.getClassPath() ::{}, {}**** ", type.getClassPath());
DriverManager.setLoginTimeout(10);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguration.getDatabasePassword());
if (logger.isDebugEnabled()) {
logger.debug("*** Acquired New connection for ::{} **** ", dbURL);
}
return connection;
} catch (ClassNotFoundException e) {
logger.error("Jdbc Driver not found", e);
throw new DatabaseServiceException(e.getMessage());
} catch (SQLException e) {
logger.error("SQLException::Couldn't get a Connection!", e);
throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage());
}
} | Base | 1 |
private String getDatabaseUrl(DatabaseConfiguration dbConfig) {
int port = dbConfig.getDatabasePort();
return "jdbc:" + dbConfig.getDatabaseType() + "://" + dbConfig.getDatabaseHost()
+ ((port == 0) ? "" : (":" + port)) + "/" + dbConfig.getDatabaseName() + "?useSSL=" + dbConfig.isUseSSL();
} | Base | 1 |
private static String getDatabaseUrl(DatabaseConfiguration dbConfig) {
int port = dbConfig.getDatabasePort();
return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + "://" + dbConfig.getDatabaseHost()
+ ((port == 0) ? "" : (":" + port)) + "/" + dbConfig.getDatabaseName();
} | Base | 1 |
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection)
throws DatabaseServiceException {
try {
// logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection);
if (connection != null && !forceNewConnection) {
// logger.info("connection closed::{}", connection.isClosed());
if (!connection.isClosed()) {
if (logger.isDebugEnabled()) {
logger.debug("Returning existing connection::{}", connection);
}
return connection;
}
}
Class.forName(type.getClassPath());
DriverManager.setLoginTimeout(10);
String dbURL = getDatabaseUrl(databaseConfiguration);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguration.getDatabasePassword());
logger.debug("*** Acquired New connection for ::{} **** ", dbURL);
return connection;
} catch (ClassNotFoundException e) {
logger.error("Jdbc Driver not found", e);
throw new DatabaseServiceException(e.getMessage());
} catch (SQLException e) {
logger.error("SQLException::Couldn't get a Connection!", e);
throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage());
}
} | Base | 1 |
public static String getDatabaseUrl(DatabaseConfiguration dbConfig) {
return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + ":" + dbConfig.getDatabaseName();
} | Base | 1 |
public void initGui() {
super.initGui();
controlList.add(new SmallGuiButton(0, (width-xSize) / 2 + 164, (height - ySize) / 2 + 50, 10,10, ">"));
controlList.add(new SmallGuiButton(1, (width-xSize) / 2 + 129, (height - ySize) / 2 + 50, 10,10, "<"));
//controlList.add(new SmallGuiButton(2, (width-xSize) / 2 + 138, (height - ySize) / 2 + 75, 30,10, "Paint"));
controlList.add(new SmallGuiButton(3, (width-xSize) / 2 + 47, (height - ySize) / 2 + 50, 37,10, "Import"));
controlList.add(new SmallGuiButton(4, (width-xSize) / 2 + 15, (height - ySize) / 2 + 50, 28,10, "Open"));
for(int i = 0; i < 6; i++) {
controlList.add(buttonarray[i] = new SmallGuiButton(5 + i, (width-xSize) / 2 + 20 + 18 * i, (height - ySize) / 2 + 37, 10,10, ">"));
buttonarray[i].drawButton = false;
}
controlList.add(new SmallGuiButton(20, (width-xSize) / 2 + 164, (height - ySize) / 2 + 85, 10,10, ">"));
controlList.add(new SmallGuiButton(21, (width-xSize) / 2 + 129, (height - ySize) / 2 + 85, 10,10, "<"));
} | Base | 1 |
protected void actionPerformed(GuiButton guibutton) {
if(5 <= guibutton.id && guibutton.id < 11) {
_logic.handleStackMove(guibutton.id - 5);
}
switch(guibutton.id){
case 0:
_logic.setNextSatellite(_player);
return;
case 1:
_logic.setPrevSatellite(_player);
return;
case 2:
_logic.paintPathToSatellite();
return;
case 3:
_logic.importFromCraftingTable(_player);
return;
case 4:
_logic.openAttachedGui(_player);
return;
case 20:
_logic.priorityUp(_player);
return;
case 21:
_logic.priorityDown(_player);
return;
default:
super.actionPerformed(guibutton);
return;
}
} | Base | 1 |
public GuiCraftingPipe(EntityPlayer player, IInventory dummyInventory, BaseLogicCrafting logic) {
super(null);
_player = player;
DummyContainer dummy = new DummyContainer(player.inventory, dummyInventory);
dummy.addNormalSlotsForPlayerInventory(18, 97);
//Input slots
for(int l = 0; l < 9; l++) {
dummy.addDummySlot(l, 18 + l * 18, 18);
}
//Output slot
dummy.addDummySlot(9, 90, 64);
this.inventorySlots = dummy;
_logic = logic;
xSize = 195;
ySize = 187;
buttonarray = new GuiButton[6];
} | Base | 1 |
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine.getTexture("/logisticspipes/gui/crafting.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = guiLeft;
int k = guiTop;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
drawRect(400, 400, 0, 0, 0x404040);
for(int count=36; count<42;count++) {
Slot slot = inventorySlots.getSlot(count);
if(slot != null && slot.getStack() != null && slot.getStack().getMaxStackSize() < 2) {
drawRect(guiLeft + 18 + (18 * (count-36)), guiTop + 18, guiLeft + 18 + (18 * (count-36)) + 16, guiTop + 18 + 16, 0xFFFF0000);
buttonarray[count - 36].drawButton = true;
} else {
buttonarray[count - 36].drawButton = false;
}
}
} | Base | 1 |
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRenderer.drawString("Inputs", 18, 7, 0x404040);
fontRenderer.drawString("Output", 48, 67, 0x404040);
fontRenderer.drawString("Inventory", 18, 86, 0x404040);
fontRenderer.drawString("Satellite", 132, 7, 0x404040);
if (_logic.satelliteId == 0){
fontRenderer.drawString("Off", 144, 52, 0x404040);
} else {
fontRenderer.drawString(""+_logic.satelliteId , 155 - fontRenderer.getStringWidth(""+_logic.satelliteId) , 52, 0x404040);
/*
if (_logic.isSatelliteConnected()){
MinecraftForgeClient.bindTexture(mod_LogisticsPipes.LOGISTICSPIPE_ROUTED_TEXTURE_FILE);
}else{
MinecraftForgeClient.bindTexture(mod_LogisticsPipes.LOGISTICSPIPE_NOTROUTED_TEXTURE_FILE);
}*/
//TODO /\ /\ ???
//GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//drawRect(0,1000,0,10000, 0xFFFF0000);
//drawTexturedModalRect(155, 50, 10 * (xSize / 16) , 0, 10, 10);
//MinecraftForgeClient.unbindTexture();
}
fontRenderer.drawString("Priority:" , 132 , 75, 0x404040);
fontRenderer.drawString(""+_logic.priority , 152 - (fontRenderer.getStringWidth(""+_logic.priority) / 2) , 87, 0x404040);
} | Base | 1 |
public void setNextSatellite(EntityPlayer player) {
if (MainProxy.isClient(player.worldObj)) {
final PacketCoordinates packet = new PacketCoordinates(NetworkConstants.CRAFTING_PIPE_NEXT_SATELLITE, xCoord, yCoord, zCoord);
MainProxy.sendPacketToServer(packet.getPacket());
} else {
satelliteId = getNextConnectSatelliteId(false);
final PacketPipeInteger packet = new PacketPipeInteger(NetworkConstants.CRAFTING_PIPE_SATELLITE_ID, xCoord, yCoord, zCoord, satelliteId);
MainProxy.sendPacketToPlayer(packet.getPacket(), (Player)player);
}
} | Base | 1 |
protected int getNextConnectSatelliteId(boolean prev) {
final List<ExitRoute> routes = getRoutedPipe().getRouter().getIRoutersByCost();
int closestIdFound = prev ? 0 : Integer.MAX_VALUE;
for (final BaseLogicSatellite satellite : BaseLogicSatellite.AllSatellites) {
CoreRoutedPipe satPipe = satellite.getRoutedPipe();
if(satPipe == null || satPipe.stillNeedReplace() || satPipe.getRouter() == null)
continue;
IRouter satRouter = satPipe.getRouter();
for (ExitRoute route:routes){
if (route.destination == satRouter) {
if (!prev && satellite.satelliteId > satelliteId && satellite.satelliteId < closestIdFound) {
closestIdFound = satellite.satelliteId;
} else if (prev && satellite.satelliteId < satelliteId && satellite.satelliteId > closestIdFound) {
closestIdFound = satellite.satelliteId;
}
}
}
}
if (closestIdFound == Integer.MAX_VALUE) {
return satelliteId;
}
return closestIdFound;
} | Base | 1 |
public void setPrevSatellite(EntityPlayer player) {
if (MainProxy.isClient(player.worldObj)) {
final PacketCoordinates packet = new PacketCoordinates(NetworkConstants.CRAFTING_PIPE_PREV_SATELLITE, xCoord, yCoord, zCoord);
MainProxy.sendPacketToServer(packet.getPacket());
} else {
satelliteId = getNextConnectSatelliteId(true);
final PacketPipeInteger packet = new PacketPipeInteger(NetworkConstants.CRAFTING_PIPE_SATELLITE_ID, xCoord, yCoord, zCoord, satelliteId);
MainProxy.sendPacketToPlayer(packet.getPacket(), (Player)player);
}
} | Base | 1 |
public void setSatelliteId(int satelliteId) {
this.satelliteId = satelliteId;
} | Base | 1 |
public boolean isSatelliteConnected() {
final List<ExitRoute> routes = getRoutedPipe().getRouter().getIRoutersByCost();
for (final BaseLogicSatellite satellite : BaseLogicSatellite.AllSatellites) {
if (satellite.satelliteId == satelliteId) {
CoreRoutedPipe satPipe = satellite.getRoutedPipe();
if(satPipe == null || satPipe.stillNeedReplace() || satPipe.getRouter() == null)
continue;
IRouter satRouter = satPipe.getRouter();
for (ExitRoute route:routes) {
if (route.destination == satRouter) {
return true;
}
}
}
}
return false;
} | Base | 1 |
public IRouter getSatelliteRouter() {
for (final BaseLogicSatellite satellite : BaseLogicSatellite.AllSatellites) {
if (satellite.satelliteId == satelliteId) {
CoreRoutedPipe satPipe = satellite.getRoutedPipe();
if(satPipe == null || satPipe.stillNeedReplace() || satPipe.getRouter() == null)
continue;
return satPipe.getRouter();
}
}
return null;
} | Base | 1 |
public void paintPathToSatellite() {
final IRouter satelliteRouter = getSatelliteRouter();
if (satelliteRouter == null) {
return;
}
getRoutedPipe().getRouter().displayRouteTo(satelliteRouter.getSimpleID());
} | Base | 1 |
public Pair<Integer, Integer> getBestReply(LiquidStack stack, IRouter sourceRouter, List<Integer> jamList) {
for (ExitRoute candidateRouter : sourceRouter.getIRoutersByCost()){
if(!candidateRouter.containsFlag(PipeRoutingConnectionType.canRouteTo)) continue;
if(candidateRouter.destination.getSimpleID() == sourceRouter.getSimpleID()) continue;
if(jamList.contains(candidateRouter.destination.getSimpleID())) continue;
if (candidateRouter.destination.getPipe() == null || !candidateRouter.destination.getPipe().isEnabled()) continue;
CoreRoutedPipe pipe = candidateRouter.destination.getPipe();
if(!(pipe instanceof ILiquidSink)) continue;
int amount = ((ILiquidSink)pipe).sinkAmount(stack);
if(amount > 0) {
Pair<Integer, Integer> result = new Pair<Integer, Integer>(candidateRouter.destination.getSimpleID(), amount);
return result;
}
}
Pair<Integer, Integer> result = new Pair<Integer, Integer>(null, 0);
return result;
} | Base | 1 |
private static void onCraftingPipeSetSatellite(PacketPipeInteger packet) {
final TileGenericPipe pipe = getPipe(FMLClientHandler.instance().getClient().theWorld, packet.posX, packet.posY, packet.posZ);
if (pipe == null) {
return;
}
if (!(pipe.pipe.logic instanceof BaseLogicCrafting)) {
return;
}
((BaseLogicCrafting) pipe.pipe.logic).setSatelliteId(packet.integer);
} | Base | 1 |
public CraftingTemplate addCrafting() {
if (!isEnabled()){
return null;
}
BaseLogicCrafting craftingLogic = (BaseLogicCrafting) this.logic;
ItemStack stack = craftingLogic.getCraftedItem();
if ( stack == null) return null;
boolean hasSatellite = craftingLogic.isSatelliteConnected();
if(craftingLogic.satelliteId != 0 && !hasSatellite) return null;
CraftingTemplate template = new CraftingTemplate(ItemIdentifierStack.GetFromStack(stack), this, craftingLogic.priority);
//Check all materials
for (int i = 0; i < 9; i++){
ItemStack resourceStack = craftingLogic.getMaterials(i);
if (resourceStack == null || resourceStack.stackSize == 0) continue;
if (i < 6 || !hasSatellite) {
template.addRequirement(ItemIdentifierStack.GetFromStack(resourceStack), this);
} else {
template.addRequirement(ItemIdentifierStack.GetFromStack(resourceStack), (IRequestItems)craftingLogic.getSatelliteRouter().getPipe());
}
}
return template;
} | Base | 1 |
public boolean tryIserting(World world, EntityPlayer entityplayer) {
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == LogisticsPipes.UpgradeItem.itemID) {
if(MainProxy.isClient(world)) return true;
for(int i=0;i<inv.getSizeInventory() - 1;i++) {
ItemStack item = inv.getStackInSlot(i);
if(item == null) {
inv.setInventorySlotContents(i, entityplayer.getCurrentEquippedItem().splitStack(1));
InventoryChanged(inv);
return true;
} else if(item.getItemDamage() == entityplayer.getCurrentEquippedItem().getItemDamage()) {
if(item.stackSize < inv.getInventoryStackLimit()) {
item.stackSize++;
entityplayer.getCurrentEquippedItem().splitStack(1);
return true;
}
}
}
}
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == LogisticsPipes.LogisticsItemCard.itemID && entityplayer.getCurrentEquippedItem().getItemDamage() == LogisticsItemCard.SEC_CARD) {
if(MainProxy.isClient(world)) return true;
if(inv.getStackInSlot(8) == null) {
inv.setInventorySlotContents(8, entityplayer.getCurrentEquippedItem().copy());
inv.getStackInSlot(8).stackSize = 1;
entityplayer.getCurrentEquippedItem().splitStack(1);
return true;
}
}
return false;
} | Base | 1 |
public DummyContainer getDummyContainer(EntityPlayer player) {
DummyContainer dummy = new DummyContainer(player.inventory, inv);
dummy.addNormalSlotsForPlayerInventory(8, 60);
//Pipe slots
for(int pipeSlot = 0; pipeSlot < 8; pipeSlot++){
dummy.addRestrictedSlot(pipeSlot, inv, 8 + pipeSlot * 18, 18, LogisticsPipes.UpgradeItem.itemID);
}
dummy.addRestrictedSlot(8, inv, 8 + 8 * 18, 18, new ISlotCheck() {
@Override
public boolean isStackAllowed(ItemStack itemStack) {
if(itemStack == null) return false;
if(itemStack.itemID != LogisticsPipes.LogisticsItemCard.itemID) return false;
if(itemStack.getItemDamage() != LogisticsItemCard.SEC_CARD) return false;
return true;
}
});
return dummy;
} | Base | 1 |
public void writeToLPData(LPDataOutput output) throws IOException {
output.writeLongArray(amountRecorded);
output.writeInt(arrayPos);
output.writeItemIdentifier(item);
} | Base | 1 |
public void readFromLPData(LPDataInput input) throws IOException {
amountRecorded = input.readLongArray();
arrayPos = input.readInt();
item = input.readItemIdentifier();
} | Base | 1 |
public void setUseNewRenderer(boolean flag) {
useNewRenderer = flag;
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
useNewRenderer = input.readBoolean();
useFallbackRenderer = input.readBoolean();
renderPipeDistance = input.readInt();
renderPipeContentDistance = input.readInt();
isUninitialised = false;
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeBoolean(useNewRenderer);
output.writeBoolean(useFallbackRenderer);
output.writeInt(renderPipeDistance);
output.writeInt(renderPipeContentDistance);
} | Base | 1 |
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
super.handlerAdded(ctx);
ctx.attr(PacketHandler.INBOUNDPACKETTRACKER).set(new ThreadLocal<>());
} | Base | 1 |
private static void onPacketData(ModernPacket packet, final EntityPlayer player) {
try {
packet.processPacket(player);
if (LPConstants.DEBUG) {
PacketHandler.debugMap.remove(packet.getDebugId());
}
} catch (DelayPacketException e) {
if (packet.retry() && MainProxy.isClient(player.getEntityWorld())) {
SimpleServiceLocator.clientBufferHandler.queueFailedPacket(packet, player);
} else if (LPConstants.DEBUG) {
LogisticsPipes.log.error(packet.getClass().getName());
LogisticsPipes.log.error(packet.toString());
e.printStackTrace();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
} | Base | 1 |
public static void onPacketData(final LPDataInput data, final EntityPlayer player) throws IOException {
if (player == null) {
return;
}
final int packetID = data.readShort();
final ModernPacket packet = PacketHandler.packetlist.get(packetID).template();
packet.setDebugId(data.readInt());
packet.readData(data);
PacketHandler.onPacketData(packet, player);
} | Base | 1 |
InboundModernPacketWrapper(ModernPacket p, EntityPlayer e) {
packet = p;
player = e;
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBoolean(flag);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
flag = input.readBoolean();
} | Base | 1 |
public BooleanModuleCoordinatesGuiProvider(int id) {
super(id);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
} | Base | 1 |
public CoordinatesGuiProvider(int id) {
super(id);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
} | Base | 1 |
public CoordinatesPopupGuiProvider(int id) {
super(id);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {} | Base | 1 |
public void readData(LPDataInput input) throws IOException {} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
slot = input.readEnum(ModulePositionType.class);
positionInt = input.readInt();
} | Base | 1 |
public ModuleCoordinatesGuiProvider(int id) {
super(id);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeEnum(slot);
output.writeInt(positionInt);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(invSlot);
} | Base | 1 |
public ModuleInHandGuiProvider(int id) {
super(id);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
invSlot = input.readInt();
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
nbt = input.readNBTTagCompound();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeNBTTagCompound(nbt);
} | Base | 1 |
public UpgradeCoordinatesGuiProvider(int id) {
super(id);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
positionInt = input.readInt();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(positionInt);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBitSet(getFlags());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setFlags(input.readBitSet());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBoolean(flag);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
flag = input.readBoolean();
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
} | Base | 1 |
public CoordinatesPacket(int id) {
super(id);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
direction = input.readForgeDirection();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeForgeDirection(direction);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger2(input.readInt());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger2());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger2());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger2(input.readInt());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger(input.readInt());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger(input.readInt());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
setInteger(input.readInt());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(getInteger());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
if (inventory != null) {
output.writeByte(STACK_MARKER);
output.writeInt(inventory.getSizeInventory());
for (int i = 0; i < inventory.getSizeInventory(); i++) {
output.writeItemStack(inventory.getStackInSlot(i));
}
} else if (stackList != null) {
output.writeByte(STACK_MARKER);
output.writeCollection(stackList, LPDataOutput::writeItemStack);
} else if (identList != null) {
output.writeByte(IDENT_MARKER);
output.writeCollection(identList, LPDataOutput::writeItemIdentifierStack);
} else if (identSet != null) {
output.writeByte(IDENT_MARKER);
output.writeCollection(identSet, LPDataOutput::writeItemIdentifierStack);
} else {
throw new IllegalStateException("Wont send packet without content");
}
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
byte marker = input.readByte();
if (marker == STACK_MARKER) {
stackList = input.readLinkedList(LPDataInput::readItemStack);
} else if (marker == IDENT_MARKER) {
identList = input.readLinkedList(LPDataInput::readItemIdentifierStack);
} else {
throw new UnsupportedOperationException("Unknown marker: " + marker);
}
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
final int itemID = input.readInt();
if (itemID != 0) {
int stackSize = input.readInt();
int damage = input.readInt();
setStack(new ItemStack(Item.getItemById(itemID), stackSize, damage));
getStack().setTagCompound(input.readNBTTagCompound());
} else {
setStack(null);
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
if (getStack() != null) {
output.writeInt(Item.getIdFromItem(getStack().getItem()));
output.writeInt(getStack().stackSize);
output.writeInt(getStack().getItemDamage());
output.writeNBTTagCompound(getStack().getTagCompound());
} else {
output.writeInt(0);
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeCollection(list, this);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
list = input.readArrayList(this);
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBoolean(type != null);
if (type != null) {
output.writeEnum(type);
output.writeInt(positionInt);
}
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
if (input.readBoolean()) {
type = input.readEnum(ModulePositionType.class);
positionInt = input.readInt();
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeNBTTagCompound(tag);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
tag = input.readNBTTagCompound();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeNBTTagCompound(tag);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
tag = input.readNBTTagCompound();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeItemIdentifierStack(stack);
output.writeInt(dimension);
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
stack = input.readItemIdentifierStack();
dimension = input.readInt();
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(getInteger());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
setInteger(input.readInt());
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeUTF(getString());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setString(input.readUTF());
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
int size = input.readInt();
for (int i = 0; i < size; i++) {
getStringList().add(input.readUTF());
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(getStringList().size());
for (int i = 0; i < getStringList().size(); i++) {
output.writeUTF(getStringList().get(i));
}
} | Base | 1 |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
targetType = input.readItemIdentifier();
if (input.readBoolean()) {
for (int i = 0; i < 9; i++) {
ignore_dmg[i] = input.readBoolean();
ignore_nbt[i] = input.readBoolean();
use_od[i] = input.readBoolean();
use_category[i] = input.readBoolean();
}
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeItemIdentifier(targetType);
output.writeBoolean(isFuzzy);
if (isFuzzy) {
for (int i = 0; i < 9; i++) {
output.writeBoolean(ignore_dmg[i]);
output.writeBoolean(ignore_nbt[i]);
output.writeBoolean(use_od[i]);
output.writeBoolean(use_category[i]);
}
}
} | Base | 1 |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeCollection(trackingList, (output1, object) -> object.writeToLPData(output1));
} | Base | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.