conflict_resolution
stringlengths
27
16k
<<<<<<< try { // do not hold lock while sleeping wait(sleepTime); } catch (InterruptedException e) { log.debug("Wait in retry() was interrupted.", e); ======= try { // do not hold lock while sleeping Thread.sleep(sleepTime); } catch (InterruptedException e) { log.debug("Wait in retry() was interrupted.", e); } LockSupport.parkNanos(sleepTime); if (sleepTime < 10000) { sleepTime = (int) (sleepTime + sleepTime * Math.random()); } >>>>>>> try { // do not hold lock while sleeping Thread.sleep(sleepTime); } catch (InterruptedException e) { log.debug("Wait in retry() was interrupted.", e); } LockSupport.parkNanos(sleepTime); if (sleepTime < 10000) { sleepTime = (int) (sleepTime + sleepTime * Math.random()); } <<<<<<< // The following call to exists() is important, since we are caching that a node does not exist. Once the node comes into existence, it will be added to // the cache. But this notification of a node coming into existence will only be given if exists() was previously called. // // If the call to exists() is bypassed and only getData() is called with a special case that looks for Code.NONODE in the KeeperException, then // non-existence can not be cached. Stat stat = zooKeeper.exists(zPath, watcher); byte[] data = null; if (stat == null) { if (log.isTraceEnabled()) log.trace("zookeeper did not contain " + zPath); } else { try { data = zooKeeper.getData(zPath, watcher, stat); } catch (KeeperException.BadVersionException e1) { throw new ConcurrentModificationException(); } catch (KeeperException.NoNodeException e2) { throw new ConcurrentModificationException(); ======= /* * The following call to exists() is important, since we are caching that a node does not exist. Once the node comes into existence, it will be added to * the cache. But this notification of a node coming into existence will only be given if exists() was previously called. * * If the call to exists() is bypassed and only getData() is called with a special case that looks for Code.NONODE in the KeeperException, then * non-existence can not be cached. */ cacheWriteLock.lock(); try { stat = zooKeeper.exists(zPath, watcher); byte[] data = null; if (stat == null) { if (log.isTraceEnabled()) { log.trace("zookeeper did not contain " + zPath); } } else { try { data = zooKeeper.getData(zPath, watcher, stat); } catch (KeeperException.BadVersionException e1) { throw new ConcurrentModificationException(); } catch (KeeperException.NoNodeException e2) { throw new ConcurrentModificationException(); } if (log.isTraceEnabled()) { log.trace("zookeeper contained " + zPath + " " + (data == null ? null : new String(data, UTF_8))); } >>>>>>> /* * The following call to exists() is important, since we are caching that a node does not exist. Once the node comes into existence, it will be added to * the cache. But this notification of a node coming into existence will only be given if exists() was previously called. If the call to exists() is * bypassed and only getData() is called with a special case that looks for Code.NONODE in the KeeperException, then non-existence can not be cached. */ cacheWriteLock.lock(); try { stat = zooKeeper.exists(zPath, watcher); byte[] data = null; if (stat == null) { if (log.isTraceEnabled()) { log.trace("zookeeper did not contain " + zPath); } } else { try { data = zooKeeper.getData(zPath, watcher, stat); } catch (KeeperException.BadVersionException e1) { throw new ConcurrentModificationException(); } catch (KeeperException.NoNodeException e2) { throw new ConcurrentModificationException(); } if (log.isTraceEnabled()) { log.trace("zookeeper contained " + zPath + " " + (data == null ? null : new String(data, UTF_8))); }
<<<<<<< _modelMap.put(236, "Lucian"); ======= _modelMap.put(127, "Lissandra"); _modelMap.put(266, "Aatrox"); >>>>>>> _modelMap.put(127, "Lissandra"); _modelMap.put(266, "Aatrox"); _modelMap.put(236, "Lucian");
<<<<<<< //import android.os.Binder; ======= import android.os.Binder; import android.os.Build; >>>>>>> import android.os.Binder; import android.os.Build; <<<<<<< Log.w(TAG, "onCreate: STARTING SERVICE"); ======= >>>>>>> Log.w(TAG, "STARTING SERVICE"); <<<<<<< if (CollectionServiceStarter.isBTWixel(getApplicationContext())|| CollectionServiceStarter.isDexbridgeWixel(getApplicationContext())) { ======= if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT){ stopSelf(); return START_NOT_STICKY; } if (CollectionServiceStarter.isBTWixel(getApplicationContext())) { >>>>>>> if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT){ stopSelf(); return START_NOT_STICKY; } if (CollectionServiceStarter.isBTWixel(getApplicationContext()) || CollectionServiceStarter.isDexbridgeWixel(getApplicationContext())) { <<<<<<< alarm.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis() + retry_in, PendingIntent.getService(this, 0, new Intent(this, DexCollectionService.class), 0)); ======= alarm.setExact(alarm.RTC_WAKEUP, calendar.getTimeInMillis() + retry_in, PendingIntent.getService(this, 0, new Intent(this, DexCollectionService.class), 0)); >>>>>>> alarm.setExact(alarm.RTC_WAKEUP, calendar.getTimeInMillis() + retry_in, PendingIntent.getService(this, 0, new Intent(this, DexCollectionService.class), 0)); <<<<<<< Log.w(TAG, "setSerialDataToTransmitterRawData: received some data!"); ======= Log.w(TAG, "received some data!"); PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ReceivedReading"); wakeLock.acquire(); >>>>>>> Log.w(TAG, "received some data!"); PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ReceivedReading"); wakeLock.acquire(); <<<<<<< if (CollectionServiceStarter.isDexbridgeWixel(getApplicationContext())) { Log.w(TAG, "setSerialDataToTransmitterRawData: Dealing with Dexbridge packet!"); int DexSrc; int TransmitterID; String TxId; Calendar c = Calendar.getInstance(); long secondsNow = c.getTimeInMillis(); ByteBuffer tmpBuffer = ByteBuffer.allocate(len); tmpBuffer.order(ByteOrder.LITTLE_ENDIAN); tmpBuffer.put(buffer, 0, len); ByteBuffer txidMessage = ByteBuffer.allocate(6); txidMessage.order(ByteOrder.LITTLE_ENDIAN); if (buffer[0] == 0x07 && buffer[1] == -15) { //We have a Beacon packet. Get the TXID value and compare with dex_txid Log.w(TAG, "setSerialDataToTransmitterRawData: Received Beacon packet."); //DexSrc starts at Byte 2 of a Beacon packet. DexSrc = tmpBuffer.getInt(2); TxId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("dex_txid", "00000"); TransmitterID = convertSrc(TxId); if (TxId.compareTo("00000") != 0 && Integer.compare(DexSrc, TransmitterID) != 0) { Log.w(TAG, "setSerialDataToTransmitterRawData: TXID wrong. Expected " + TransmitterID + " but got " + DexSrc); txidMessage.put(0, (byte) 0x06); txidMessage.put(1, (byte) 0x01); txidMessage.putInt(2, TransmitterID); sendBtMessage(txidMessage); } return; } if (buffer[0] == 0x11 && buffer[1] == 0x00) { //we have a data packet. Check to see if the TXID is what we are expecting. Log.w(TAG, "setSerialDataToTransmitterRawData: Received Data packet"); //make sure we are not processing a packet we already have if (secondsNow - lastPacketTime < 60000) { Log.v(TAG, "setSerialDataToTransmitterRawData: Received Duplicate Packet. Exiting."); return; } else { lastPacketTime = secondsNow; } if (len >= 0x11) { //DexSrc starts at Byte 12 of a data packet. DexSrc = tmpBuffer.getInt(12); TxId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("dex_txid", "00000"); TransmitterID = convertSrc(TxId); if (Integer.compare(DexSrc, TransmitterID) != 0) { Log.w(TAG, "TXID wrong. Expected " + TransmitterID + " but got " + DexSrc); txidMessage.put(0, (byte) 0x06); txidMessage.put(1, (byte) 0x01); txidMessage.putInt(2, TransmitterID); sendBtMessage(txidMessage); } bridgeBattery = ByteBuffer.wrap(buffer).get(11); //All is OK, so process it. //first, tell the wixel it is OK to sleep. Log.d(TAG, "setSerialDataToTransmitterRawData: Sending Data packet Ack, to put wixel to sleep"); ByteBuffer ackMessage = ByteBuffer.allocate(2); ackMessage.put(0, (byte) 0x02); ackMessage.put(1, (byte) 0xF0); sendBtMessage(ackMessage); timestamp = new Date().getTime(); Log.v(TAG,"setSerialDataToTransmitterRawData: Creating TransmitterData at "+timestamp); TransmitterData transmitterData = TransmitterData.create(buffer, len, timestamp); if (transmitterData != null) { Sensor sensor = Sensor.currentSensor(); if (sensor != null) { sensor.latest_battery_level = transmitterData.sensor_battery_level; sensor.save(); BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, this, timestamp); Intent intent = new Intent("com.eveningoutpost.dexdrip.DexCollectionService.SAVED_BG"); sendBroadcast(intent); } else { Log.w(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); } } } } } else { TransmitterData transmitterData = TransmitterData.create(buffer, len, timestamp); //TransmitterData transmitterData = TransmitterData.create(buffer, len); if (transmitterData != null) { Sensor sensor = Sensor.currentSensor(); if (sensor != null) { sensor.latest_battery_level = transmitterData.sensor_battery_level; sensor.save(); BgReading bgReading = BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, this, timestamp); Intent intent = new Intent("com.eveningoutpost.dexdrip.DexCollectionService.SAVED_BG"); sendBroadcast(intent); } else { Log.w(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); } ======= TransmitterData transmitterData = TransmitterData.create(buffer, len, timestamp); if (transmitterData != null) { Sensor sensor = Sensor.currentSensor(); if (sensor != null) { sensor.latest_battery_level = transmitterData.sensor_battery_level; sensor.save(); BgReading.create(transmitterData.raw_data, transmitterData.raw_data, this, timestamp); } else { Log.w(TAG, "No Active Sensor, Data only stored in Transmitter Data"); >>>>>>> if (CollectionServiceStarter.isDexbridgeWixel(getApplicationContext())) { Log.w(TAG, "setSerialDataToTransmitterRawData: Dealing with Dexbridge packet!"); int DexSrc; int TransmitterID; String TxId; Calendar c = Calendar.getInstance(); long secondsNow = c.getTimeInMillis(); ByteBuffer tmpBuffer = ByteBuffer.allocate(len); tmpBuffer.order(ByteOrder.LITTLE_ENDIAN); tmpBuffer.put(buffer, 0, len); ByteBuffer txidMessage = ByteBuffer.allocate(6); txidMessage.order(ByteOrder.LITTLE_ENDIAN); if (buffer[0] == 0x07 && buffer[1] == -15) { //We have a Beacon packet. Get the TXID value and compare with dex_txid Log.w(TAG, "setSerialDataToTransmitterRawData: Received Beacon packet."); //DexSrc starts at Byte 2 of a Beacon packet. DexSrc = tmpBuffer.getInt(2); TxId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("dex_txid", "00000"); TransmitterID = convertSrc(TxId); if (TxId.compareTo("00000") != 0 && Integer.compare(DexSrc, TransmitterID) != 0) { Log.w(TAG, "setSerialDataToTransmitterRawData: TXID wrong. Expected " + TransmitterID + " but got " + DexSrc); txidMessage.put(0, (byte) 0x06); txidMessage.put(1, (byte) 0x01); txidMessage.putInt(2, TransmitterID); sendBtMessage(txidMessage); } return; } if (buffer[0] == 0x11 && buffer[1] == 0x00) { //we have a data packet. Check to see if the TXID is what we are expecting. Log.w(TAG, "setSerialDataToTransmitterRawData: Received Data packet"); //make sure we are not processing a packet we already have if (secondsNow - lastPacketTime < 60000) { Log.v(TAG, "setSerialDataToTransmitterRawData: Received Duplicate Packet. Exiting."); return; } else { lastPacketTime = secondsNow; } if (len >= 0x11) { //DexSrc starts at Byte 12 of a data packet. DexSrc = tmpBuffer.getInt(12); TxId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("dex_txid", "00000"); TransmitterID = convertSrc(TxId); if (Integer.compare(DexSrc, TransmitterID) != 0) { Log.w(TAG, "TXID wrong. Expected " + TransmitterID + " but got " + DexSrc); txidMessage.put(0, (byte) 0x06); txidMessage.put(1, (byte) 0x01); txidMessage.putInt(2, TransmitterID); sendBtMessage(txidMessage); } bridgeBattery = ByteBuffer.wrap(buffer).get(11); //All is OK, so process it. //first, tell the wixel it is OK to sleep. Log.d(TAG, "setSerialDataToTransmitterRawData: Sending Data packet Ack, to put wixel to sleep"); ByteBuffer ackMessage = ByteBuffer.allocate(2); ackMessage.put(0, (byte) 0x02); ackMessage.put(1, (byte) 0xF0); sendBtMessage(ackMessage); timestamp = new Date().getTime(); Log.v(TAG,"setSerialDataToTransmitterRawData: Creating TransmitterData at "+timestamp); TransmitterData transmitterData = TransmitterData.create(buffer, len, timestamp); if (transmitterData != null) { Sensor sensor = Sensor.currentSensor(); if (sensor != null) { sensor.latest_battery_level = transmitterData.sensor_battery_level; sensor.save(); BgReading.create(transmitterData.raw_data, transmitterData.filtered_data, this, timestamp); Intent intent = new Intent("com.eveningoutpost.dexdrip.DexCollectionService.SAVED_BG"); sendBroadcast(intent); } else { Log.w(TAG, "setSerialDataToTransmitterRawData: No Active Sensor, Data only stored in Transmitter Data"); } } } } } else { TransmitterData transmitterData = TransmitterData.create(buffer, len, timestamp); if (transmitterData != null) { Sensor sensor = Sensor.currentSensor(); if (sensor != null) { sensor.latest_battery_level = transmitterData.sensor_battery_level; sensor.save(); BgReading.create(transmitterData.raw_data, transmitterData.raw_data, this, timestamp); } else { Log.w(TAG, "No Active Sensor, Data only stored in Transmitter Data"); }
<<<<<<< import com.nispok.snackbar.Snackbar; import com.nispok.snackbar.SnackbarManager; import com.nispok.snackbar.enums.SnackbarType; import com.nispok.snackbar.listeners.ActionClickListener; ======= >>>>>>> import com.nispok.snackbar.Snackbar; import com.nispok.snackbar.SnackbarManager; import com.nispok.snackbar.enums.SnackbarType; import com.nispok.snackbar.listeners.ActionClickListener; <<<<<<< if (!predictive) { estimate = lastBgreading.calculated_value; ======= if (notificationText.getText().length()==0){ notificationText.setTextColor(Color.WHITE); } if(!predictive){ estimate=lastBgreading.calculated_value; >>>>>>> if (!predictive) { estimate = lastBgreading.calculated_value; <<<<<<< if (bgGraphBuilder.unitized(estimate) <= bgGraphBuilder.lowMark) { ======= int minutes = (int)(System.currentTimeMillis() - lastBgreading.timestamp) / (60 * 1000); notificationText.append("\n" + minutes + ((minutes==1)?" Minute ago":" Minutes ago")); List<BgReading> bgReadingList = BgReading.latest(2); if(bgReadingList != null && bgReadingList.size() == 2) { // same logic as in xDripWidget (refactor that to BGReadings to avoid redundancy / later inconsistencies)? notificationText.append("\n" + bgGraphBuilder.unitizedDeltaString(lastBgreading.calculated_value - bgReadingList.get(1).calculated_value)); } if(bgGraphBuilder.unitized(estimate) <= bgGraphBuilder.lowMark) { >>>>>>> int minutes = (int)(System.currentTimeMillis() - lastBgreading.timestamp) / (60 * 1000); notificationText.append("\n" + minutes + ((minutes==1)?" Minute ago":" Minutes ago")); List<BgReading> bgReadingList = BgReading.latest(2); if(bgReadingList != null && bgReadingList.size() == 2) { // same logic as in xDripWidget (refactor that to BGReadings to avoid redundancy / later inconsistencies)? notificationText.append("\n" + bgGraphBuilder.unitizedDeltaString(lastBgreading.calculated_value - bgReadingList.get(1).calculated_value)); } if(bgGraphBuilder.unitized(estimate) <= bgGraphBuilder.lowMark) {
<<<<<<< final Preference transmitterId = findPreference("dex_txid"); ======= final Preference pebbleSync = findPreference("broadcast_to_pebble"); >>>>>>> final Preference transmitterId = findPreference("dex_txid"); final Preference pebbleSync = findPreference("broadcast_to_pebble"); <<<<<<< if(prefs.getString("dex_collection_method", "BluetoothWixel").compareTo("DexbridgeWixel") != 0) { collectionCategory.removePreference(transmitterId); } ======= pebbleSync.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Context context = preference.getContext(); if ((Boolean) newValue) { context.startService(new Intent(context, PebbleSync.class)); } else { context.stopService(new Intent(context, PebbleSync.class)); } return true; } }); >>>>>>> if(prefs.getString("dex_collection_method", "BluetoothWixel").compareTo("DexbridgeWixel") != 0) { collectionCategory.removePreference(transmitterId); } pebbleSync.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Context context = preference.getContext(); if ((Boolean) newValue) { context.startService(new Intent(context, PebbleSync.class)); } else { context.stopService(new Intent(context, PebbleSync.class)); } return true; } }); <<<<<<< if(((String) newValue).compareTo("BluetoothWixel") != 0 && ((String) newValue).compareTo("DexcomShare") != 0 && ((String) newValue).compareTo("DexbridgeWixel") != 0) { ======= if (((String) newValue).compareTo("BluetoothWixel") != 0 && ((String) newValue).compareTo("DexcomShare") != 0) { >>>>>>> if(((String) newValue).compareTo("BluetoothWixel") != 0 && ((String) newValue).compareTo("DexcomShare") != 0 && ((String) newValue).compareTo("DexbridgeWixel") != 0) { <<<<<<< if(((String) newValue).compareTo("WifiWixel") != 0) { ======= if (((String) newValue).compareTo("WifiWixel") != 0) { >>>>>>> if(((String) newValue).compareTo("WifiWixel") != 0) {
<<<<<<< ======= >>>>>>> <<<<<<< Log.d(TAG, "DexDrip Data Received!"); ======= >>>>>>>
<<<<<<< @Expose @Column(name = "check_in") public boolean check_in; @Expose @Column(name = "first_decay") public double first_decay; @Expose @Column(name = "second_decay") public double second_decay; @Expose @Column(name = "first_slope") public double first_slope; @Expose @Column(name = "second_slope") public double second_slope; @Expose @Column(name = "first_intercept") public double first_intercept; @Expose @Column(name = "second_intercept") public double second_intercept; @Expose @Column(name = "first_scale") public double first_scale; @Expose @Column(name = "second_scale") public double second_scale; ======= @Expose @Column(name = "possible_bad") public Boolean possible_bad; >>>>>>> @Expose @Column(name = "possible_bad") public Boolean possible_bad; @Expose @Column(name = "check_in") public boolean check_in; @Expose @Column(name = "first_decay") public double first_decay; @Expose @Column(name = "second_decay") public double second_decay; @Expose @Column(name = "first_slope") public double first_slope; @Expose @Column(name = "second_slope") public double second_slope; @Expose @Column(name = "first_intercept") public double first_intercept; @Expose @Column(name = "second_intercept") public double second_intercept; @Expose @Column(name = "first_scale") public double first_scale; @Expose @Column(name = "second_scale") public double second_scale; <<<<<<< public static Calibration last() { Sensor sensor = Sensor.currentSensor(); return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp desc") .executeSingle(); } public static Calibration first() { Sensor sensor = Sensor.currentSensor(); return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp asc") .executeSingle(); } public static double max() { Sensor sensor = Sensor.currentSensor(); Calibration calibration = new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 5))) .orderBy("bg desc") .executeSingle(); return calibration.bg; } public static double min() { Sensor sensor = Sensor.currentSensor(); Calibration calibration = new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 5))) .orderBy("bg asc") .executeSingle(); return calibration.bg; } public static List<Calibration> latest(int number) { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp desc") .limit(number) .execute(); } public static List<Calibration> allForSensor() { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .orderBy("timestamp desc") .execute(); } public static List<Calibration> allForSensorInLastFiveDays() { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 5))) .orderBy("timestamp desc") .execute(); } ======= >>>>>>> public static Calibration last() { Sensor sensor = Sensor.currentSensor(); return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp desc") .executeSingle(); } public static Calibration first() { Sensor sensor = Sensor.currentSensor(); return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp asc") .executeSingle(); } public static double max() { Sensor sensor = Sensor.currentSensor(); Calibration calibration = new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 5))) .orderBy("bg desc") .executeSingle(); return calibration.bg; } public static double min() { Sensor sensor = Sensor.currentSensor(); Calibration calibration = new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 5))) .orderBy("bg asc") .executeSingle(); return calibration.bg; } public static List<Calibration> latest(int number) { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .orderBy("timestamp desc") .limit(number) .execute(); } public static List<Calibration> allForSensor() { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .orderBy("timestamp desc") .execute(); } public static List<Calibration> allForSensorInLastFiveDays() { Sensor sensor = Sensor.currentSensor(); if (sensor == null) { return null; } return new Select() .from(Calibration.class) .where("Sensor = ? ", sensor.getId()) .where("slope_confidence != 0") .where("sensor_confidence != 0") .where("timestamp > ?", (new Date().getTime() - (60000 * 60 * 24 * 5))) .orderBy("timestamp desc") .execute(); }
<<<<<<< * A {@link RandomVolumeChooser} that limits its choices from a given set of options to the subset of those options preferred for a particular table. Defaults * to selecting from all of the options presented. Can be customized via the table property table.custom.preferredVolumes, which should contain a comma * separated list of {@link Volume} URIs. Note that both the property name and the format of its value are specific to this particular implementation. ======= * A {@link RandomVolumeChooser} that limits its choices from a given set of options to the subset * of those options preferred for a particular table. Defaults to selecting from all of the options * presented. Can be customized via the table property {@value #PREFERRED_VOLUMES_CUSTOM_KEY}, which * should contain a comma separated list of {@link Volume} URIs. Note that both the property name * and the format of its value are specific to this particular implementation. >>>>>>> * A {@link RandomVolumeChooser} that limits its choices from a given set of options to the subset * of those options preferred for a particular table. Defaults to selecting from all of the options * presented. Can be customized via the table property table.custom.preferredVolumes, which should * contain a comma separated list of {@link Volume} URIs. Note that both the property name and the * format of its value are specific to this particular implementation. <<<<<<< } private String[] getPreferredVolumesForTable(VolumeChooserEnvironment env, ServerConfigurationFactory confFactory, String[] options) { log.trace("Looking up property {} + for Table id: {}", TABLE_PREFERRED_VOLUMES, env.getTableId()); final TableConfiguration tableConf = confFactory.getTableConfiguration(env.getTableId()); String preferredVolumes = tableConf.get(TABLE_PREFERRED_VOLUMES); // fall back to global default scope, so setting only one default is necessary, rather than a separate default for TABLE scope than other scopes if (null == preferredVolumes || preferredVolumes.isEmpty()) { preferredVolumes = confFactory.getSystemConfiguration().get(DEFAULT_SCOPED_PREFERRED_VOLUMES); ======= TableConfiguration tableConf = localConf.getTableConfiguration(env.getTableId()); final Map<String,String> props = new HashMap<>(); tableConf.getProperties(props, PREFERRED_VOLUMES_FILTER); if (props.isEmpty()) { log.warn( "No preferred volumes specified. Defaulting to randomly choosing from instance volumes"); return super.choose(env, options); >>>>>>> } private String[] getPreferredVolumesForTable(VolumeChooserEnvironment env, ServerConfigurationFactory confFactory, String[] options) { log.trace("Looking up property {} + for Table id: {}", TABLE_PREFERRED_VOLUMES, env.getTableId()); final TableConfiguration tableConf = confFactory.getTableConfiguration(env.getTableId()); String preferredVolumes = tableConf.get(TABLE_PREFERRED_VOLUMES); // fall back to global default scope, so setting only one default is necessary, rather than a // separate default for TABLE scope than other scopes if (null == preferredVolumes || preferredVolumes.isEmpty()) { preferredVolumes = confFactory.getSystemConfiguration().get(DEFAULT_SCOPED_PREFERRED_VOLUMES); <<<<<<< return parsePreferred(TABLE_PREFERRED_VOLUMES, preferredVolumes, options); } private String[] getPreferredVolumesForScope(VolumeChooserEnvironment env, ServerConfigurationFactory confFactory, String[] options) { ChooserScope scope = env.getScope(); String property = getPropertyNameForScope(scope); log.trace("Looking up property {} for scope: {}", property, scope); AccumuloConfiguration systemConfiguration = confFactory.getSystemConfiguration(); String preferredVolumes = systemConfiguration.get(property); // fall back to global default scope if this scope isn't configured (and not already default scope) if ((null == preferredVolumes || preferredVolumes.isEmpty()) && scope != ChooserScope.DEFAULT) { log.debug("{} not found; using {}", property, DEFAULT_SCOPED_PREFERRED_VOLUMES); preferredVolumes = systemConfiguration.get(DEFAULT_SCOPED_PREFERRED_VOLUMES); // only if the custom property is not set to we fall back to the default scoped preferred volumes if (null == preferredVolumes || preferredVolumes.isEmpty()) { String msg = "Property " + property + " or " + DEFAULT_SCOPED_PREFERRED_VOLUMES + " must be a subset of " + Arrays.toString(options) + " to use the " + getClass().getSimpleName(); throw new VolumeChooserException(msg); } property = DEFAULT_SCOPED_PREFERRED_VOLUMES; ======= // If the preferred volumes property was specified, split the returned string by the comma and // add use it to filter the given options. Set<String> preferred = parsedPreferredVolumes.get(volumes); if (preferred == null) { preferred = new HashSet<>(Arrays.asList(StringUtils.split(volumes, ','))); parsedPreferredVolumes.put(volumes, preferred); >>>>>>> return parsePreferred(TABLE_PREFERRED_VOLUMES, preferredVolumes, options); } private String[] getPreferredVolumesForScope(VolumeChooserEnvironment env, ServerConfigurationFactory confFactory, String[] options) { ChooserScope scope = env.getScope(); String property = getPropertyNameForScope(scope); log.trace("Looking up property {} for scope: {}", property, scope); AccumuloConfiguration systemConfiguration = confFactory.getSystemConfiguration(); String preferredVolumes = systemConfiguration.get(property); // fall back to global default scope if this scope isn't configured (and not already default // scope) if ((null == preferredVolumes || preferredVolumes.isEmpty()) && scope != ChooserScope.DEFAULT) { log.debug("{} not found; using {}", property, DEFAULT_SCOPED_PREFERRED_VOLUMES); preferredVolumes = systemConfiguration.get(DEFAULT_SCOPED_PREFERRED_VOLUMES); // only if the custom property is not set to we fall back to the default scoped preferred // volumes if (null == preferredVolumes || preferredVolumes.isEmpty()) { String msg = "Property " + property + " or " + DEFAULT_SCOPED_PREFERRED_VOLUMES + " must be a subset of " + Arrays.toString(options) + " to use the " + getClass().getSimpleName(); throw new VolumeChooserException(msg); } property = DEFAULT_SCOPED_PREFERRED_VOLUMES; <<<<<<< Set<String> preferred = Arrays.stream(StringUtils.split(preferredVolumes, ',')).map(String::trim).collect(Collectors.toSet()); if (preferred.isEmpty()) { String msg = "No volumes could be parsed from '" + property + "', which had a value of '" + preferredVolumes + "'"; throw new VolumeChooserException(msg); } // preferred volumes should also exist in the original options (typically, from instance.volumes) Set<String> optionsList = Arrays.stream(options).collect(Collectors.toSet()); if (!preferred.stream().allMatch(optionsList::contains)) { String msg = "Some volumes in " + preferred + " are not valid volumes from " + optionsList; throw new VolumeChooserException(msg); ======= // If there are no preferred volumes left, then warn the user and choose randomly from the // instance volumes if (filteredOptions.isEmpty()) { log.warn( "Preferred volumes are not instance volumes. Defaulting to randomly choosing from instance volumes"); return super.choose(env, options); >>>>>>> Set<String> preferred = Arrays.stream(StringUtils.split(preferredVolumes, ',')) .map(String::trim).collect(Collectors.toSet()); if (preferred.isEmpty()) { String msg = "No volumes could be parsed from '" + property + "', which had a value of '" + preferredVolumes + "'"; throw new VolumeChooserException(msg); } // preferred volumes should also exist in the original options (typically, from // instance.volumes) Set<String> optionsList = Arrays.stream(options).collect(Collectors.toSet()); if (!preferred.stream().allMatch(optionsList::contains)) { String msg = "Some volumes in " + preferred + " are not valid volumes from " + optionsList; throw new VolumeChooserException(msg);
<<<<<<< public final class DcatAp11ToCkanVocabulary { ======= /** * * @author Klímek Jakub */ public class DcatAp11ToCkanVocabulary { >>>>>>> public class DcatAp11ToCkanVocabulary {
<<<<<<< private static class ErrorResponse { ======= private static final Logger LOG = LoggerFactory.getLogger(RestExceptionHandler.class); private static class RestException { >>>>>>> private static final Logger LOG = LoggerFactory.getLogger(RestExceptionHandler.class); private static class ErrorResponse { <<<<<<< public ErrorResponse(HttpStatus status, String message, String cause) { ======= @JsonInclude(JsonInclude.Include.NON_NULL) private String stackTrace; public RestException( HttpStatus status, String message, String cause, String stackTrace) { >>>>>>> @JsonInclude(JsonInclude.Include.NON_NULL) private String stackTrace; public ErrorResponse( HttpStatus status, String message, String cause, String stackTrace) { <<<<<<< ErrorResponse response = new ErrorResponse( ======= LOG.error("Missing entry.", ex); RestException response = new RestException( >>>>>>> LOG.error("Missing entry.", ex); ErrorResponse response = new ErrorResponse(
<<<<<<< import com.linkedpipes.etl.dataunit.core.files.FilesDataUnit; import com.linkedpipes.etl.dataunit.core.files.WritableFilesDataUnit; import com.linkedpipes.etl.dataunit.core.rdf.SingleGraphDataUnit; import com.linkedpipes.etl.executor.api.v1.LpException; import com.linkedpipes.etl.executor.api.v1.component.Component; import com.linkedpipes.etl.executor.api.v1.component.SequentialExecution; import com.linkedpipes.etl.executor.api.v1.service.ExceptionFactory; import com.linkedpipes.etl.executor.api.v1.service.ProgressReport; import net.sf.saxon.s9api.*; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.TupleQuery; import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.query.impl.SimpleDataset; ======= import com.linkedpipes.etl.component.api.Component; import com.linkedpipes.etl.component.api.service.ExceptionFactory; import com.linkedpipes.etl.component.api.service.ProgressReport; import com.linkedpipes.etl.dataunit.sesame.api.rdf.SingleGraphDataUnit; import com.linkedpipes.etl.dataunit.system.api.files.FilesDataUnit; import com.linkedpipes.etl.dataunit.system.api.files.WritableFilesDataUnit; import com.linkedpipes.etl.executor.api.v1.exception.LpException; import net.sf.saxon.s9api.SaxonApiException; import org.openrdf.query.BindingSet; import org.openrdf.query.QueryLanguage; import org.openrdf.query.TupleQuery; import org.openrdf.query.TupleQueryResult; import org.openrdf.query.impl.SimpleDataset; >>>>>>> import com.linkedpipes.etl.dataunit.core.files.FilesDataUnit; import com.linkedpipes.etl.dataunit.core.files.WritableFilesDataUnit; import com.linkedpipes.etl.dataunit.core.rdf.SingleGraphDataUnit; import com.linkedpipes.etl.executor.api.v1.LpException; import com.linkedpipes.etl.executor.api.v1.component.Component; import com.linkedpipes.etl.executor.api.v1.component.SequentialExecution; import com.linkedpipes.etl.executor.api.v1.service.ExceptionFactory; import com.linkedpipes.etl.executor.api.v1.service.ProgressReport; import net.sf.saxon.s9api.SaxonApiException; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.TupleQuery; import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.query.impl.SimpleDataset; <<<<<<< public final class Xslt implements Component, SequentialExecution { ======= public final class Xslt implements Component.Sequential { >>>>>>> public final class Xslt implements Component, SequentialExecution { <<<<<<< outputFile = outputFiles.createFile( nameMapping.get(entry.getFileName())); ======= payload.output = outputFiles.createFile( nameMapping.get(entry.getFileName())).toFile(); >>>>>>> outputFile = outputFiles.createFile( nameMapping.get(entry.getFileName())); nameMapping.get(entry.getFileName());
<<<<<<< @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.CREATE_CKAN_ORG) private boolean createCkanOrg; @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.DATASET_ID) ======= @RdfToPojo.Property(uri = DcatAp11ToCkanConfigVocabulary.DATASET_ID) >>>>>>> @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.DATASET_ID) <<<<<<< @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.ORG_ID) private String orgID; @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.LOAD_LANGUAGE) ======= @RdfToPojo.Property(uri = DcatAp11ToCkanConfigVocabulary.LOAD_LANGUAGE) >>>>>>> @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.LOAD_LANGUAGE) <<<<<<< @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.OVERWRITE) private boolean overwrite; ======= @RdfToPojo.Property(uri = DcatAp11ToCkanConfigVocabulary.PROFILE) private String profile ; >>>>>>> @RdfToPojo.Property(iri = DcatAp11ToCkanConfigVocabulary.PROFILE) private String profile;
<<<<<<< import org.openrdf.model.Value; import org.openrdf.query.AbstractTupleQueryResultHandler; import org.openrdf.query.Binding; import org.openrdf.query.BindingSet; import org.openrdf.query.TupleQueryResultHandlerException; import org.openrdf.repository.util.Repositories; ======= import org.openrdf.model.Value; import org.openrdf.query.Binding; import org.openrdf.query.QueryLanguage; import org.openrdf.query.TupleQuery; import org.openrdf.query.TupleQueryResult; import org.openrdf.query.impl.SimpleDataset; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; >>>>>>> import org.openrdf.model.Value; import org.openrdf.query.Binding; import org.openrdf.query.QueryLanguage; import org.openrdf.query.TupleQuery; import org.openrdf.query.TupleQueryResult; import org.openrdf.query.impl.SimpleDataset; <<<<<<< Repositories.tupleQuery(dataUnit.getRepository(), query, new AbstractTupleQueryResultHandler() { @Override public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException { final Map<String, Value> row = new HashMap<>(); for (Binding binding : bindingSet) { row.put(binding.getName(), binding.getValue()); } } }); ======= // Prepare dataset. final SimpleDataset dataset = new SimpleDataset(); dataset.addDefaultGraph(dataUnit.getGraph()); final TupleQuery tupleQuery = connection.prepareTupleQuery( QueryLanguage.SPARQL, query); tupleQuery.setDataset(dataset); final TupleQueryResult tupleResult = tupleQuery.evaluate(); while (tupleResult.hasNext()) { final Map<String, Value> row = new HashMap<>(); for (Binding binding : tupleResult.next()) { row.put(binding.getName(), binding.getValue()); } result.add(row); } >>>>>>> // Prepare dataset. final SimpleDataset dataset = new SimpleDataset(); dataset.addDefaultGraph(dataUnit.getGraph()); final TupleQuery tupleQuery = connection.prepareTupleQuery( QueryLanguage.SPARQL, query); tupleQuery.setDataset(dataset); final TupleQueryResult tupleResult = tupleQuery.evaluate(); while (tupleResult.hasNext()) { final Map<String, Value> row = new HashMap<>(); for (Binding binding : tupleResult.next()) { row.put(binding.getName(), binding.getValue()); } result.add(row); }
<<<<<<< else if (isOntologyURI(curToken)) { fadeOntologyURI(doc, tokenStartIndex, tokenLength, enclosedByBracket); } else if (curToken.equals("(")) { parenthesisRendered = true; } ======= else switch (curToken) { case " ": break; case "(": parenthesisRendered = true; break; case ")": break; case "[": break; case "]": break; case "{": break; case "}": break; case ",": break; case "\n": break; case "\t": break; case "'": break; default: // expensive test! if (isOntologyURI(curToken)) { fadeOntologyURI(doc, tokenStartIndex, tokenLength, enclosedByBracket); } } >>>>>>> else { switch (curToken) { case " ": break; case "(": parenthesisRendered = true; break; case ")": break; case "[": break; case "]": break; case "{": break; case "}": break; case ",": break; case "\n": break; case "\t": break; case "'": break; default: // expensive test! if (isOntologyURI(curToken)) { fadeOntologyURI(doc, tokenStartIndex, tokenLength, enclosedByBracket); } } }
<<<<<<< public static Table.ID checkTableId(Instance instance, String tableName, TableOperation operation) throws ThriftTableOperationException { ======= public static String checkTableId(Instance instance, String tableName, TableOperation operation) throws ThriftTableOperationException { >>>>>>> public static Table.ID checkTableId(Instance instance, String tableName, TableOperation operation) throws ThriftTableOperationException { <<<<<<< public static Namespace.ID checkNamespaceId(Instance instance, String namespaceName, TableOperation operation) throws ThriftTableOperationException { Namespace.ID namespaceId = Namespaces.lookupNamespaceId(instance, namespaceName); ======= public static String checkNamespaceId(Instance instance, String namespace, TableOperation operation) throws ThriftTableOperationException { String namespaceId = Namespaces.getNameToIdMap(instance).get(namespace); >>>>>>> public static Namespace.ID checkNamespaceId(Instance instance, String namespaceName, TableOperation operation) throws ThriftTableOperationException { Namespace.ID namespaceId = Namespaces.lookupNamespaceId(instance, namespaceName); <<<<<<< throw new ThriftTableOperationException(null, namespaceName, operation, TableOperationExceptionType.NAMESPACE_NOTFOUND, null); ======= throw new ThriftTableOperationException(null, namespace, operation, TableOperationExceptionType.NAMESPACE_NOTFOUND, null); >>>>>>> throw new ThriftTableOperationException(null, namespaceName, operation, TableOperationExceptionType.NAMESPACE_NOTFOUND, null); <<<<<<< public void grantTablePermission(TInfo tinfo, TCredentials credentials, String user, String tableName, byte permission) throws TException { Table.ID tableId = checkTableId(instance, tableName, TableOperation.PERMISSION); Namespace.ID namespaceId; ======= public void grantTablePermission(TInfo tinfo, TCredentials credentials, String user, String tableName, byte permission) throws TException { String tableId = checkTableId(instance, tableName, TableOperation.PERMISSION); String namespaceId; >>>>>>> public void grantTablePermission(TInfo tinfo, TCredentials credentials, String user, String tableName, byte permission) throws TException { Table.ID tableId = checkTableId(instance, tableName, TableOperation.PERMISSION); Namespace.ID namespaceId; <<<<<<< public void grantNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String ns, byte permission) throws ThriftSecurityException, ThriftTableOperationException { Namespace.ID namespaceId = checkNamespaceId(instance, ns, TableOperation.PERMISSION); security.grantNamespacePermission(credentials, user, namespaceId, NamespacePermission.getPermissionById(permission)); ======= public void grantNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String ns, byte permission) throws ThriftSecurityException, ThriftTableOperationException { String namespaceId = checkNamespaceId(instance, ns, TableOperation.PERMISSION); security.grantNamespacePermission(credentials, user, namespaceId, NamespacePermission.getPermissionById(permission)); >>>>>>> public void grantNamespacePermission(TInfo tinfo, TCredentials credentials, String user, String ns, byte permission) throws ThriftSecurityException, ThriftTableOperationException { Namespace.ID namespaceId = checkNamespaceId(instance, ns, TableOperation.PERMISSION); security.grantNamespacePermission(credentials, user, namespaceId, NamespacePermission.getPermissionById(permission)); <<<<<<< public void revokeTablePermission(TInfo tinfo, TCredentials credentials, String user, String tableName, byte permission) throws TException { Table.ID tableId = checkTableId(instance, tableName, TableOperation.PERMISSION); Namespace.ID namespaceId; ======= public void revokeTablePermission(TInfo tinfo, TCredentials credentials, String user, String tableName, byte permission) throws TException { String tableId = checkTableId(instance, tableName, TableOperation.PERMISSION); String namespaceId; >>>>>>> public void revokeTablePermission(TInfo tinfo, TCredentials credentials, String user, String tableName, byte permission) throws TException { Table.ID tableId = checkTableId(instance, tableName, TableOperation.PERMISSION); Namespace.ID namespaceId; <<<<<<< public Map<String,String> getTableConfiguration(TInfo tinfo, TCredentials credentials, String tableName) throws TException, ThriftTableOperationException { Table.ID tableId = checkTableId(instance, tableName, null); AccumuloConfiguration config = context.getServerConfigurationFactory().getTableConfiguration(tableId); ======= public Map<String,String> getTableConfiguration(TInfo tinfo, TCredentials credentials, String tableName) throws TException, ThriftTableOperationException { String tableId = checkTableId(instance, tableName, null); AccumuloConfiguration config = context.getServerConfigurationFactory() .getTableConfiguration(tableId); >>>>>>> public Map<String,String> getTableConfiguration(TInfo tinfo, TCredentials credentials, String tableName) throws TException, ThriftTableOperationException { Table.ID tableId = checkTableId(instance, tableName, null); AccumuloConfiguration config = context.getServerConfigurationFactory() .getTableConfiguration(tableId); <<<<<<< log.debug("Got request to bulk import files to table({}): {}", tableId, files); return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() { @Override public List<String> call() throws Exception { bulkImportStatus.updateBulkImportStatus(files, BulkImportState.PROCESSING); try { return BulkImporter.bulkLoad(context, tid, tableId, files, errorDir, setTime); } finally { bulkImportStatus.removeBulkImportStatus(files); } } }); ======= log.debug("Got request to bulk import files to table(" + tableId + "): " + files); return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() { @Override public List<String> call() throws Exception { bulkImportStatus.updateBulkImportStatus(files, BulkImportState.PROCESSING); try { return BulkImporter.bulkLoad(context, tid, tableId, files, errorDir, setTime); } finally { bulkImportStatus.removeBulkImportStatus(files); } } }); >>>>>>> log.debug("Got request to bulk import files to table({}): {}", tableId, files); return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() { @Override public List<String> call() throws Exception { bulkImportStatus.updateBulkImportStatus(files, BulkImportState.PROCESSING); try { return BulkImporter.bulkLoad(context, tid, tableId, files, errorDir, setTime); } finally { bulkImportStatus.removeBulkImportStatus(files); } } }); <<<<<<< Map<TreeSet<String>,Long> diskUsage = TableDiskUsage.getDiskUsage(tableIds, fs, context.getConnector()); ======= Map<TreeSet<String>,Long> diskUsage = TableDiskUsage.getDiskUsage( context.getServerConfigurationFactory().getConfiguration(), tableIds, fs, context.getConnector()); >>>>>>> Map<TreeSet<String>,Long> diskUsage = TableDiskUsage.getDiskUsage(tableIds, fs, context.getConnector()); <<<<<<< public Map<String,String> getNamespaceConfiguration(TInfo tinfo, TCredentials credentials, String ns) throws ThriftTableOperationException, TException { Namespace.ID namespaceId; ======= public Map<String,String> getNamespaceConfiguration(TInfo tinfo, TCredentials credentials, String ns) throws ThriftTableOperationException, TException { String namespaceId; >>>>>>> public Map<String,String> getNamespaceConfiguration(TInfo tinfo, TCredentials credentials, String ns) throws ThriftTableOperationException, TException { Namespace.ID namespaceId;
<<<<<<< /** Install a SSL socket factory which will trust all certificates. * This is generally considered dangerous as you won't know if you are really talking to the server you think you are talking to. * This is like your best friend using his Facebook account in an Apple store and forgetting to log out. * * This method should be called once and replaces the SSL factory for ALL HttpsURLConnections. */ public static void ignoreAllCerts() { TrustManager trm = new X509TrustManager() { public void checkClientTrusted(X509Certificate[] certs, String authType) {} public void checkServerTrusted(X509Certificate[] certs, String authType) {} public X509Certificate[] getAcceptedIssuers() { return null; } }; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); sc.init(null, new TrustManager[] { trm }, null); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (KeyManagementException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } } ======= public void setProxy(String proxyhost, int proxyport) { proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyhost, proxyport)); } >>>>>>> /** Install a SSL socket factory which will trust all certificates. * This is generally considered dangerous as you won't know if you are really talking to the server you think you are talking to. * This is like your best friend using his Facebook account in an Apple store and forgetting to log out. * * This method should be called once and replaces the SSL factory for ALL HttpsURLConnections. */ public static void ignoreAllCerts() { TrustManager trm = new X509TrustManager() { public void checkClientTrusted(X509Certificate[] certs, String authType) {} public void checkServerTrusted(X509Certificate[] certs, String authType) {} public X509Certificate[] getAcceptedIssuers() { return null; } }; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); sc.init(null, new TrustManager[] { trm }, null); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (KeyManagementException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } } public void setProxy(String proxyhost, int proxyport) { proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyhost, proxyport)); }
<<<<<<< Character.valueOf('G'), BuildCraftCore.goldGearItem, Character.valueOf('g'), Blocks.glass, ======= Character.valueOf('G'), "gearGold", Character.valueOf('g'), Block.glass, >>>>>>> Character.valueOf('G'), "gearGold", Character.valueOf('g'), Blocks.glass, <<<<<<< Character.valueOf('G'), BuildCraftCore.goldGearItem, Character.valueOf('r'), Items.redstone ======= Character.valueOf('G'), "gearGold", Character.valueOf('r'), Item.redstone >>>>>>> Character.valueOf('G'), "gearGold", Character.valueOf('r'), Items.redstone <<<<<<< Character.valueOf('S'), BuildCraftCore.stoneGearItem, Character.valueOf('r'), Items.redstone ======= Character.valueOf('S'), "gearStone", Character.valueOf('r'), Item.redstone >>>>>>> Character.valueOf('S'), "gearStone", Character.valueOf('r'), Items.redstone <<<<<<< Character.valueOf('U'), BuildCraftCore.diamondGearItem, Character.valueOf('r'), Items.redstone ======= Character.valueOf('U'), "gearDiamond", Character.valueOf('r'), Item.redstone >>>>>>> Character.valueOf('U'), "gearDiamond", Character.valueOf('r'), Items.redstone <<<<<<< Character.valueOf('U'), BuildCraftCore.goldGearItem, Character.valueOf('r'), Items.redstone ======= Character.valueOf('U'), "gearGold", Character.valueOf('r'), Item.redstone >>>>>>> Character.valueOf('U'), "gearGold", Character.valueOf('r'), Items.redstone <<<<<<< Character.valueOf('G'), BuildCraftCore.ironGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearIron", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearIron", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('G'), BuildCraftCore.ironGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearIron", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearIron", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('G'), BuildCraftCore.ironGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearIron", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearIron", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('G'), BuildCraftCore.ironGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearIron", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearIron", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('G'), BuildCraftCore.diamondGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearDiamond", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearDiamond", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('G'), BuildCraftCore.ironGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearIron", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearIron", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('G'), BuildCraftCore.goldGearItem, Character.valueOf('r'), Items.redstone, ======= Character.valueOf('G'), "gearGold", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('G'), "gearGold", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('g'), Items.gold_ingot, Character.valueOf('G'), BuildCraftCore.goldGearItem ======= Character.valueOf('g'), Item.ingotGold, Character.valueOf('G'), "gearGold" >>>>>>> Character.valueOf('g'), Items.gold_ingot, Character.valueOf('G'), "gearGold" <<<<<<< Character.valueOf('g'), Blocks.glass, Character.valueOf('D'), BuildCraftCore.diamondGearItem ======= Character.valueOf('g'), Block.glass, Character.valueOf('D'), "gearDiamond" >>>>>>> Character.valueOf('g'), Blocks.glass, Character.valueOf('D'), "gearDiamond" <<<<<<< Character.valueOf('G'), BuildCraftCore.goldGearItem, Character.valueOf('S'), Items.sign, Character.valueOf('D'), BuildCraftCore.diamondGearItem ======= Character.valueOf('G'), "gearGold", Character.valueOf('S'), Item.sign, Character.valueOf('D'), "gearDiamond" >>>>>>> Character.valueOf('G'), "gearGold", Character.valueOf('S'), Items.sign, Character.valueOf('D'), "gearDiamond" <<<<<<< Character.valueOf('D'), new ItemStack(BuildCraftCore.diamondGearItem, 1), Character.valueOf('r'), Items.redstone, ======= Character.valueOf('D'), "gearDiamond", Character.valueOf('r'), Item.redstone, >>>>>>> Character.valueOf('D'), "gearDiamond", Character.valueOf('r'), Items.redstone, <<<<<<< Character.valueOf('C'), Blocks.crafting_table, Character.valueOf('S'), Blocks.chest, Character.valueOf('G'), BuildCraftCore.stoneGearItem ======= Character.valueOf('C'), Block.workbench, Character.valueOf('S'), Block.chest, Character.valueOf('G'), "gearStone" >>>>>>> Character.valueOf('C'), Blocks.crafting_table, Character.valueOf('S'), Blocks.chest, Character.valueOf('G'), "gearStone" <<<<<<< Character.valueOf('R'), Items.redstone, Character.valueOf('g'), BuildCraftCore.woodenGearItem, ======= Character.valueOf('R'), Item.redstone, Character.valueOf('g'), "gearWood" >>>>>>> Character.valueOf('R'), Items.redstone, Character.valueOf('g'), "gearWood"
<<<<<<< import lombok.SneakyThrows; ======= >>>>>>> <<<<<<< ======= import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import buildcraft.BuildCraftEnergy; import buildcraft.BuildCraftSilicon; import buildcraft.BuildCraftTransport; import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.core.BCLog; import buildcraft.api.robots.RobotManager; import buildcraft.api.statements.IActionInternal; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; import buildcraft.api.statements.StatementManager; import buildcraft.api.transport.IPipeConnection; import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.IPipeTile.PipeType; import buildcraft.core.ITileBufferHolder; import buildcraft.core.ItemMapLocation; import buildcraft.transport.BlockGenericPipe; import buildcraft.transport.ItemGateCopier; import buildcraft.transport.ItemPipe; import buildcraft.transport.Pipe; import buildcraft.transport.PipeTransportItems; import buildcraft.transport.TileGenericPipe; import buildcraft.transport.render.FacadeRenderHelper; import buildcraft.transport.render.FakeBlock; import buildcraft.transport.render.PipeRendererTESR; import buildcraft.transport.render.PipeRendererWorld; import lombok.SneakyThrows; >>>>>>> import cpw.mods.fml.common.FMLCommonHandler; import buildcraft.BuildCraftCore; import buildcraft.BuildCraftSilicon; import buildcraft.BuildCraftTransport; import buildcraft.api.boards.RedstoneBoardRegistry; import buildcraft.api.boards.RedstoneBoardRobotNBT; import buildcraft.api.core.BCLog; import buildcraft.api.events.RobotPlacementEvent; import buildcraft.api.robots.DockingStation; import buildcraft.api.robots.RobotManager; import buildcraft.api.statements.IActionInternal; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; import buildcraft.api.statements.StatementManager; import buildcraft.api.transport.IPipeConnection; import buildcraft.api.transport.IPipeTile; import buildcraft.api.transport.IPipeTile.PipeType; import buildcraft.core.ItemMapLocation; import buildcraft.core.lib.ITileBufferHolder; import buildcraft.robotics.EntityRobot; import buildcraft.robotics.ItemRobot; import buildcraft.robotics.RobotStationPluggable; import buildcraft.transport.BlockGenericPipe; import buildcraft.transport.ItemGateCopier; import buildcraft.transport.ItemPipe; import buildcraft.transport.Pipe; import buildcraft.transport.PipeEventBus; import buildcraft.transport.PipeTransportItems; import buildcraft.transport.TileGenericPipe; import buildcraft.transport.render.PipeRendererTESR; import lombok.SneakyThrows; <<<<<<< if(BCVersion != null && !BCVersion.equals("@VERSION@")) { if(!BCVersion.startsWith("7.")) { throw new VersionNotSupportedException("BC", BCVersion, "7.0.0", ""); ======= if (BCVersion != null && !BCVersion.equals("@VERSION@")) { if (!BCVersion.startsWith("6.") || BCVersion.startsWith("6.0") || BCVersion.startsWith("6.1") || BCVersion.startsWith("6.2") || BCVersion.startsWith("6.3")) { throw new VersionNotSupportedException("BC", BCVersion, "6.4.0", ""); >>>>>>> if (BCVersion != null && !BCVersion.equals("@VERSION@")) { if (!BCVersion.startsWith("7.")) { throw new VersionNotSupportedException("BC", BCVersion, "7.0.0", ""); <<<<<<< ======= @SneakyThrows({ SecurityException.class, IllegalAccessException.class, IllegalArgumentException.class, NoSuchFieldException.class }) >>>>>>> <<<<<<< boolean result = BuildCraftTransport.genericPipeBlock.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset); ======= Object trace = BuildCraftTransport.genericPipeBlock.doRayTrace(world, x, y, z, player); String type = "null"; if (trace != null) { Enum<?> hitPart = ReflectionHelper.getPrivateField(Enum.class, trace.getClass(), "hitPart", trace); if (hitPart != null) { type = hitPart.name(); } } if ("Pluggable".equals(type)) { pipe.container.tilePart.disablePluggableAccess(); } final boolean result = BuildCraftTransport.genericPipeBlock.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset); if ("Pluggable".equals(type)) { pipe.container.tilePart.reenablePluggableAccess(); } >>>>>>> boolean result = BuildCraftTransport.genericPipeBlock.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset); <<<<<<< ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, PipeRendererTESR.INSTANCE, "renderGatesWires", new Class[]{TileGenericPipe.class, double.class, double.class, double.class}, new Object[]{tgPipe, x, y, z}); ======= ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, renderer, "renderGatesWires", new Class[] { TileGenericPipe.class, double.class, double.class, double.class }, new Object[] { tgPipe, x, y, z }); >>>>>>> ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, PipeRendererTESR.INSTANCE, "renderGatesWires", new Class[] { TileGenericPipe.class, double.class, double.class, double.class }, new Object[] { tgPipe, x, y, z }); <<<<<<< ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, PipeRendererTESR.INSTANCE, "renderPluggables", new Class[]{TileGenericPipe.class, double.class, double.class, double.class}, new Object[]{tgPipe, x, y, z}); ======= ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, renderer, "renderGates", new Class[] { TileGenericPipe.class, double.class, double.class, double.class }, new Object[] { tgPipe, x, y, z }); >>>>>>> ReflectionHelper.invokePrivateMethod(Object.class, PipeRendererTESR.class, PipeRendererTESR.INSTANCE, "renderPluggables", new Class[] { TileGenericPipe.class, double.class, double.class, double.class }, new Object[] { tgPipe, x, y, z });
<<<<<<< public void enabledUpdateEntity() { ======= public void updateEntity() { super.updateEntity(); if(MainProxy.isClient()) return; if(inv.isEmpty()) return; >>>>>>> public void enabledUpdateEntity() { if(inv.isEmpty()) return;
<<<<<<< import net.minecraft.init.Blocks; ======= import logisticspipes.interfaces.routing.IAdditionalTargetInformation; >>>>>>> import logisticspipes.interfaces.routing.IAdditionalTargetInformation; <<<<<<< RequestTree tree = new RequestTree(new ItemIdentifierStack(ItemIdentifier.get(Blocks.stone, 0, null), 0), requester, null, requestFlags); ======= RequestTree tree = new RequestTree(new ItemIdentifierStack(ItemIdentifier.get(1,0,null), 0), requester, null, requestFlags, info); >>>>>>> RequestTree tree = new RequestTree(new ItemIdentifierStack(ItemIdentifier.get(Blocks.stone, 0, null), 0), requester, null, requestFlags, info);
<<<<<<< import java.io.IOException; import logisticspipes.network.LPDataInputStream; import logisticspipes.network.LPDataOutputStream; import net.minecraft.util.EnumFacing; ======= import net.minecraftforge.common.util.ForgeDirection; >>>>>>> import net.minecraft.util.EnumFacing;
<<<<<<< import logisticspipes.hud.HUDConfig; ======= import logisticspipes.interfaces.IHUDConfig; import logisticspipes.logic.BaseLogicCrafting; >>>>>>> import logisticspipes.interfaces.IHUDConfig; <<<<<<< public boolean display(HUDConfig config) { return config.isHUDCrafting() && ((pipe.getCraftingSigns().isEmpty() && pipe.getCraftedItems() != null) || pipe.displayList.size() > 0); ======= public boolean display(IHUDConfig config) { return config.isHUDCrafting() && ((pipe.getCraftingSigns().isEmpty() && ((BaseLogicCrafting)pipe.logic).getCraftedItems() != null) || pipe.displayList.size() > 0); >>>>>>> public boolean display(IHUDConfig config) { return config.isHUDCrafting() && ((pipe.getCraftingSigns().isEmpty() && pipe.getCraftedItems() != null) || pipe.displayList.size() > 0);
<<<<<<< Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(tableName)); Assert.assertNotNull("Table ID was null", tableId); ======= String tableId = conn.tableOperations().tableIdMap().get(tableName); assertNotNull("Table ID was null", tableId); >>>>>>> Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(tableName)); assertNotNull("Table ID was null", tableId); <<<<<<< try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) { Assert.assertEquals(0, Iterables.size(s)); } ======= Scanner s = conn.createScanner(tableName, Authorizations.EMPTY); assertEquals(0, Iterables.size(s)); >>>>>>> try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) { assertEquals(0, Iterables.size(s)); } <<<<<<< Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(tableName)); Assert.assertNotNull("Table ID was null", tableId); ======= String tableId = conn.tableOperations().tableIdMap().get(tableName); assertNotNull("Table ID was null", tableId); >>>>>>> Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(tableName)); assertNotNull("Table ID was null", tableId); <<<<<<< try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) { Assert.assertEquals(0, Iterables.size(s)); } ======= Scanner s = conn.createScanner(tableName, Authorizations.EMPTY); assertEquals(0, Iterables.size(s)); >>>>>>> try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) { assertEquals(0, Iterables.size(s)); }
<<<<<<< LogisticsTileGenericPipe pipe = ((LogisticsTileGenericPipe)tileentity); if(pipe.pipe == null) return; if(config.getRenderPipeContentDistance() * config.getRenderPipeContentDistance() < distance) return; ======= >>>>>>> <<<<<<< // dynamically render pluggables (like gates) bcRenderer.dynamicRenderPluggables(pipe, x, y, z); if(!pipe.isOpaque()) { if(pipe.pipe.transport instanceof PipeFluidTransportLogistics) { ======= bcRenderer.renderGates(pipe, x, y, z); if (!pipe.isOpaque()) { if (pipe.pipe.transport instanceof PipeFluidTransportLogistics) { >>>>>>> // dynamically render pluggables (like gates) bcRenderer.dynamicRenderPluggables(pipe, x, y, z); if (!pipe.isOpaque()) { if (pipe.pipe.transport instanceof PipeFluidTransportLogistics) {
<<<<<<< boolean fuzzyFlagsChanged = false; WorldCoordinatesWrapper worldCoordinates = new WorldCoordinatesWrapper(getWorld(), getX(), getY(), getZ()); for (AdjacentTileEntity adjacent : worldCoordinates.getConnectedAdjacentTileEntities(ConnectionPipeType.ITEM).collect(Collectors.toList())) { ======= final WorldUtil worldUtil = new WorldUtil(getWorld(), getX(), getY(), getZ()); for (final AdjacentTile tile : worldUtil.getAdjacentTileEntities(true)) { >>>>>>> WorldCoordinatesWrapper worldCoordinates = new WorldCoordinatesWrapper(getWorld(), getX(), getY(), getZ()); for (AdjacentTileEntity adjacent : worldCoordinates.getConnectedAdjacentTileEntities(ConnectionPipeType.ITEM).collect(Collectors.toList())) { <<<<<<< fuzzyFlagsChanged = ((IFuzzyRecipeProvider) provider).importFuzzyFlags(adjacent.tileEntity, _dummyInventory, fuzzyCraftingFlagArray); ======= ((IFuzzyRecipeProvider) provider).importFuzzyFlags(tile.tile, _dummyInventory, fuzzyCraftingFlagArray, outputFuzzyFlags); >>>>>>> ((IFuzzyRecipeProvider) provider).importFuzzyFlags(adjacent.tileEntity, _dummyInventory, fuzzyCraftingFlagArray, outputFuzzyFlags); <<<<<<< AdjacentTileEntity adjacent = null; for (AdjacentTileEntity adjacentCrafter : adjacentCrafters) { adjacent = adjacentCrafter; extracted = extract(adjacent, nextOrder.getItemStack().getItem(), maxtosend); ======= AdjacentTile tile = null; for (Iterator<AdjacentTile> it = crafters.iterator(); it.hasNext();) { tile = it.next(); extracted = extract(tile, nextOrder.getResource().getItem(), maxtosend); >>>>>>> AdjacentTileEntity adjacent = null; for (AdjacentTileEntity adjacentCrafter : adjacentCrafters) { adjacent = adjacentCrafter; extracted = extract(adjacent, nextOrder.getResource().getItem(), maxtosend);
<<<<<<< import logisticspipes.hud.HUDConfig; ======= import logisticspipes.interfaces.IHUDConfig; import logisticspipes.logic.BaseLogicLiquidSatellite; import logisticspipes.logic.BaseLogicSatellite; >>>>>>> import logisticspipes.interfaces.IHUDConfig;
<<<<<<< import logisticspipes.api.IRoutedPowerProvider; ======= import logisticspipes.LogisticsPipes; >>>>>>> <<<<<<< IInventoryUtil targetUtil = _invProvider.getSneakyInventory(extractOrientation,true); ======= IInventoryUtil targetUtil = _service.getSneakyInventory(extractOrientation,true); if (realInventory instanceof ISpecialInventory && !targetUtil.isSpecialInventory()){ ItemStack[] stack = ((ISpecialInventory) realInventory).extractItem(false, extractOrientation, 1); if (stack == null || stack.length < 1 || stack[0] == null || stack[0].stackSize == 0) return; Pair<Integer, SinkReply> reply = _service.hasDestination(ItemIdentifier.get(stack[0]), true, new ArrayList<Integer>()); if (reply == null) return; ItemStack[] stacks = ((ISpecialInventory) realInventory).extractItem(true, extractOrientation, 1); if (stacks == null || stacks.length < 1 || stacks[0] == null || stacks[0].stackSize == 0) { LogisticsPipes.log.info("extractor extractItem(true) got nothing from " + ((Object)realInventory).toString()); return; } if(!ItemStack.areItemStacksEqual(stack[0], stacks[0])) { LogisticsPipes.log.info("extractor extract got a unexpected item from " + ((Object)realInventory).toString()); } _service.sendStack(stacks[0], reply, itemSendMode()); return; } >>>>>>> IInventoryUtil targetUtil = _service.getSneakyInventory(extractOrientation,true);
<<<<<<< if(MainProxy.isClient(getWorld())) return false; ======= return useEnergy(amount, providersToIgnore, false); } private boolean useEnergy(int amount, List<Object> providersToIgnore, boolean sparkles) { if(MainProxy.isClient(worldObj)) return false; >>>>>>> return useEnergy(amount, providersToIgnore, false); } private boolean useEnergy(int amount, List<Object> providersToIgnore, boolean sparkles) { if(MainProxy.isClient(getWorld())) return false; <<<<<<< MainProxy.sendSpawnParticlePacket(Particles.GoldParticle, this.getX(), this.getY(), this.getZ(), this.getWorld(), particlecount); ======= >>>>>>> <<<<<<< public TravelingItem getQueuedForItemStack(ItemStack stack) { for(TravelingItem item:queuedDataForUnroutedItems) { if(ItemIdentifierStack.GetFromStack(item.getItemStack()).equals(ItemIdentifierStack.GetFromStack(stack))) { queuedDataForUnroutedItems.remove(item); return item; ======= public IPipedItem getQueuedForEntityData(EntityData data) { ItemStack stack = data.item.getItemStack(); for(IPipedItem queued:queuedDataForUnroutedItems) { if(ItemIdentifierStack.GetFromStack(queued.getItemStack()).equals(ItemIdentifierStack.GetFromStack(stack))) { queuedDataForUnroutedItems.remove(queued); return queued; >>>>>>> public TravelingItem getQueuedForItemStack(ItemStack stack) { ItemStack stack = data.item.getItemStack(); for(TravelingItem queued:queuedDataForUnroutedItems) { if(ItemIdentifierStack.GetFromStack(queued.getItemStack()).equals(ItemIdentifierStack.GetFromStack(stack))) { queuedDataForUnroutedItems.remove(queued); return queued;
<<<<<<< import buildcraft.transport.Pipe; import logisticspipes.pipes.PipeItemsCraftingLogistics; ======= import logisticspipes.pipes.basic.CoreRoutedPipe; >>>>>>> import logisticspipes.pipes.basic.CoreRoutedPipe; import buildcraft.transport.Pipe; import logisticspipes.pipes.PipeItemsCraftingLogistics; <<<<<<< public void func_147500_a(TileEntity tileentity, double x, double y, double z, float f) { super.func_147500_a(tileentity, x, y, z, f); if (BuildCraftCore.render == RenderMode.NoDynamic) return; ======= public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { enableRendering(tileentity); super.renderTileEntityAt(tileentity, x, y, z, f); // Render Gates And Wires disableRendering(tileentity); >>>>>>> public void func_147500_a(TileEntity tileentity, double x, double y, double z, float f) { enableRendering(tileentity); super.func_147500_a(tileentity, x, y, z, f); <<<<<<< private void renderCraftingPipe(PipeItemsCraftingLogistics pipe, double x, double y, double z) { if(!pipe.getCraftingSigns().isEmpty()) { List<ForgeDirection> list = pipe.getCraftingSigns(); for(ForgeDirection dir:list) { if(pipe.container.renderState.pipeConnectionMatrix.isConnected(dir)) { ======= private void renderPipePipe(CoreRoutedPipe pipe, double x, double y, double z) { if(!pipe.getPipeSigns().isEmpty()) { List<Pair<ForgeDirection, IPipeSign>> list = pipe.getPipeSigns(); for(Pair<ForgeDirection, IPipeSign> pair: list) { if(pipe.container.getRenderState().pipeConnectionMatrix.isConnected(pair.getValue1())) { >>>>>>> private void renderPipePipe(CoreRoutedPipe pipe, double x, double y, double z) { if(!pipe.getPipeSigns().isEmpty()) { List<Pair<ForgeDirection, IPipeSign>> list = pipe.getPipeSigns(); for(Pair<ForgeDirection, IPipeSign> pair: list) { if(pipe.container.getRenderState().pipeConnectionMatrix.isConnected(pair.getValue1())) { <<<<<<< if (fluidStack != null && fluidStack.amount > 0) { DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj()); if (d == null) { ======= if(fluidStack != null && fluidStack.amount > 0) { DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.worldObj); if(d == null) { >>>>>>> if(fluidStack != null && fluidStack.amount > 0) { DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj()); if(d == null) { <<<<<<< if (fluidStack != null && fluidStack.amount > 0) { DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj()); if (d != null) { //XXX int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1)); int stage = (int) ((float) fluidStack.amount / (float) (trans.getInnerCapacity()) * (LIQUID_STAGES - 1)); ======= if(fluidStack != null && fluidStack.amount > 0) { DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.worldObj); if(d != null) { // XXX int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1)); int stage = (int)((float)fluidStack.amount / (float)(trans.getInnerCapacity()) * (LIQUID_STAGES - 1)); >>>>>>> if(fluidStack != null && fluidStack.amount > 0) { DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj()); if(d != null) { // XXX int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1)); int stage = (int)((float)fluidStack.amount / (float)(trans.getInnerCapacity()) * (LIQUID_STAGES - 1)); <<<<<<< block.baseBlock = fluid.getBlock(); ======= if(fluid.getBlockID() > 0) { block.baseBlock = Block.blocksList[fluid.getBlockID()]; } else { block.baseBlock = Block.waterStill; } >>>>>>> block.baseBlock = fluid.getBlock();
<<<<<<< player.sendChatToPlayer(ChatMessageComponent.func_111066_d("No Target Found")); ======= player.sendChatToPlayer(ChatColor.RED + "No Target Found"); >>>>>>> player.sendChatToPlayer(ChatMessageComponent.func_111066_d(ChatColor.RED + "No Target Found")); <<<<<<< player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Found Block with Id: " + id)); TileEntity tile = player.worldObj.getBlockTileEntity(x, y, z); ======= player.sendChatToPlayer("Found Block with Id: " + id); final TileEntity tile = player.worldObj.getBlockTileEntity(x, y, z); >>>>>>> player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Found Block with Id: " + id)); final TileEntity tile = player.worldObj.getBlockTileEntity(x, y, z);
<<<<<<< SimpleServiceLocator.setToolWrenchProxy(getWrappedProxy("!IToolWrench", IToolWrenchProxy.class, ToolWrenchProxy.class, new IToolWrenchProxy() { @Override public void wrenchUsed(EntityPlayer entityplayer, int x, int y, int z) {} @Override public boolean isWrenchEquipped(EntityPlayer entityplayer) {return false;} @Override public boolean canWrench(EntityPlayer entityplayer, int x, int y, int z) {return false;} })); ======= SimpleServiceLocator.setOpenComputersProxy(getWrappedProxy("[email protected]", IOpenComputersProxy.class, OpenComputersProxy.class, new IOpenComputersProxy() { @Override public void initLogisticsTileGenericPipe(LogisticsTileGenericPipe tile) {} @Override public void handleLPWriteToNBT(LogisticsTileGenericPipe tile, NBTTagCompound nbt) {} @Override public void handleLPReadFromNBT(LogisticsTileGenericPipe tile, NBTTagCompound nbt) {} @Override public void handleLPInvalidate(LogisticsTileGenericPipe tile) {} @Override public void handleLPChunkUnload(LogisticsTileGenericPipe tile) {} @Override public void addToNetwork(LogisticsTileGenericPipe tile) {} })); >>>>>>> SimpleServiceLocator.setOpenComputersProxy(getWrappedProxy("[email protected]", IOpenComputersProxy.class, OpenComputersProxy.class, new IOpenComputersProxy() { @Override public void initLogisticsTileGenericPipe(LogisticsTileGenericPipe tile) {} @Override public void handleLPWriteToNBT(LogisticsTileGenericPipe tile, NBTTagCompound nbt) {} @Override public void handleLPReadFromNBT(LogisticsTileGenericPipe tile, NBTTagCompound nbt) {} @Override public void handleLPInvalidate(LogisticsTileGenericPipe tile) {} @Override public void handleLPChunkUnload(LogisticsTileGenericPipe tile) {} @Override public void addToNetwork(LogisticsTileGenericPipe tile) {} })); SimpleServiceLocator.setToolWrenchProxy(getWrappedProxy("!IToolWrench", IToolWrenchProxy.class, ToolWrenchProxy.class, new IToolWrenchProxy() { @Override public void wrenchUsed(EntityPlayer entityplayer, int x, int y, int z) {} @Override public boolean isWrenchEquipped(EntityPlayer entityplayer) {return false;} @Override public boolean canWrench(EntityPlayer entityplayer, int x, int y, int z) {return false;} }));
<<<<<<< public void doRenderItem(ItemStack itemstack, float light, double x, double y, double z, double boxScale, double yaw, double pitch) { ======= public void doRenderItem(ItemStack itemstack, float light, double x, double y, double z, double boxScale) { if(LogisticsNewRenderPipe.innerTransportBox == null) return; >>>>>>> public void doRenderItem(ItemStack itemstack, float light, double x, double y, double z, double boxScale, double yaw, double pitch) { if(LogisticsNewRenderPipe.innerTransportBox == null) return;
<<<<<<< private static final IIcon[] icons = new IIcon[16]; ======= private static final Icon[] icons = new Icon[17]; >>>>>>> private static final IIcon[] icons = new IIcon[17]; <<<<<<< public void registerIcons(IIconRegister par1IIconRegister) { for(int i=0;i<16;i++) { icons[i]=par1IIconRegister.registerIcon("logisticspipes:lpsolidblock/"+i); ======= public void registerIcons(IconRegister par1IconRegister) { for(int i=0;i<17;i++) { icons[i]=par1IconRegister.registerIcon("logisticspipes:lpsolidblock/"+i); >>>>>>> public void registerIcons(IIconRegister par1IIconRegister) { for(int i=0;i<17;i++) { icons[i]=par1IIconRegister.registerIcon("logisticspipes:lpsolidblock/"+i);
<<<<<<< Pair<Integer, SinkReply> search = getBestReply(stack, SimpleServiceLocator.routerManager.getRouter(sourceRouter), excludeSource, new ArrayList<Integer>()); ======= Pair3<UUID, SinkReply, List<IFilter>> search = getBestReply(stack, SimpleServiceLocator.routerManager.getRouter(sourceRouter), SimpleServiceLocator.routerManager.getRouter(sourceRouter).getIRoutersByCost(), excludeSource, new ArrayList<UUID>(), new BitSet(ServerRouter.getBiggestSimpleID()), new LinkedList<IFilter>(), null); >>>>>>> Pair3<Integer, SinkReply, List<IFilter>> search = getBestReply(stack, SimpleServiceLocator.routerManager.getRouter(sourceRouter), SimpleServiceLocator.routerManager.getRouter(sourceRouter).getIRoutersByCost(), excludeSource, new ArrayList<Integer>(), new BitSet(ServerRouter.getBiggestSimpleID()), new LinkedList<IFilter>(), null); <<<<<<< private Pair<Integer, SinkReply> getBestReply(ItemStack item, IRouter sourceRouter, boolean excludeSource, List<Integer> jamList){ int potentialDestination = -1; SinkReply bestReply = null; ======= private Pair3<UUID, SinkReply, List<IFilter>> getBestReply(ItemStack item, IRouter sourceRouter, List<SearchNode> validDestinations, boolean excludeSource, List<UUID> jamList, BitSet layer, List<IFilter> filters, Pair3<UUID, SinkReply, List<IFilter>> result){ for(IFilter filter:filters) { if(filter.isBlocked() == filter.getFilteredItems().contains(ItemIdentifier.get(item)) || filter.blockRouting()) continue; } List<SearchNode> firewall = new LinkedList<SearchNode>(); BitSet used = (BitSet) layer.clone(); if(result == null) { result = new Pair3<UUID, SinkReply, List<IFilter>>(null, null, null); } >>>>>>> private Pair3<Integer, SinkReply, List<IFilter>> getBestReply(ItemStack item, IRouter sourceRouter, List<SearchNode> validDestinations, boolean excludeSource, List<Integer> jamList, BitSet layer, List<IFilter> filters, Pair3<Integer, SinkReply, List<IFilter>> result){ for(IFilter filter:filters) { if(filter.isBlocked() == filter.getFilteredItems().contains(ItemIdentifier.get(item)) || filter.blockRouting()) continue; } List<SearchNode> firewall = new LinkedList<SearchNode>(); BitSet used = (BitSet) layer.clone(); if(result == null) { result = new Pair3<Integer, SinkReply, List<IFilter>>(null, null, null); } <<<<<<< Pair<Integer, SinkReply> result = new Pair<Integer, SinkReply>(potentialDestination, bestReply); ======= for(SearchNode n:firewall) { IFilter filter = ((IFilteringRouter)n.node).getFilter(); filters.add(filter); result = getBestReply(item, sourceRouter, ((IFilteringRouter)n.node).getRouters(), excludeSource, jamList, used, filters, result); filters.remove(filter); } >>>>>>> for(SearchNode n:firewall) { IFilter filter = ((IFilteringRouter)n.node).getFilter(); filters.add(filter); result = getBestReply(item, sourceRouter, ((IFilteringRouter)n.node).getRouters(), excludeSource, jamList, used, filters, result); filters.remove(filter); } <<<<<<< HashMap<ItemIdentifier, Integer> allAvailableItems = new HashMap<ItemIdentifier, Integer>(); ======= Map<UUID, Map<ItemIdentifier, Integer>> items = new HashMap<UUID, Map<ItemIdentifier, Integer>>(); List<SearchNode> filterpipes = new ArrayList<SearchNode>(); BitSet used = new BitSet(ServerRouter.getBiggestSimpleID()); >>>>>>> Map<ItemIdentifier, Integer> items = new HashMap<ItemIdentifier, Integer>(); Map<ItemIdentifier, Integer> allAvailableItems = new HashMap<ItemIdentifier, Integer>(); List<SearchNode> filterpipes = new ArrayList<SearchNode>(); BitSet used = new BitSet(ServerRouter.getBiggestSimpleID()); <<<<<<< Map<ItemIdentifier, Integer> items = provider.getAllItems(); for (ItemIdentifier item : items.keySet()){ ======= provider.getAllItems(items, new ArrayList<IFilter>(0)); used.set(r.node.getSimpleID(), true); } for(SearchNode n:filterpipes) { List<IFilter> list = new LinkedList<IFilter>(); list.add(((IFilteringRouter)n.node).getFilter()); handleAvailableSubFiltering(n, items, list, used); } HashMap<ItemIdentifier, Integer> allAvailableItems = new HashMap<ItemIdentifier, Integer>(); for(Map<ItemIdentifier, Integer> allItems:items.values()) { for (ItemIdentifier item : allItems.keySet()){ >>>>>>> provider.getAllItems(items, new ArrayList<IFilter>(0)); used.set(r.node.getSimpleID(), true); for(SearchNode n:filterpipes) { List<IFilter> list = new LinkedList<IFilter>(); list.add(((IFilteringRouter)n.node).getFilter()); handleAvailableSubFiltering(n, items, list, used); } for (ItemIdentifier item : items.keySet()){ <<<<<<< if(r.node.getPipe() instanceof IFilteringPipe) { used.set(r.node.getSimpleID(), true); ======= if(r.node instanceof IFilteringRouter) { used.set(r.node.getSimpleID(), true); >>>>>>> if(r.node instanceof IFilteringRouter) { used.set(r.node.getSimpleID(), true); <<<<<<< if(!r.containsFlag(PipeRoutingConnectionType.canRequestFrom)) continue; if(used.get(n.node.getSimpleID())) continue; ======= if(!n.containsFlag(PipeRoutingConnectionType.canRequestFrom)) continue; if(used.get(n.node.getSimpleID())) continue; >>>>>>> if(!n.containsFlag(PipeRoutingConnectionType.canRequestFrom)) continue; if(used.get(n.node.getSimpleID())) continue; <<<<<<< if(n.node.getPipe() instanceof IFilteringPipe) { used.set(n.node.getSimpleID(), true); ======= if(n.node instanceof IFilteringRouter) { used.set(n.node.getSimpleID(), true); >>>>>>> if(n.node instanceof IFilteringRouter) { used.set(n.node.getSimpleID(), true);
<<<<<<< ======= import logisticspipes.LogisticsPipes; import logisticspipes.items.LogisticsFluidContainer; >>>>>>> import logisticspipes.items.LogisticsFluidContainer; <<<<<<< ======= private static void checkNBTbadness(ItemIdentifier item, NBTBase nbt) { if((item.getMaxStackSize() > 1 || LogisticsPipes.DEBUG) && nbt.getName().isEmpty()) { if (!_badTags.contains(item.getIgnoringNBT())) { _badTags.add(item.getIgnoringNBT()); LogisticsPipes.log.warning("Bad item " + item.getDebugName() + " : Root NBTTag has no name"); } } try { String s = checkNBTbadness_recurse(nbt); if(s != null) { LogisticsPipes.log.warning("Bad item " + item.getDebugName() + " : " + s); } } catch(Exception e) { e.printStackTrace(); } } private static String checkNBTbadness_recurse(NBTBase nbt) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { if(nbt instanceof NBTTagList) { NBTTagList l = (NBTTagList) nbt; for(int i = 0; i < l.tagCount(); i++) { NBTBase b = l.tagAt(i); if(!b.getName().equals("")) { return "NBTTagList containing named tag " + b.getName(); } String ret = checkNBTbadness_recurse(b); if(ret != null) return ret; } } else if(nbt instanceof NBTTagCompound) { @SuppressWarnings("unchecked") Map<String, NBTBase> internal = ((NBTTagCompound)nbt).tagMap; for(Entry<String, NBTBase> e : internal.entrySet()) { String k = e.getKey(); NBTBase v = e.getValue(); if(k == null || k.equals("")) { return "NBTTagCompound containing empty key"; } if(!k.equals(v.getName())) { return "NBTTagCompound key " + k + " doesn't match value name " + v; } String ret = checkNBTbadness_recurse(v); if(ret != null) return ret; } } return null; } public boolean isFluidContainer() { return Item.itemsList[this.itemID] instanceof LogisticsFluidContainer; } >>>>>>> public boolean isFluidContainer() { return Item.itemsList[this.itemID] instanceof LogisticsFluidContainer; }
<<<<<<< ======= import com.google.common.base.Preconditions; >>>>>>> <<<<<<< return new String(get(), StandardCharsets.UTF_8); ======= return new String(get(), UTF_8); >>>>>>> return new String(get(), UTF_8);
<<<<<<< import logisticspipes.api.IRoutedPowerProvider; import logisticspipes.interfaces.ISendRoutedItem; import logisticspipes.interfaces.IWorldProvider; import logisticspipes.logisticspipes.IInventoryProvider; ======= import logisticspipes.modules.abstractmodules.LogisticsModule; >>>>>>> import logisticspipes.modules.abstractmodules.LogisticsModule; import logisticspipes.api.IRoutedPowerProvider; import logisticspipes.interfaces.ISendRoutedItem; import logisticspipes.interfaces.IWorldProvider; import logisticspipes.logisticspipes.IInventoryProvider;
<<<<<<< public IBCPipePluggable getBCPipePluggable(final EnumFacing sideHit) { ======= @Nullable public IBCPipePluggable getBCPipePluggable(final ForgeDirection sideHit) { >>>>>>> @Nullable public IBCPipePluggable getBCPipePluggable(final EnumFacing sideHit) {
<<<<<<< import logisticspipes.utils.string.StringUtils; ======= >>>>>>> <<<<<<< String s = StringUtils.getFormatedStackSize(itemstack.stackSize); FontRenderer font = itemstack.getItem().getFontRenderer(itemstack); if (font == null) font = fontRenderer; itemRenderer.zLevel = 100.0F; GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_LIGHTING); itemRenderer.renderItemAndEffectIntoGUI(font, screen.getMC().renderEngine, itemstack, x, y); // With empty string, because damage value indicator struggles with the depth itemRenderer.renderItemOverlayIntoGUI(font, screen.getMC().renderEngine, itemstack, x, y, ""); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); itemRenderer.zLevel = 0.0F; // Draw number font.drawStringWithShadow(s, x + 19 - 2 - font.getStringWidth(s), y + 6 + 3, 16777215); ======= // Use BasicGuiHelper to render an ItemStack BasicGuiHelper.renderItemStack(itemstack, x, y, 100.0F, screen.getMC().renderEngine, itemRenderer, fontRenderer, true); >>>>>>> // Use BasicGuiHelper to render an ItemStack GuiGraphics.renderItemStack(itemstack, x, y, 100.0F, screen.getMC().renderEngine, itemRenderer, fontRenderer, DisplayAmount.HIDE_ONE, false);
<<<<<<< enableRendering(tileentity); super.renderTileEntityAt(tileentity, x, y, z, f); ======= super.renderTileEntityAt(tileentity, x, y, z, f); // Render Gates And Wires >>>>>>> super.renderTileEntityAt(tileentity, x, y, z, f); // Render Gates And Wires <<<<<<< if(!pipe.container.renderState.pipeConnectionMatrix.isConnected(item.input)) continue; ======= if(!pipe.container.getRenderState().pipeConnectionMatrix.isConnected(item.input.getOpposite())) continue; >>>>>>> if(!pipe.container.renderState.pipeConnectionMatrix.isConnected(item.input.getOpposite())) continue; <<<<<<< customRenderItem.doRender(dummyEntityItem, 0, 0, 0, 0, 0); ======= dummyEntityItem.age = age; dummyEntityItem.hoverStart = hoverStart; customRenderItem.doRenderItem(dummyEntityItem, 0, 0, 0, 0, 0); dummyEntityItem.age = 0; dummyEntityItem.hoverStart = 0; >>>>>>> dummyEntityItem.age = age; dummyEntityItem.hoverStart = hoverStart; customRenderItem.doRender(dummyEntityItem, 0, 0, 0, 0, 0); dummyEntityItem.age = 0; dummyEntityItem.hoverStart = 0;
<<<<<<< ItemIdentifierStack next = iterator.next(); MainProxy.dropItems(getWorld(), next.makeNormalStack(), this.getPipe().getX(), this.getPipe().getY(), this.getPipe().getZ()); ======= ItemIdentifierStack next = iterator.next().getValue1(); SimpleServiceLocator.buildCraftProxy.dropItems(getWorld(), next.makeNormalStack(), this.getPipe().getX(), this.getPipe().getY(), this.getPipe().getZ()); >>>>>>> ItemIdentifierStack next = iterator.next().getValue1(); MainProxy.dropItems(getWorld(), next.makeNormalStack(), this.getPipe().getX(), this.getPipe().getY(), this.getPipe().getZ()); <<<<<<< NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist2.getCompoundTagAt(i); _itemBuffer.put(ItemIdentifierStack.getFromStack(ItemStack.loadItemStackFromNBT(nbttagcompound1)), new Pair<Integer, Integer>(_bufferTimeOut, 0)); ======= NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist2.tagAt(i); _itemBuffer.add(new Pair<ItemIdentifierStack, Pair<Integer, Integer>>(ItemIdentifierStack.getFromStack(ItemStack.loadItemStackFromNBT(nbttagcompound1)), new Pair<Integer, Integer>(_bufferTimeOut, 0))); >>>>>>> NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist2.getCompoundTagAt(i); _itemBuffer.add(new Pair<ItemIdentifierStack, Pair<Integer, Integer>>(ItemIdentifierStack.getFromStack(ItemStack.loadItemStackFromNBT(nbttagcompound1)), new Pair<Integer, Integer>(_bufferTimeOut, 0)));
<<<<<<< import logisticspipes.utils.LiquidIdentifier; ======= import logisticspipes.utils.ItemIdentifier; >>>>>>> import logisticspipes.utils.LiquidIdentifier; import logisticspipes.utils.ItemIdentifier; <<<<<<< LiquidIdentifier.initFromForge(true); ======= ItemIdentifier.tick(); >>>>>>> LiquidIdentifier.initFromForge(true); ItemIdentifier.tick();
<<<<<<< import logisticspipes.api.IRoutedPowerProvider; ======= >>>>>>> import logisticspipes.api.IRoutedPowerProvider; <<<<<<< ======= import net.minecraft.util.Icon; >>>>>>> <<<<<<< MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setSlot(slot).setTag(nbt).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), player); ======= MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this), player); >>>>>>> MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this), player);
<<<<<<< import logisticspipes.LogisticsPipes; ======= >>>>>>> <<<<<<< import logisticspipes.network.GuiIDs; import net.minecraft.block.Block; ======= import logisticspipes.proxy.MainProxy; >>>>>>> import logisticspipes.proxy.MainProxy; import net.minecraft.block.Block;
<<<<<<< ======= import net.minecraftforge.common.ISidedInventory; >>>>>>> <<<<<<< IInventoryUtil inv = this.getAdaptedInventoryUtil((IInventory) tile.tile); ======= InventoryUtil inv = this.getAdaptedInventoryUtil(tile); >>>>>>> IInventoryUtil inv = this.getAdaptedInventoryUtil((IInventory) tile.tile); <<<<<<< IInventoryUtil inv = getAdaptedInventoryUtil((IInventory) tile.tile); int available = inv.itemCount(item); if (available == 0) continue; int wanted = Math.min(available, stack.stackSize); wanted = Math.min(wanted, maxCount); wanted = Math.min(wanted, item.getMaxStackSize()); ======= InventoryUtil inv = getAdaptedInventoryUtil(tile); >>>>>>> IInventoryUtil inv = getAdaptedInventoryUtil((IInventory) tile.tile); int available = inv.itemCount(item); if (available == 0) continue; int wanted = Math.min(available, stack.stackSize); wanted = Math.min(wanted, maxCount); wanted = Math.min(wanted, item.getMaxStackSize()); <<<<<<< private IInventoryUtil getAdaptedInventoryUtil(IInventory base){ ======= private InventoryUtil getAdaptedInventoryUtil(AdjacentTile tile){ IInventory base = (IInventory) tile.tile; if (base instanceof ISidedInventory) { base = new SidedInventoryAdapter((ISidedInventory) base, tile.orientation.getOpposite()); } >>>>>>> private IInventoryUtil getAdaptedInventoryUtil(IInventory base){ <<<<<<< return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, true, false, 0, 0); ======= return SimpleServiceLocator.inventoryUtilFactory.getOneHiddenInventoryUtil(base); default: break; >>>>>>> return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, true, false, 0, 0); default: break; <<<<<<< IInventoryUtil inv = this.getAdaptedInventoryUtil((IInventory) tile.tile); ======= InventoryUtil inv = this.getAdaptedInventoryUtil(tile); >>>>>>> IInventoryUtil inv = this.getAdaptedInventoryUtil((IInventory) tile.tile);
<<<<<<< if (SimpleServiceLocator.pipeInformaitonManager.isItemPipe(tile)) { ======= if (SimpleServiceLocator.pipeInformationManager.isItemPipe(tile)) { >>>>>>> if (SimpleServiceLocator.pipeInformationManager.isItemPipe(tile)) { <<<<<<< protected void handleTileReachedClient(LPTravelingItemClient arrivingItem, TileEntity tile, ForgeDirection dir) { if (SimpleServiceLocator.pipeInformaitonManager.isItemPipe(tile)) { ======= protected void handleTileReachedClient(LPTravelingItemClient arrivingItem, TileEntity tile) { if (SimpleServiceLocator.pipeInformationManager.isItemPipe(tile)) { >>>>>>> protected void handleTileReachedClient(LPTravelingItemClient arrivingItem, TileEntity tile, ForgeDirection dir) { if (SimpleServiceLocator.pipeInformationManager.isItemPipe(tile)) { <<<<<<< protected boolean passToNextPipe(LPTravelingItem item, TileEntity tile) { IPipeInformationProvider information = SimpleServiceLocator.pipeInformaitonManager.getInformationProviderFor(tile); ======= private boolean passToNextPipe(LPTravelingItem item, TileEntity tile) { IPipeInformationProvider information = SimpleServiceLocator.pipeInformationManager.getInformationProviderFor(tile); >>>>>>> protected boolean passToNextPipe(LPTravelingItem item, TileEntity tile) { IPipeInformationProvider information = SimpleServiceLocator.pipeInformationManager.getInformationProviderFor(tile);
<<<<<<< import logisticspipes.api.IRoutedPowerProvider; import logisticspipes.interfaces.ISendRoutedItem; import logisticspipes.interfaces.IWorldProvider; import logisticspipes.logisticspipes.IInventoryProvider; ======= import logisticspipes.modules.abstractmodules.LogisticsModule; >>>>>>> import logisticspipes.api.IRoutedPowerProvider; import logisticspipes.interfaces.ISendRoutedItem; import logisticspipes.interfaces.IWorldProvider; import logisticspipes.logisticspipes.IInventoryProvider; import logisticspipes.modules.abstractmodules.LogisticsModule;
<<<<<<< import logisticspipes.utils.ItemIdentifierStack; import logisticspipes.utils.SimpleInventory; ======= >>>>>>> import logisticspipes.utils.ItemIdentifierStack; import logisticspipes.utils.SimpleInventory; <<<<<<< private SimpleInventory dummyInventory = new SimpleInventory(9, "Items to keep stocked", 127); ======= private final InventoryUtilFactory _invUtilFactory; >>>>>>>
<<<<<<< import net.minecraft.item.Item; ======= import logisticspipes.modules.ModuleCrafterMK2; import logisticspipes.modules.abstractmodules.LogisticsModule.ModulePositionType; >>>>>>> import net.minecraft.item.Item; import logisticspipes.modules.ModuleCrafterMK2; import logisticspipes.modules.abstractmodules.LogisticsModule.ModulePositionType;
<<<<<<< import logisticspipes.api.IRoutedPowerProvider; ======= >>>>>>> import logisticspipes.api.IRoutedPowerProvider; <<<<<<< ======= import net.minecraft.util.Icon; >>>>>>> <<<<<<< @Override public void startWatching(EntityPlayer player) { localModeWatchers.add(player); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ModuleInventory.class).setSlot(slot).setIdentList(ItemIdentifierStack.getListFromInventory(_filterInventory)).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), player); } ======= @Override public void startWatching(EntityPlayer player) { localModeWatchers.add(player); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ModuleInventory.class).setIdentList(ItemIdentifierStack.getListFromInventory(_filterInventory)).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), player); } >>>>>>> @Override public void startWatching(EntityPlayer player) { localModeWatchers.add(player); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ModuleInventory.class).setIdentList(ItemIdentifierStack.getListFromInventory(_filterInventory)).setModulePos(this), player); } <<<<<<< @Override @SideOnly(Side.CLIENT) public IIcon getIconTexture(IIconRegister register) { return register.registerIcon("logisticspipes:itemModule/ModuleEnchantmentSinkMK2"); } @Override public boolean hasEffect() { return true; } ======= @Override public boolean hasEffect() { return true; >>>>>>> @Override public boolean hasEffect() { return true;
<<<<<<< ======= import java.util.List; import java.util.UUID; import logisticspipes.interfaces.routing.IRelayItem; >>>>>>> import java.util.List; import java.util.UUID; import logisticspipes.interfaces.routing.IRelayItem; <<<<<<< public int getSourceint(); ======= public UUID getSourceUUID(); public IRouter getRouter(); >>>>>>> // public UUID getSourceUUID(); public IRouter getRouter(); <<<<<<< public void sendStack(ItemStack stack, int destination); public void sendStack(ItemStack stack, int destination, ItemSendMode mode); ======= public void sendStack(ItemStack stack, UUID destination, List<IRelayItem> relays); public void sendStack(ItemStack stack, UUID destination, ItemSendMode mode, List<IRelayItem> relays); >>>>>>> public void sendStack(ItemStack stack, int destination, List<IRelayItem> relays); public void sendStack(ItemStack stack, int destination, ItemSendMode mode, List<IRelayItem> relays);
<<<<<<< import logisticspipes.api.IRoutedPowerProvider; ======= >>>>>>> import logisticspipes.api.IRoutedPowerProvider; <<<<<<< private Map<Item, Set<Integer>> oreItemIdMap; private int slot = 0; ======= private Map<Integer, Set<Integer>> oreItemIdMap; >>>>>>> private Map<Item, Set<Integer>> oreItemIdMap; <<<<<<< MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OreDictItemSinkList.class).setSlot(slot).setTag(nbt).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), player); ======= MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OreDictItemSinkList.class).setTag(nbt).setModulePos(this), player); >>>>>>> MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OreDictItemSinkList.class).setTag(nbt).setModulePos(this), player);
<<<<<<< import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumFacing; import lombok.AllArgsConstructor; import lombok.Getter; ======= >>>>>>> <<<<<<< @AllArgsConstructor public enum SpeedupDirection implements ITubeRenderOrientation, ITubeOrientation { //@formatter:off NORTH(EnumFacing.NORTH), SOUTH(EnumFacing.SOUTH), EAST(EnumFacing.EAST), WEST(EnumFacing.WEST); //@formatter:on @Getter EnumFacing dir1; @Override public void rotatePositions(IPositionRotateble set) { if (this == SOUTH) { set.rotateLeft(); set.rotateLeft(); } else if (this == EAST) { set.rotateRight(); } else if (this == WEST) { set.rotateLeft(); } } @Override public ITubeRenderOrientation getRenderOrientation() { return this; } @Override public DoubleCoordinates getOffset() { return new DoubleCoordinates(0, 0, 0); } @Override public void setOnPipe(CoreMultiBlockPipe pipe) { ((HSTubeSpeedup) pipe).orientation = this; } } ======= >>>>>>> <<<<<<< public boolean canPipeConnect(TileEntity tile, EnumFacing side) { if(tile instanceof LogisticsTileGenericSubMultiBlock) { if(this.getOrientation().getDir1() != side) { ======= public boolean canPipeConnect(TileEntity tile, ForgeDirection side) { if (tile instanceof LogisticsTileGenericSubMultiBlock) { if (this.getOrientation().getDir1() != side) { >>>>>>> public boolean canPipeConnect(TileEntity tile, EnumFacing side) { if (tile instanceof LogisticsTileGenericSubMultiBlock) { if (this.getOrientation().getDir1() != side) {
<<<<<<< for (CCModel model : LogisticsNewRenderPipe.corners_M.get(corner)) { objectsToRender.add(new Pair<CCModel, IconTransformation>(model, LogisticsNewRenderPipe.basicPipeTexture)); ======= for (IModel3D model : LogisticsNewRenderPipe.corners_M.get(corner)) { objectsToRender.add(new Pair<IModel3D, IIconTransformation>(model, LogisticsNewRenderPipe.basicTexture)); >>>>>>> for (IModel3D model : LogisticsNewRenderPipe.corners_M.get(corner)) { objectsToRender.add(new Pair<IModel3D, IIconTransformation>(model, LogisticsNewRenderPipe.basicPipeTexture)); <<<<<<< objectsToRender.add(new Pair<CCModel, IconTransformation>(LogisticsNewRenderPipe.edges.get(edge), LogisticsNewRenderPipe.basicPipeTexture)); ======= objectsToRender.add(new Pair<IModel3D, IIconTransformation>(LogisticsNewRenderPipe.edges.get(edge), LogisticsNewRenderPipe.basicTexture)); >>>>>>> objectsToRender.add(new Pair<IModel3D, IIconTransformation>(LogisticsNewRenderPipe.edges.get(edge), LogisticsNewRenderPipe.basicPipeTexture));
<<<<<<< ======= import net.minecraft.src.buildcraft.logisticspipes.items.RemoteOrderer; import net.minecraft.src.buildcraft.logisticspipes.items.RemoteOrdererClientInformation; import net.minecraft.src.buildcraft.transport.BlockGenericPipe; >>>>>>> import net.minecraft.src.buildcraft.logisticspipes.items.RemoteOrderer; import net.minecraft.src.buildcraft.logisticspipes.items.RemoteOrdererClientInformation; import net.minecraft.src.buildcraft.transport.BlockGenericPipe; <<<<<<< public static Item LogisticsProviderPipeMK2; ======= public static Item LogisticsRemoteOrdererPipe; >>>>>>> public static Item LogisticsProviderPipeMK2; public static Item LogisticsRemoteOrdererPipe; <<<<<<< public static int LOGISTICSPIPE_PROVIDERMK2_TEXTURE = 0; ======= public static int LOGISTICSPIPE_REMOTE_ORDERER_TEXTURE = 0; >>>>>>> public static int LOGISTICSPIPE_PROVIDERMK2_TEXTURE = 0; public static int LOGISTICSPIPE_REMOTE_ORDERER_TEXTURE = 0; <<<<<<< Property logisticPipeProviderMK2IdProperty = configuration.getOrCreateIntProperty("logisticsPipeProviderMK2.id", Configuration.CATEGORY_ITEM, LOGISTICSPIPE_PROVIDER_MK2_ID); logisticPipeProviderMK2IdProperty.comment = "The item id for the provider logistics pipe MK2"; ======= Property logisticPipeRemoteOrdererIdProperty = configuration.getOrCreateIntProperty("logisticsPipeRemoteOrderer.id", Configuration.CATEGORY_ITEM, LOGISTICSPIPE_REMOTE_ORDERER_ID); logisticPipeRemoteOrdererIdProperty.comment = "The item id for the remote orderer logistics pipe"; >>>>>>> Property logisticPipeProviderMK2IdProperty = configuration.getOrCreateIntProperty("logisticsPipeProviderMK2.id", Configuration.CATEGORY_ITEM, LOGISTICSPIPE_PROVIDER_MK2_ID); logisticPipeProviderMK2IdProperty.comment = "The item id for the provider logistics pipe MK2"; Property logisticPipeRemoteOrdererIdProperty = configuration.getOrCreateIntProperty("logisticsPipeRemoteOrderer.id", Configuration.CATEGORY_ITEM, LOGISTICSPIPE_REMOTE_ORDERER_ID); logisticPipeRemoteOrdererIdProperty.comment = "The item id for the remote orderer logistics pipe"; <<<<<<< LOGISTICSPIPE_PROVIDER_MK2_ID = Integer.parseInt(logisticPipeProviderMK2IdProperty.value); ======= LOGISTICSPIPE_REMOTE_ORDERER_ID = Integer.parseInt(logisticPipeRemoteOrdererIdProperty.value); >>>>>>> LOGISTICSPIPE_PROVIDER_MK2_ID = Integer.parseInt(logisticPipeProviderMK2IdProperty.value); LOGISTICSPIPE_REMOTE_ORDERER_ID = Integer.parseInt(logisticPipeRemoteOrdererIdProperty.value); <<<<<<< LOGISTICSPIPE_PROVIDERMK2_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_PROVIDERMK2_TEXTURE_FILE); ======= LOGISTICSPIPE_REMOTE_ORDERER_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_REMOTE_ORDERER_TEXTURE_FILE); >>>>>>> LOGISTICSPIPE_PROVIDERMK2_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_PROVIDERMK2_TEXTURE_FILE); LOGISTICSPIPE_REMOTE_ORDERER_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_REMOTE_ORDERER_TEXTURE_FILE); <<<<<<< LogisticsProviderPipeMK2 = createPipe(LOGISTICSPIPE_PROVIDER_MK2_ID, PipeItemsProviderLogisticsMk2.class, "Provider Logistics Pipe MK2"); ======= LogisticsRemoteOrdererPipe = createPipe(LOGISTICSPIPE_REMOTE_ORDERER_ID, PipeItemsRemoteOrdererLogistics.class, "Remote Orderer Pipe"); >>>>>>> LogisticsRemoteOrdererPipe = createPipe(LOGISTICSPIPE_REMOTE_ORDERER_ID, PipeItemsRemoteOrdererLogistics.class, "Remote Orderer Pipe"); LogisticsProviderPipeMK2 = createPipe(LOGISTICSPIPE_PROVIDER_MK2_ID, PipeItemsProviderLogisticsMk2.class, "Provider Logistics Pipe MK2"); <<<<<<< LOGISTICSPIPE_BUILDERSUPPLIER_ID = Integer.parseInt(logisticPipeBuilderSupplierIdProperty.value); LOGISTICSPIPE_LIQUIDSUPPLIER_ID = Integer.parseInt(logisticPipeLiquidSupplierIdProperty.value); LOGISTICSPIPE_BUILDERSUPPLIER_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_BUILDERSUPPLIER_TEXTURE_FILE); LOGISTICSPIPE_LIQUIDSUPPLIER_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_LIQUIDSUPPLIER_TEXTURE_FILE); LogisticsBuilderSupplierPipe = createPipe(LOGISTICSPIPE_BUILDERSUPPLIER_ID, PipeItemsBuilderSupplierLogistics.class, "Builder Supplier Logistics Pipe"); LogisticsLiquidSupplierPipe = createPipe(LOGISTICSPIPE_LIQUIDSUPPLIER_ID, PipeItemsLiquidSupplier.class, "Liquid Supplier Logistics Pipe"); ======= CraftingManager craftingmanager = CraftingManager.getInstance(); craftingmanager.addRecipe(new ItemStack(LogisticsBasicPipe, 8), new Object[] { "grg", "GdG", "grg", Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.goldGearItem, Character.valueOf('d'), BuildCraftTransport.pipeItemsDiamond, Character.valueOf('r'), Block.torchRedstoneActive}); craftingmanager.addRecipe(new ItemStack(LogisticsRequestPipe, 1), new Object[] { "gPg", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('g'), BuildCraftCore.goldGearItem}); craftingmanager.addRecipe(new ItemStack(LogisticsProviderPipe, 1), new Object[] { "d", "P", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('d'), Item.lightStoneDust}); craftingmanager.addRecipe(new ItemStack(LogisticsCraftingPipe, 1), new Object[] { "dPd", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('d'), Item.lightStoneDust}); craftingmanager.addRecipe(new ItemStack(LogisticsSatellitePipe, 1), new Object[] { "rPr", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('r'), Item.redstone}); craftingmanager.addRecipe(new ItemStack(LogisticsSupplierPipe, 1), new Object[] { "lPl", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('l'), new ItemStack(Item.dyePowder, 1, 4)}); craftingmanager.addRecipe(new ItemStack(LogisticsChassiPipe1, 1), new Object[] { "iii", "iPi", "iii", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('i'), Item.redstone}); craftingmanager.addRecipe(new ItemStack(LogisticsChassiPipe2, 1), new Object[] { "iii", "iPi", "iii", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('i'), Item.ingotIron}); craftingmanager.addRecipe(new ItemStack(LogisticsChassiPipe3, 1), new Object[] { "iii", "iPi", "iii", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('i'), Item.ingotGold}); craftingmanager.addRecipe(new ItemStack(LogisticsChassiPipe4, 1), new Object[] { "iii", "iPi", "iii", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('i'), Item.diamond}); craftingmanager.addRecipe(new ItemStack(LogisticsChassiPipe5, 1), new Object[] { "gig", "iPi", "gig", Character.valueOf('P'), core_LogisticsPipes.LogisticsBasicPipe, Character.valueOf('i'), Block.blockDiamond, Character.valueOf('g'), Block.blockGold}); craftingmanager.addRecipe(new ItemStack(LogisticsCraftingPipeMK2, 1), new Object[] {"U", "B", Character.valueOf('B'), LogisticsCraftingPipe, Character.valueOf('U'), BuildCraftCore.goldGearItem}); craftingmanager.addRecipe(new ItemStack(LogisticsRequestPipeMK2, 1), new Object[] {"U", "B", Character.valueOf('B'), LogisticsRequestPipe, Character.valueOf('U'), BuildCraftCore.diamondGearItem}); craftingmanager.addRecipe(new ItemStack(LogisticsRemoteOrdererPipe, 1), new Object[] {"U", "B", Character.valueOf('B'), LogisticsBasicPipe, Character.valueOf('U'), Item.enderPearl}); craftingmanager.addRecipe(new ItemStack(LogisticsNetworkMonitior, 1), new Object[] { "g g", " G ", " g ", Character.valueOf('g'), Item.ingotGold, Character.valueOf('G'), BuildCraftCore.goldGearItem}); craftingmanager.addRecipe(new ItemStack(LogisticsRemoteOrderer, 1), new Object[] { "gg", "gg", "DD", Character.valueOf('g'), Block.glass, Character.valueOf('D'), BuildCraftCore.diamondGearItem}); if(LOGISTICS_BLOCK_ID != 0) { craftingmanager.addRecipe(new ItemStack(LogisticsCraftingSignCreator, 1), new Object[] {"G G", " S ", " D ", Character.valueOf('G'), BuildCraftCore.goldGearItem, Character.valueOf('S'), Item.sign, Character.valueOf('D'), BuildCraftCore.diamondGearItem}); } >>>>>>> LOGISTICSPIPE_BUILDERSUPPLIER_ID = Integer.parseInt(logisticPipeBuilderSupplierIdProperty.value); LOGISTICSPIPE_LIQUIDSUPPLIER_ID = Integer.parseInt(logisticPipeLiquidSupplierIdProperty.value); LOGISTICSPIPE_BUILDERSUPPLIER_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_BUILDERSUPPLIER_TEXTURE_FILE); LOGISTICSPIPE_LIQUIDSUPPLIER_TEXTURE = CoreProxy.addCustomTexture(LOGISTICSPIPE_LIQUIDSUPPLIER_TEXTURE_FILE); LogisticsBuilderSupplierPipe = createPipe(LOGISTICSPIPE_BUILDERSUPPLIER_ID, PipeItemsBuilderSupplierLogistics.class, "Builder Supplier Logistics Pipe"); LogisticsLiquidSupplierPipe = createPipe(LOGISTICSPIPE_LIQUIDSUPPLIER_ID, PipeItemsLiquidSupplier.class, "Liquid Supplier Logistics Pipe");
<<<<<<< // From BaseRoutingLogic public void throttledUpdateEntity(){} protected void delayThrottle() { //delay 6(+1) ticks to prevent suppliers from ticking between a item arriving at them and the item hitting their adj. inv if(throttleTimeLeft < 7) throttleTimeLeft = 7; } private void doDebugStuff(EntityPlayer entityplayer) { //entityplayer.worldObj.setWorldTime(4951); IRouter r = getRouter(); if(!(r instanceof ServerRouter)) return; System.out.println("***"); System.out.println("---------Interests---------------"); for(Entry<ItemIdentifier, Set<IRouter>> i: ServerRouter.getInterestedInSpecifics().entrySet()){ System.out.print(i.getKey().getFriendlyName()+":"); for(IRouter j:i.getValue()) System.out.print(j.getSimpleID()+","); System.out.println(); } System.out.print("ALL ITEMS:"); for(IRouter j:ServerRouter.getInterestedInGeneral()) System.out.print(j.getSimpleID()+","); System.out.println(); ServerRouter sr = (ServerRouter) r; System.out.println(r.toString()); System.out.println("---------CONNECTED TO---------------"); for (CoreRoutedPipe adj : sr._adjacent.keySet()) { System.out.println(adj.getRouter().getSimpleID()); } System.out.println(); System.out.println("========DISTANCE TABLE=============="); for(ExitRoute n : r.getIRoutersByCost()) { System.out.println(n.destination.getSimpleID()+ " @ " + n.distanceToDestination + " -> "+ n.connectionDetails +"("+n.destination.getId() +")"); } System.out.println(); System.out.println("*******EXIT ROUTE TABLE*************"); ArrayList<ExitRoute> table = r.getRouteTable(); for (int i=0; i < table.size(); i++){ if(table.get(i)!=null) System.out.println(i + " -> " + r.getSimpleID() + " via " + table.get(i).exitOrientation + "(" + table.get(i) + " distance)"); } System.out.println(); System.out.println("++++++++++CONNECTIONS+++++++++++++++"); System.out.println(Arrays.toString(ForgeDirection.VALID_DIRECTIONS)); System.out.println(Arrays.toString(sr.sideDisconnected)); System.out.println(Arrays.toString(container.pipeConnectionsBuffer)); System.out.println(); System.out.println("~~~~~~~~~~~~~~~POWER~~~~~~~~~~~~~~~~"); System.out.println(r.getPipe().getRoutedPowerProviders()); System.out.println(r.getPowerProvider()); refreshConnectionAndRender(true); } // end FromBaseRoutingLogic ======= protected void onAllowedRemoval() {} >>>>>>> protected void onAllowedRemoval() {} // From BaseRoutingLogic public void throttledUpdateEntity(){} protected void delayThrottle() { //delay 6(+1) ticks to prevent suppliers from ticking between a item arriving at them and the item hitting their adj. inv if(throttleTimeLeft < 7) throttleTimeLeft = 7; } private void doDebugStuff(EntityPlayer entityplayer) { //entityplayer.worldObj.setWorldTime(4951); IRouter r = getRouter(); if(!(r instanceof ServerRouter)) return; System.out.println("***"); System.out.println("---------Interests---------------"); for(Entry<ItemIdentifier, Set<IRouter>> i: ServerRouter.getInterestedInSpecifics().entrySet()){ System.out.print(i.getKey().getFriendlyName()+":"); for(IRouter j:i.getValue()) System.out.print(j.getSimpleID()+","); System.out.println(); } System.out.print("ALL ITEMS:"); for(IRouter j:ServerRouter.getInterestedInGeneral()) System.out.print(j.getSimpleID()+","); System.out.println(); ServerRouter sr = (ServerRouter) r; System.out.println(r.toString()); System.out.println("---------CONNECTED TO---------------"); for (CoreRoutedPipe adj : sr._adjacent.keySet()) { System.out.println(adj.getRouter().getSimpleID()); } System.out.println(); System.out.println("========DISTANCE TABLE=============="); for(ExitRoute n : r.getIRoutersByCost()) { System.out.println(n.destination.getSimpleID()+ " @ " + n.distanceToDestination + " -> "+ n.connectionDetails +"("+n.destination.getId() +")"); } System.out.println(); System.out.println("*******EXIT ROUTE TABLE*************"); ArrayList<ExitRoute> table = r.getRouteTable(); for (int i=0; i < table.size(); i++){ if(table.get(i)!=null) System.out.println(i + " -> " + r.getSimpleID() + " via " + table.get(i).exitOrientation + "(" + table.get(i) + " distance)"); } System.out.println(); System.out.println("++++++++++CONNECTIONS+++++++++++++++"); System.out.println(Arrays.toString(ForgeDirection.VALID_DIRECTIONS)); System.out.println(Arrays.toString(sr.sideDisconnected)); System.out.println(Arrays.toString(container.pipeConnectionsBuffer)); System.out.println(); System.out.println("~~~~~~~~~~~~~~~POWER~~~~~~~~~~~~~~~~"); System.out.println(r.getPipe().getRoutedPowerProviders()); System.out.println(r.getPowerProvider()); refreshConnectionAndRender(true); } // end FromBaseRoutingLogic <<<<<<< if(MainProxy.isClient(getWorld())) return; if(canBeDestroyed()) { ======= if(MainProxy.isClient(worldObj)) return; if(canBeDestroyed() || destroyByPlayer) { >>>>>>> if(MainProxy.isClient(getWorld())) return; if(canBeDestroyed() || destroyByPlayer) {
<<<<<<< import java.util.Map; ======= import java.util.List; import java.util.logging.FileHandler; import java.util.logging.Level; import java.util.logging.Logger; import buildcraft.api.transport.IPipeTile.PipeType; >>>>>>> import java.util.Map; <<<<<<< PacketHandler.initialize(); ======= try { Field fTransformers = LaunchClassLoader.class.getDeclaredField("transformers"); fTransformers.setAccessible(true); @SuppressWarnings("unchecked") List<IClassTransformer> transformers = (List<IClassTransformer>) fTransformers.get(loader); IClassTransformer lpClassInjector = new LogisticsPipesClassInjector(); transformers.add(lpClassInjector); // Avoid NPE caused by wrong ClassTransformers for(int i=transformers.size() - 1 ; i > 0;i--) { // Move everything one up transformers.set(i, transformers.get(i - 1)); } transformers.set(0, lpClassInjector); // So that our injector can be first } catch(NoSuchFieldException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } catch(SecurityException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } catch(IllegalArgumentException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } catch(IllegalAccessException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } PacketHandler.intialize(); >>>>>>> try { Field fTransformers = LaunchClassLoader.class.getDeclaredField("transformers"); fTransformers.setAccessible(true); @SuppressWarnings("unchecked") List<IClassTransformer> transformers = (List<IClassTransformer>) fTransformers.get(loader); IClassTransformer lpClassInjector = new LogisticsPipesClassInjector(); transformers.add(lpClassInjector); // Avoid NPE caused by wrong ClassTransformers for(int i=transformers.size() - 1 ; i > 0;i--) { // Move everything one up transformers.set(i, transformers.get(i - 1)); } transformers.set(0, lpClassInjector); // So that our injector can be first } catch(NoSuchFieldException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } catch(SecurityException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } catch(IllegalArgumentException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } catch(IllegalAccessException e) { loader.registerTransformer("logisticspipes.asm.LogisticsPipesClassInjector"); e.printStackTrace(); } PacketHandler.intialize(); <<<<<<< ======= public static Logger requestLog; private static LPGlobalCCAccess generalAccess; >>>>>>> private static LPGlobalCCAccess generalAccess; <<<<<<< public void registerPipes(Side side) { LogisticsPipes.LogisticsBasicPipe = createPipe(PipeItemsBasicLogistics.class, "Basic Logistics Pipe", side); LogisticsPipes.LogisticsRequestPipeMk1 = createPipe(PipeItemsRequestLogistics.class, "Request Logistics Pipe", side); LogisticsPipes.LogisticsProviderPipeMk1 = createPipe(PipeItemsProviderLogistics.class, "Provider Logistics Pipe", side); LogisticsPipes.LogisticsCraftingPipeMk1 = createPipe(PipeItemsCraftingLogistics.class, "Crafting Logistics Pipe", side); LogisticsPipes.LogisticsSatellitePipe = createPipe(PipeItemsSatelliteLogistics.class, "Satellite Logistics Pipe", side); LogisticsPipes.LogisticsSupplierPipe = createPipe(PipeItemsSupplierLogistics.class, "Supplier Logistics Pipe", side); LogisticsPipes.LogisticsChassisPipeMk1 = createPipe(PipeLogisticsChassiMk1.class, "Logistics Chassi Mk1", side); LogisticsPipes.LogisticsChassisPipeMk2 = createPipe(PipeLogisticsChassiMk2.class, "Logistics Chassi Mk2", side); LogisticsPipes.LogisticsChassisPipeMk3 = createPipe(PipeLogisticsChassiMk3.class, "Logistics Chassi Mk3", side); LogisticsPipes.LogisticsChassisPipeMk4 = createPipe(PipeLogisticsChassiMk4.class, "Logistics Chassi Mk4", side); LogisticsPipes.LogisticsChassisPipeMk5 = createPipe(PipeLogisticsChassiMk5.class, "Logistics Chassi Mk5", side); LogisticsPipes.LogisticsCraftingPipeMk2 = createPipe(PipeItemsCraftingLogisticsMk2.class, "Crafting Logistics Pipe MK2", side); LogisticsPipes.LogisticsRequestPipeMk2 = createPipe(PipeItemsRequestLogisticsMk2.class, "Request Logistics Pipe MK2", side); LogisticsPipes.LogisticsRemoteOrdererPipe = createPipe(PipeItemsRemoteOrdererLogistics.class, "Remote Orderer Pipe", side); LogisticsPipes.LogisticsProviderPipeMk2 = createPipe(PipeItemsProviderLogisticsMk2.class, "Provider Logistics Pipe MK2", side); LogisticsPipes.LogisticsApiaristAnalyzerPipe = createPipe(PipeItemsApiaristAnalyser.class, "Apiarist Logistics Analyser Pipe", side); LogisticsPipes.LogisticsApiaristSinkPipe = createPipe(PipeItemsApiaristSink.class, "Apiarist Logistics Analyser Pipe", side); LogisticsPipes.LogisticsInvSysConPipe = createPipe(PipeItemsInvSysConnector.class, "Logistics Inventory System Connector", side); LogisticsPipes.LogisticsEntrancePipe = createPipe(PipeItemsSystemEntranceLogistics.class, "Logistics System Entrance Pipe", side); LogisticsPipes.LogisticsDestinationPipe = createPipe(PipeItemsSystemDestinationLogistics.class, "Logistics System Destination Pipe", side); LogisticsPipes.LogisticsCraftingPipeMk3 = createPipe(PipeItemsCraftingLogisticsMk3.class, "Crafting Logistics Pipe MK3", side); LogisticsPipes.LogisticsFirewallPipe = createPipe(PipeItemsFirewall.class, "Firewall Logistics Pipe", side); LogisticsPipes.LogisticsFluidSupplierPipeMk1 = createPipe(PipeItemsFluidSupplier.class, "Fluid Supplier Logistics Pipe", side); LogisticsPipes.LogisticsFluidBasicPipe = createPipe(PipeFluidBasic.class, "Basic Logistics Fluid Pipe", side); LogisticsPipes.LogisticsFluidInsertionPipe = createPipe(PipeFluidInsertion.class, "Logistics Fluid Insertion Pipe", side); LogisticsPipes.LogisticsFluidProviderPipe = createPipe(PipeFluidProvider.class, "Logistics Fluid Provider Pipe", side); LogisticsPipes.LogisticsFluidRequestPipe = createPipe(PipeFluidRequestLogistics.class, "Logistics Fluid Request Pipe", side); LogisticsPipes.LogisticsFluidExtractorPipe = createPipe(PipeFluidExtractor.class, "Logistics Fluid Extractor Pipe", side); LogisticsPipes.LogisticsFluidSatellitePipe = createPipe(PipeFluidSatellite.class, "Logistics Fluid Satellite Pipe", side); LogisticsPipes.LogisticsFluidSupplierPipeMk2 = createPipe(PipeFluidSupplierMk2.class, "Logistics Fluid Supplier Pipe Mk2", side); LogisticsPipes.logisticsRequestTable = createPipe(PipeBlockRequestTable.class, "Request Table", side); } protected Item createPipe(Class <? extends CoreUnroutedPipe> clas, String descr, Side side) { ItemLogisticsPipe res = LogisticsBlockGenericPipe.registerPipe(clas); res.setCreativeTab(LogisticsPipes.LPCreativeTab); res.setUnlocalizedName(clas.getSimpleName()); CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.createPipe(res); if(pipe instanceof CoreRoutedPipe) { res.setPipeIconIndex(((CoreRoutedPipe)pipe).getTextureType(ForgeDirection.UNKNOWN).normal); } if(side.isClient()) { if(pipe instanceof PipeBlockRequestTable) { MinecraftForgeClient.registerItemRenderer(res, new LogisticsPipeBlockRenderer()); } else { MinecraftForgeClient.registerItemRenderer(res, TransportProxyClient.pipeItemRenderer); } } if(clas != PipeItemsBasicLogistics.class) { if(clas != PipeFluidBasic.class && PipeFluidBasic.class.isAssignableFrom(clas)) { registerShapelessResetRecipe(res, 0, LogisticsPipes.LogisticsFluidBasicPipe, 0); } else { registerShapelessResetRecipe(res, 0, LogisticsPipes.LogisticsBasicPipe, 0); } } GameRegistry.registerItem(res, res.getUnlocalizedName()); return res; } protected void registerShapelessResetRecipe(Item fromItem, int fromData, Item toItem, int toData) { for(int j=1;j < 10; j++) { Object[] obj = new Object[j]; for(int k=0;k<j;k++) { obj[k] = new ItemStack(fromItem, 1, toData); } CraftingManager.getInstance().addShapelessRecipe(new ItemStack(toItem, j, fromData), obj); } } ======= public static Object getComputerLP() { if(generalAccess == null) { generalAccess = new LPGlobalCCAccess(); } return generalAccess; } >>>>>>> public static Object getComputerLP() { if(generalAccess == null) { generalAccess = new LPGlobalCCAccess(); } return generalAccess; } public void registerPipes(Side side) { LogisticsPipes.LogisticsBasicPipe = createPipe(PipeItemsBasicLogistics.class, "Basic Logistics Pipe", side); LogisticsPipes.LogisticsRequestPipeMk1 = createPipe(PipeItemsRequestLogistics.class, "Request Logistics Pipe", side); LogisticsPipes.LogisticsProviderPipeMk1 = createPipe(PipeItemsProviderLogistics.class, "Provider Logistics Pipe", side); LogisticsPipes.LogisticsCraftingPipeMk1 = createPipe(PipeItemsCraftingLogistics.class, "Crafting Logistics Pipe", side); LogisticsPipes.LogisticsSatellitePipe = createPipe(PipeItemsSatelliteLogistics.class, "Satellite Logistics Pipe", side); LogisticsPipes.LogisticsSupplierPipe = createPipe(PipeItemsSupplierLogistics.class, "Supplier Logistics Pipe", side); LogisticsPipes.LogisticsChassisPipeMk1 = createPipe(PipeLogisticsChassiMk1.class, "Logistics Chassi Mk1", side); LogisticsPipes.LogisticsChassisPipeMk2 = createPipe(PipeLogisticsChassiMk2.class, "Logistics Chassi Mk2", side); LogisticsPipes.LogisticsChassisPipeMk3 = createPipe(PipeLogisticsChassiMk3.class, "Logistics Chassi Mk3", side); LogisticsPipes.LogisticsChassisPipeMk4 = createPipe(PipeLogisticsChassiMk4.class, "Logistics Chassi Mk4", side); LogisticsPipes.LogisticsChassisPipeMk5 = createPipe(PipeLogisticsChassiMk5.class, "Logistics Chassi Mk5", side); LogisticsPipes.LogisticsCraftingPipeMk2 = createPipe(PipeItemsCraftingLogisticsMk2.class, "Crafting Logistics Pipe MK2", side); LogisticsPipes.LogisticsRequestPipeMk2 = createPipe(PipeItemsRequestLogisticsMk2.class, "Request Logistics Pipe MK2", side); LogisticsPipes.LogisticsRemoteOrdererPipe = createPipe(PipeItemsRemoteOrdererLogistics.class, "Remote Orderer Pipe", side); LogisticsPipes.LogisticsProviderPipeMk2 = createPipe(PipeItemsProviderLogisticsMk2.class, "Provider Logistics Pipe MK2", side); LogisticsPipes.LogisticsApiaristAnalyzerPipe = createPipe(PipeItemsApiaristAnalyser.class, "Apiarist Logistics Analyser Pipe", side); LogisticsPipes.LogisticsApiaristSinkPipe = createPipe(PipeItemsApiaristSink.class, "Apiarist Logistics Analyser Pipe", side); LogisticsPipes.LogisticsInvSysConPipe = createPipe(PipeItemsInvSysConnector.class, "Logistics Inventory System Connector", side); LogisticsPipes.LogisticsEntrancePipe = createPipe(PipeItemsSystemEntranceLogistics.class, "Logistics System Entrance Pipe", side); LogisticsPipes.LogisticsDestinationPipe = createPipe(PipeItemsSystemDestinationLogistics.class, "Logistics System Destination Pipe", side); LogisticsPipes.LogisticsCraftingPipeMk3 = createPipe(PipeItemsCraftingLogisticsMk3.class, "Crafting Logistics Pipe MK3", side); LogisticsPipes.LogisticsFirewallPipe = createPipe(PipeItemsFirewall.class, "Firewall Logistics Pipe", side); LogisticsPipes.LogisticsFluidSupplierPipeMk1 = createPipe(PipeItemsFluidSupplier.class, "Fluid Supplier Logistics Pipe", side); LogisticsPipes.LogisticsFluidBasicPipe = createPipe(PipeFluidBasic.class, "Basic Logistics Fluid Pipe", side); LogisticsPipes.LogisticsFluidInsertionPipe = createPipe(PipeFluidInsertion.class, "Logistics Fluid Insertion Pipe", side); LogisticsPipes.LogisticsFluidProviderPipe = createPipe(PipeFluidProvider.class, "Logistics Fluid Provider Pipe", side); LogisticsPipes.LogisticsFluidRequestPipe = createPipe(PipeFluidRequestLogistics.class, "Logistics Fluid Request Pipe", side); LogisticsPipes.LogisticsFluidExtractorPipe = createPipe(PipeFluidExtractor.class, "Logistics Fluid Extractor Pipe", side); LogisticsPipes.LogisticsFluidSatellitePipe = createPipe(PipeFluidSatellite.class, "Logistics Fluid Satellite Pipe", side); LogisticsPipes.LogisticsFluidSupplierPipeMk2 = createPipe(PipeFluidSupplierMk2.class, "Logistics Fluid Supplier Pipe Mk2", side); LogisticsPipes.logisticsRequestTable = createPipe(PipeBlockRequestTable.class, "Request Table", side); } protected Item createPipe(Class <? extends CoreUnroutedPipe> clas, String descr, Side side) { ItemLogisticsPipe res = LogisticsBlockGenericPipe.registerPipe(clas); res.setCreativeTab(LogisticsPipes.LPCreativeTab); res.setUnlocalizedName(clas.getSimpleName()); CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.createPipe(res); if(pipe instanceof CoreRoutedPipe) { res.setPipeIconIndex(((CoreRoutedPipe)pipe).getTextureType(ForgeDirection.UNKNOWN).normal); } if(side.isClient()) { if(pipe instanceof PipeBlockRequestTable) { MinecraftForgeClient.registerItemRenderer(res, new LogisticsPipeBlockRenderer()); } else { MinecraftForgeClient.registerItemRenderer(res, TransportProxyClient.pipeItemRenderer); } } if(clas != PipeItemsBasicLogistics.class) { if(clas != PipeFluidBasic.class && PipeFluidBasic.class.isAssignableFrom(clas)) { registerShapelessResetRecipe(res, 0, LogisticsPipes.LogisticsFluidBasicPipe, 0); } else { registerShapelessResetRecipe(res, 0, LogisticsPipes.LogisticsBasicPipe, 0); } } GameRegistry.registerItem(res, res.getUnlocalizedName()); return res; } protected void registerShapelessResetRecipe(Item fromItem, int fromData, Item toItem, int toData) { for(int j=1;j < 10; j++) { Object[] obj = new Object[j]; for(int k=0;k<j;k++) { obj[k] = new ItemStack(fromItem, 1, toData); } CraftingManager.getInstance().addShapelessRecipe(new ItemStack(toItem, j, fromData), obj); } }
<<<<<<< ======= import logisticspipes.logic.LogicSupplier; import logisticspipes.logic.LogicSupplier.SupplyMode; >>>>>>> <<<<<<< logic.setRequestingPartials(!logic.isRequestingPartials()); ((GuiButton)buttonList.get(0)).displayString = logic.isRequestingPartials() ? "Yes" : "No"; //TODO MainProxy.sendPacketToServer(new PacketCoordinates(NetworkConstants.SUPPLIER_PIPE_MODE_CHANGE, logic.getX(), logic.getY(), logic.getZ()).getPacket()); MainProxy.sendPacketToServer(PacketHandler.getPacket(SupplierPipeModePacket.class).setPosX(logic.getX()).setPosY(logic.getY()).setPosZ(logic.getZ())); ======= int currentMode=logic.isRequestingPartials().ordinal()+1; if(currentMode >= SupplyMode.values().length){ currentMode=0; } logic.setRequestingPartials(SupplyMode.values()[currentMode]); ((GuiButton)buttonList.get(0)).displayString = SupplyMode.values()[currentMode].toString(); //TODO MainProxy.sendPacketToServer(new PacketCoordinates(NetworkConstants.SUPPLIER_PIPE_MODE_CHANGE, logic.xCoord, logic.yCoord, logic.zCoord).getPacket()); MainProxy.sendPacketToServer(PacketHandler.getPacket(SupplierPipeModePacket.class).setPosX(logic.xCoord).setPosY(logic.yCoord).setPosZ(logic.zCoord)); >>>>>>> int currentMode=logic.isRequestingPartials().ordinal()+1; if(currentMode >= SupplyMode.values().length){ currentMode=0; } logic.setRequestingPartials(SupplyMode.values()[currentMode]); ((GuiButton)buttonList.get(0)).displayString = SupplyMode.values()[currentMode].toString(); //TODO MainProxy.sendPacketToServer(new PacketCoordinates(NetworkConstants.SUPPLIER_PIPE_MODE_CHANGE, logic.xCoord, logic.yCoord, logic.zCoord).getPacket()); MainProxy.sendPacketToServer(PacketHandler.getPacket(SupplierPipeModePacket.class).setPosX(logic.getX()).setPosY(logic.getY()).setPosZ(logic.getZ()));
<<<<<<< ======= import net.minecraft.src.World; import net.minecraft.src.core_LogisticsPipes; >>>>>>> import net.minecraft.src.World; import net.minecraft.src.core_LogisticsPipes; <<<<<<< import net.minecraftforge.common.ISidedInventory; import buildcraft.api.core.Orientations; import buildcraft.api.core.Position; import buildcraft.core.Utils; ======= >>>>>>> import net.minecraftforge.common.ISidedInventory; import buildcraft.api.core.Orientations; import buildcraft.api.core.Position; import buildcraft.core.Utils;
<<<<<<< private int tryAddToSlot(int i, ItemStack stack) { ItemIdentifierStack slot = _contents[i]; ======= private int tryAddToSlot(int i, ItemStack stack, int realstacklimit) { ItemStack slot = _contents[i]; >>>>>>> private int tryAddToSlot(int i, ItemStack stack, int realstacklimit) { ItemIdentifierStack slot = _contents[i];
<<<<<<< import logisticspipes.utils.FluidIdentifier; ======= import logisticspipes.utils.LiquidIdentifier; import logisticspipes.utils.Pair; >>>>>>> import logisticspipes.utils.FluidIdentifier; import logisticspipes.utils.Pair;
<<<<<<< public boolean isMultiBlock() { return false; } public boolean actAsNormalPipe() { return true; } public boolean isHSTube() { return false; } @SideOnly(Side.CLIENT) public ISpecialPipeRenderer getSpecialRenderer() { return null; } public boolean hasSpecialPipeEndAt(ForgeDirection dir) { return false; } public LPPosition getItemRenderPos(float fPos, LPTravelingItem travelItem) { LPPosition pos = new LPPosition(0.5D, 0.5D, 0.5D); if (fPos < 0.5) { if (travelItem.input == ForgeDirection.UNKNOWN) { return null; } if (!container.renderState.pipeConnectionMatrix.isConnected(travelItem.input.getOpposite())) { return null; } pos.moveForward(travelItem.input.getOpposite(), 0.5F - fPos); } else { if (travelItem.output == ForgeDirection.UNKNOWN) { return null; } if (!container.renderState.pipeConnectionMatrix.isConnected(travelItem.output)) { return null; } pos.moveForward(travelItem.output, fPos - 0.5F); } return pos; } public double getBoxRenderScale(float fPos, LPTravelingItem travelItem) { double boxScale = 1; if (container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.input.getOpposite())) { boxScale = (fPos * (1 - 0.65)) + 0.65; } if (container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.output)) { boxScale = ((1 - fPos) * (1 - 0.65)) + 0.65; } if (container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.input.getOpposite()) && container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.output)) { boxScale = 0.65; } return boxScale; } public double getItemRenderPitch(float fPos, LPTravelingItem travelItem) { return 0; } public double getItemRenderYaw(float fPos, LPTravelingItem travelItem) { return 0; } ======= public boolean canHoldBCParts() { return true; } >>>>>>> public boolean canHoldBCParts() { return true; } public boolean isMultiBlock() { return false; } public boolean actAsNormalPipe() { return true; } public boolean isHSTube() { return false; } @SideOnly(Side.CLIENT) public ISpecialPipeRenderer getSpecialRenderer() { return null; } public boolean hasSpecialPipeEndAt(ForgeDirection dir) { return false; } public LPPosition getItemRenderPos(float fPos, LPTravelingItem travelItem) { LPPosition pos = new LPPosition(0.5D, 0.5D, 0.5D); if (fPos < 0.5) { if (travelItem.input == ForgeDirection.UNKNOWN) { return null; } if (!container.renderState.pipeConnectionMatrix.isConnected(travelItem.input.getOpposite())) { return null; } pos.moveForward(travelItem.input.getOpposite(), 0.5F - fPos); } else { if (travelItem.output == ForgeDirection.UNKNOWN) { return null; } if (!container.renderState.pipeConnectionMatrix.isConnected(travelItem.output)) { return null; } pos.moveForward(travelItem.output, fPos - 0.5F); } return pos; } public double getBoxRenderScale(float fPos, LPTravelingItem travelItem) { double boxScale = 1; if (container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.input.getOpposite())) { boxScale = (fPos * (1 - 0.65)) + 0.65; } if (container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.output)) { boxScale = ((1 - fPos) * (1 - 0.65)) + 0.65; } if (container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.input.getOpposite()) && container.renderState.pipeConnectionMatrix.isTDConnected(travelItem.output)) { boxScale = 0.65; } return boxScale; } public double getItemRenderPitch(float fPos, LPTravelingItem travelItem) { return 0; } public double getItemRenderYaw(float fPos, LPTravelingItem travelItem) { return 0; }
<<<<<<< import lombok.Getter; import lombok.Setter; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; ======= >>>>>>> import net.minecraft.item.Item; <<<<<<< import buildcraft.transport.TileGenericPipe; ======= >>>>>>> <<<<<<< public PipeItemsSupplierLogistics(Item item) { super(item); throttleTime = 100; ======= public PipeItemsSupplierLogistics(int itemID) { super(itemID); module = new ModuleActiveSupplier(); module.registerHandler(this, this); module.registerPosition(ModulePositionType.IN_PIPE, 0); >>>>>>> public PipeItemsSupplierLogistics(Item item) { super(item); module = new ModuleActiveSupplier(); module.registerHandler(this, this); module.registerPosition(ModulePositionType.IN_PIPE, 0); <<<<<<< // import from PipeItemsSupplierLogistics private ItemIdentifierInventory dummyInventory = new ItemIdentifierInventory(9, "", 127); private final HashMap<ItemIdentifier, Integer> _requestedItems = new HashMap<ItemIdentifier, Integer>(); public enum SupplyMode { Partial, Full, Bulk50, Bulk100, Infinite } public enum PatternMode { Partial, Full, Bulk50, Bulk100 } private SupplyMode _requestMode = SupplyMode.Bulk50; private PatternMode _patternMode = PatternMode.Bulk50; @Getter @Setter private boolean isLimited = true; public boolean pause = false; public int[] slotArray = new int[9]; //TODO save @Override public void onWrenchClicked(EntityPlayer entityplayer) { //pause = true; //Pause until GUI is closed //TODO Find a way to handle this if(MainProxy.isServer(entityplayer.worldObj)) { entityplayer.openGui(LogisticsPipes.instance, GuiIDs.GUI_SupplierPipe_ID, getWorld(), getX(), getY(), getZ()); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(SupplierPipeMode.class).setHasPatternUpgrade(getUpgradeManager().hasPatternUpgrade()).setInteger((getUpgradeManager().hasPatternUpgrade() ? getPatternMode() : getSupplyMode()).ordinal()).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), entityplayer); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(SupplierPipeLimitedPacket.class).setLimited(isLimited()).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), entityplayer); } } /*** GUI ***/ public ItemIdentifierInventory getDummyInventory() { return dummyInventory; } @Override public void throttledUpdateEntity() { if (!((CoreRoutedPipe)this.container.pipe).isEnabled()){ return; } if(MainProxy.isClient(this.getWorld())) return; if (pause) return; super.throttledUpdateEntity(); for(int amount : _requestedItems.values()) { if(amount > 0) { MainProxy.sendSpawnParticlePacket(Particles.VioletParticle, getX(), getY(), getZ(), this.getWorld(), 2); } } WorldUtil worldUtil = new WorldUtil(getWorld(), getX(), getY(), getZ()); for (AdjacentTile tile : worldUtil.getAdjacentTileEntities(true)){ if (tile.tile instanceof TileGenericPipe) continue; if (!(tile.tile instanceof IInventory)) continue; IInventory inv = (IInventory) tile.tile; if (inv.getSizeInventory() < 1) continue; IInventoryUtil invUtil = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv); if(getUpgradeManager().hasPatternUpgrade()) { createPatternRequest(invUtil); } else { createSupplyRequest(invUtil); } } } private void createPatternRequest(IInventoryUtil invUtil) { debug.log("Supplier: Start calculating pattern request"); ((PipeItemsSupplierLogistics)this.container.pipe).setRequestFailed(false); for(int i=0;i < 9;i++) { ItemIdentifierStack needed = dummyInventory.getIDStackInSlot(i); if(needed == null) continue; if(invUtil.getSizeInventory() <= slotArray[i]) continue; ItemStack stack = invUtil.getStackInSlot(slotArray[i]); ItemIdentifierStack have = null; if(stack != null) { have = ItemIdentifierStack.getFromStack(stack); } int haveCount = 0; if(have != null) { if(have.getItem() != needed.getItem()) { debug.log("Supplier: Slot for " + i + ", " + needed + " already taken by " + have); ((PipeItemsSupplierLogistics)this.container.pipe).setRequestFailed(true); continue; } haveCount = have.getStackSize(); } if( ( _patternMode==PatternMode.Bulk50 && haveCount > needed.getStackSize()/2) || ( _patternMode==PatternMode.Bulk100 && haveCount >= needed.getStackSize())) { continue; } int neededCount = needed.getStackSize() - haveCount; if(neededCount < 1) continue; ItemIdentifierStack toRequest = new ItemIdentifierStack(needed.getItem(), neededCount); debug.log("Supplier: Missing for slot " + i + ": " + toRequest); if(!useEnergy(10)) { break; } boolean success = false; if(_patternMode != PatternMode.Full) { debug.log("Supplier: Requesting partial: " + toRequest); neededCount = RequestTree.requestPartial(toRequest, (IRequestItems) container.pipe); debug.log("Supplier: Requested: " + toRequest.getItem().makeStack(neededCount)); if(neededCount > 0) { success = true; } } else { debug.log("Supplier: Requesting: " + toRequest); success = RequestTree.request(toRequest, (IRequestItems) container.pipe, null); if(success) { debug.log("Supplier: Request success"); } else { debug.log("Supplier: Request failed"); } } if (success){ Integer currentRequest = _requestedItems.get(toRequest.getItem()); if(currentRequest == null) { _requestedItems.put(toRequest.getItem(), neededCount); } else { _requestedItems.put(toRequest.getItem(), currentRequest + neededCount); } } else { ((PipeItemsSupplierLogistics)this.container.pipe).setRequestFailed(true); } } } private void createSupplyRequest(IInventoryUtil invUtil) { debug.log("Supplier: Start calculating supply request"); //How many do I want? HashMap<ItemIdentifier, Integer> needed = new HashMap<ItemIdentifier, Integer>(dummyInventory.getItemsAndCount()); debug.log("Supplier: Needed: " + needed); //How many do I have? Map<ItemIdentifier, Integer> have = invUtil.getItemsAndCount(); debug.log("Supplier: Have: " + have); //How many do I have? HashMap<ItemIdentifier, Integer> haveUndamaged = new HashMap<ItemIdentifier, Integer>(); for (Entry<ItemIdentifier, Integer> item : have.entrySet()){ Integer n=haveUndamaged.get(item.getKey().getUndamaged()); if(n==null) haveUndamaged.put(item.getKey().getUndamaged(), item.getValue()); else haveUndamaged.put(item.getKey().getUndamaged(), item.getValue()+n); } //Reduce what I have and what have been requested already for (Entry<ItemIdentifier, Integer> item : needed.entrySet()){ Integer haveCount = haveUndamaged.get(item.getKey().getUndamaged()); if(haveCount==null) haveCount=0; int spaceAvailable=invUtil.roomForItem(item.getKey()); if(_requestMode==SupplyMode.Infinite){ item.setValue(Math.min(item.getKey().getMaxStackSize(),spaceAvailable)); continue; } if(spaceAvailable == 0 || ( _requestMode==SupplyMode.Bulk50 && haveCount>item.getValue()/2) || ( _requestMode==SupplyMode.Bulk100 && haveCount>=item.getValue())) { item.setValue(0); continue; } if (haveCount >0){ item.setValue(item.getValue() - haveCount); // so that 1 damaged item can't satisfy a request for 2 other damage values. haveUndamaged.put(item.getKey().getUndamaged(),haveCount - item.getValue()); } Integer requestedCount = _requestedItems.get(item.getKey()); if (requestedCount!=null){ item.setValue(item.getValue() - requestedCount); } } debug.log("Supplier: Missing: " + needed); ((PipeItemsSupplierLogistics)this.container.pipe).setRequestFailed(false); //Make request for (Entry<ItemIdentifier, Integer> need : needed.entrySet()){ Integer amountRequested = need.getValue(); if (amountRequested==null || amountRequested < 1) continue; int neededCount = amountRequested; if(!useEnergy(10)) { break; } boolean success = false; if(_requestMode!=SupplyMode.Full) { debug.log("Supplier: Requesting partial: " + need.getKey().makeStack(neededCount)); neededCount = RequestTree.requestPartial(need.getKey().makeStack(neededCount), (IRequestItems) container.pipe); debug.log("Supplier: Requested: " + need.getKey().makeStack(neededCount)); if(neededCount > 0) { success = true; } } else { debug.log("Supplier: Requesting: " + need.getKey().makeStack(neededCount)); success = RequestTree.request(need.getKey().makeStack(neededCount), (IRequestItems) container.pipe, null); if(success) { debug.log("Supplier: Request success"); } else { debug.log("Supplier: Request failed"); } } if (success){ Integer currentRequest = _requestedItems.get(need.getKey()); if(currentRequest == null) { _requestedItems.put(need.getKey(), neededCount); debug.log("Supplier: Inserting Requested Items: " + neededCount); } else { _requestedItems.put(need.getKey(), currentRequest + neededCount); debug.log("Supplier: Raising Requested Items from: " + currentRequest + " to: " + currentRequest + neededCount); } } else { ((PipeItemsSupplierLogistics)this.container.pipe).setRequestFailed(true); } } } ======= >>>>>>> <<<<<<< dummyInventory.writeToNBT(nbttagcompound, ""); nbttagcompound.setShort("requestmode", (short) _requestMode.ordinal()); nbttagcompound.setShort("patternmode", (short) _patternMode.ordinal()); nbttagcompound.setBoolean("limited", isLimited()); for(int i=0;i<9;i++) { nbttagcompound.setInteger("slotArray_" + i, slotArray[i]); } } private void decreaseRequested(ItemIdentifierStack item) { int remaining = item.getStackSize(); //see if we can get an exact match Integer count = _requestedItems.get(item.getItem()); if (count != null) { _requestedItems.put(item.getItem(), Math.max(0, count - remaining)); debug.log("Supplier: Exact match. Still missing: " + _requestedItems.get(item.getItem())); remaining -= count; if(Math.max(0, count - remaining) == 0) { _requestedItems.remove(item.getItem()); } } if(remaining <= 0) { return; } //still remaining... was from fuzzyMatch on a crafter for(Entry<ItemIdentifier, Integer> e : _requestedItems.entrySet()) { if(e.getKey().item == item.getItem().item && e.getKey().itemDamage == item.getItem().itemDamage) { int expected = e.getValue(); e.setValue(Math.max(0, expected - remaining)); debug.log("Supplier: Fuzzy match with" + e + ". Still missing: " + e.getValue()); remaining -= expected; if(Math.max(0, expected - remaining) == 0) { _requestedItems.remove(item.getItem()); } } if(remaining <= 0) { return; } } //we have no idea what this is, log it. debug.log("Supplier: supplier got unexpected item " + item.toString()); ======= module.writeToNBT(nbttagcompound); >>>>>>> module.writeToNBT(nbttagcompound);
<<<<<<< execute(() -> SDKLauncher.exec(String.format("osascript -e 'tell application \"Terminal\" to do script \"sdk use %s %s\"';osascript -e 'tell application \"Terminal\" to activate'", version.getCandidate(), version.getIdentifier()))); ======= SDKLauncher.exec("bash", "-c", String.format("osascript -e 'tell application \"Terminal\" to do script \"sdk use %s %s\"';osascript -e 'tell application \"Terminal\" to activate'", version.getCandidate(), version.getIdentifier())); >>>>>>> SDKLauncher.exec(String.format("osascript -e 'tell application \"Terminal\" to do script \"sdk use %s %s\"';osascript -e 'tell application \"Terminal\" to activate'", version.getCandidate(), version.getIdentifier()));
<<<<<<< import java.util.function.Consumer; ======= import java.nio.file.Files; >>>>>>> import java.util.function.Consumer; import java.nio.file.Files;
<<<<<<< public abstract class DataPacket extends BinaryStream { ======= public abstract class DataPacket extends BinaryStream implements Cloneable { >>>>>>> public abstract class DataPacket implements Cloneable { public int offset = 0; public byte[] buffer = new byte[0]; <<<<<<< @Override public void reset() { super.reset(); putByte(pid()); ======= @Override public void reset() { super.reset(); this.putByte(this.pid()); >>>>>>> protected void reset() { this.buffer = new byte[]{this.pid()}; this.offset = 0; <<<<<<< ======= public DataPacket clean() { this.setBuffer(null); this.isEncoded = false; this.offset = 0; return this; } >>>>>>> public DataPacket clean() { this.setBuffer(null); this.isEncoded = false; this.offset = 0; return this; }
<<<<<<< import android.view.View; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; ======= import android.view.View; import android.widget.TextView; import android.widget.Toast; >>>>>>> import android.view.View; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; import android.widget.TextView; import android.widget.Toast; <<<<<<< private MenuItem refreshActionButton; private int cityId = -1; private ViewPager viewPager; ======= private ViewPager viewPager; private TextView noCityText; >>>>>>> private MenuItem refreshActionButton; private int cityId = -1; private ViewPager viewPager; private TextView noCityText; <<<<<<< TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); tabLayout.setupWithViewPager(viewPager, true); } ======= private void initResources() { viewPager = (ViewPager) findViewById(R.id.viewPager); pagerAdapter = new WeatherPagerAdapter(this); noCityText = (TextView) findViewById(R.id.noCitySelectedText); } >>>>>>> private void initResources() { viewPager = (ViewPager) findViewById(R.id.viewPager); pagerAdapter = new WeatherPagerAdapter(this, getSupportFragmentManager()); noCityText = (TextView) findViewById(R.id.noCitySelectedText); } <<<<<<< if(refreshActionButton != null && refreshActionButton.getActionView() != null) { refreshActionButton.getActionView().clearAnimation(); } ======= // why is this empty? //Toast.makeText(this, data.toString(), Toast.LENGTH_SHORT).show(); >>>>>>> if(refreshActionButton != null && refreshActionButton.getActionView() != null) { refreshActionButton.getActionView().clearAnimation(); }
<<<<<<< List<Forecast> forecasts = database.forecastDao().getForecastsByCityId(currentWeatherDataList.getCity_id()); ======= List<Forecast> forecasts = database.getForecastsByCityId(currentWeatherDataList.getCity_id()); List<WeekForecast> weekforecasts = database.getWeekForecastsByCityId(currentWeatherDataList.getCity_id()); >>>>>>> List<Forecast> forecasts = database.forecastDao().getForecastsByCityId(currentWeatherDataList.getCity_id()); List<WeekForecast> weekforecasts = database.getWeekForecastsByCityId(currentWeatherDataList.getCity_id()); <<<<<<< holder.sunrise.setText(TimeUtil.formatTimeSimple(zoneseconds, currentWeatherDataList.getTimeSunrise())); holder.sunset.setText(TimeUtil.formatTimeSimple(zoneseconds, currentWeatherDataList.getTimeSunset())); ======= Date riseTime = new Date((currentWeatherDataList.getTimeSunrise() + zoneseconds) * 1000L); Date setTime = new Date((currentWeatherDataList.getTimeSunset() + zoneseconds) * 1000L); holder.sunrise.setText(timeFormat.format(riseTime)); holder.sunset.setText(timeFormat.format(setTime));*/ >>>>>>> holder.sunrise.setText(TimeUtil.formatTimeSimple(zoneseconds, currentWeatherDataList.getTimeSunrise())); holder.sunset.setText(TimeUtil.formatTimeSimple(zoneseconds, currentWeatherDataList.getTimeSunset()));*/
<<<<<<< import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.time.Instant; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; ======= >>>>>>> import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.time.Instant; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; <<<<<<< setIcon(courseOfDayList.get(position).getWeatherID(), holder.weather, isDay); holder.humidity.setText(StringFormatUtils.formatDecimal(courseOfDayList.get(position).getHumidity(), "%")); ======= //Time has to be the local time in the city! holder.time.setText(StringFormatUtils.formatTime(context, courseOfDayList.get(position).getLocalForecastTime(context))); setIcon(courseOfDayList.get(position).getWeatherID(), holder.weather); holder.humidity.setText(StringFormatUtils.formatInt(courseOfDayList.get(position).getHumidity(), "%")); >>>>>>> //Time has to be the local time in the city! holder.time.setText(StringFormatUtils.formatTime(context, courseOfDayList.get(position).getLocalForecastTime(context))); setIcon(courseOfDayList.get(position).getWeatherID(), holder.weather, isDay); holder.humidity.setText(StringFormatUtils.formatInt(courseOfDayList.get(position).getHumidity(), "%")); <<<<<<< public void setIcon(int value, ImageView imageView, boolean isDay) { imageView.setImageResource(UiResourceProvider.getIconResourceForWeatherCategory(value, isDay)); ======= private void setIcon(int value, ImageView imageView) { imageView.setImageResource(UiResourceProvider.getIconResourceForWeatherCategory(value)); >>>>>>> public void setIcon(int value, ImageView imageView, boolean isDay) { imageView.setImageResource(UiResourceProvider.getIconResourceForWeatherCategory(value, isDay));
<<<<<<< import br.com.caelum.vraptor.cache.VRaptorCache; import br.com.caelum.vraptor.cache.VRaptorDefaultCache; import br.com.caelum.vraptor.factory.Factories; ======= import br.com.caelum.vraptor.cache.CacheStore; import br.com.caelum.vraptor.cache.DefaultCacheStore; >>>>>>> import br.com.caelum.vraptor.cache.CacheStore; import br.com.caelum.vraptor.cache.DefaultCacheStore; import br.com.caelum.vraptor.factory.Factories; <<<<<<< VRaptorCache<Class<?>, InterceptorHandler> cachedHandlers = new VRaptorDefaultCache<>(); factory = new DefaultInterceptorHandlerFactory(container, stepInvoker, parametersResolver, cachedHandlers); ======= CacheStore<Class<?>, InterceptorHandler> cachedHandlers = new DefaultCacheStore<>(); factory = new DefaultInterceptorHandlerFactory(container, new StepInvoker(), parametersResolver, cachedHandlers); >>>>>>> CacheStore<Class<?>, InterceptorHandler> cachedHandlers = new DefaultCacheStore<>(); factory = new DefaultInterceptorHandlerFactory(container, stepInvoker, parametersResolver, cachedHandlers);
<<<<<<< import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; ======= >>>>>>> <<<<<<< ======= import br.com.caelum.vraptor4.interceptor.PackagesAcceptor; import br.com.caelum.vraptor4.ioc.cdi.BeanManagerUtil; >>>>>>> import br.com.caelum.vraptor4.interceptor.PackagesAcceptor;
<<<<<<< ======= import java.util.Collections; import java.util.List; import javax.annotation.PostConstruct; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; >>>>>>> import java.util.Collections; import java.util.List; import org.springframework.beans.factory.ObjectProvider;
<<<<<<< LOG.warn("Spring Cloud LoadBalancer is currently working with the default cache. " + "You can switch to using Caffeine cache, by adding it to the classpath."); ======= LOG.warn( "Spring Cloud LoadBalancer is currently working with the default cache. " + "You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath."); >>>>>>> LOG.warn("Spring Cloud LoadBalancer is currently working with the default cache. " + "You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.");
<<<<<<< import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.util.TestPropertyValues.Type; ======= import org.springframework.boot.logging.LoggingSystem; import org.springframework.boot.test.util.EnvironmentTestUtils; >>>>>>> import org.springframework.boot.logging.LoggingSystem; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.util.TestPropertyValues.Type; <<<<<<< ======= private ConfigurableApplicationContext context; @After public void close() { if (context != null) { context.close(); } System.clearProperty(LoggingSystem.SYSTEM_PROPERTY); TestLoggingSystem.count = 0; } >>>>>>> @After public void close() { System.clearProperty(LoggingSystem.SYSTEM_PROPERTY); TestLoggingSystem.count = 0; }
<<<<<<< import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; ======= import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; >>>>>>> import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; <<<<<<< import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; import org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerProperties; ======= import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryFactory; import org.springframework.cloud.client.loadbalancer.LoadBalancerRetryProperties; import org.springframework.cloud.client.loadbalancer.reactive.OnNoRibbonDefaultCondition; >>>>>>> import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryFactory; import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; import org.springframework.cloud.client.loadbalancer.LoadBalancerRetryProperties; import org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerProperties; <<<<<<< ======= import org.springframework.context.annotation.Primary; import org.springframework.core.annotation.Order; import org.springframework.retry.support.RetryTemplate; >>>>>>> import org.springframework.retry.support.RetryTemplate; <<<<<<< @ConditionalOnBean(LoadBalancerClientFactory.class) @ConditionalOnMissingBean public LoadBalancerClient blockingLoadBalancerClient(LoadBalancerClientFactory loadBalancerClientFactory, LoadBalancerProperties properties) { return new BlockingLoadBalancerClient(loadBalancerClientFactory, properties); ======= @ConditionalOnClass( name = "org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient") @ConditionalOnProperty(value = "spring.cloud.loadbalancer.ribbon.enabled", matchIfMissing = true) public BlockingLoadBalancerClientRibbonWarnLogger blockingLoadBalancerClientRibbonWarnLogger() { return new BlockingLoadBalancerClientRibbonWarnLogger(); } @Configuration(proxyBeanMethods = false) @ConditionalOnClass(RestTemplate.class) @Conditional(OnNoRibbonDefaultCondition.class) protected static class BlockingLoadbalancerClientConfig { @Bean @ConditionalOnBean(LoadBalancerClientFactory.class) @Primary public BlockingLoadBalancerClient blockingLoadBalancerClient( LoadBalancerClientFactory loadBalancerClientFactory) { return new BlockingLoadBalancerClient(loadBalancerClientFactory); } @Configuration @ConditionalOnClass(RetryTemplate.class) @EnableConfigurationProperties(LoadBalancerRetryProperties.class) protected static class BlockingLoadBalancerRetryConfig { @Bean // Allow users to override the factory while avoiding loading // RibbonLoadBalancedRetryFactory. @Order(1000) LoadBalancedRetryFactory loadBalancedRetryFactory( LoadBalancerRetryProperties retryProperties) { return new BlockingLoadBalancedRetryFactory(retryProperties); } } } static class BlockingLoadBalancerClientRibbonWarnLogger { private static final Log LOG = LogFactory .getLog(BlockingLoadBalancerClientRibbonWarnLogger.class); @PostConstruct void logWarning() { if (LOG.isWarnEnabled()) { LOG.warn( "You already have RibbonLoadBalancerClient on your classpath. It will be used by default. " + "As Spring Cloud Ribbon is in maintenance mode. We recommend switching to " + BlockingLoadBalancerClient.class.getSimpleName() + " instead. In order to use it, set the value of `spring.cloud.loadbalancer.ribbon.enabled` to `false` or " + "remove spring-cloud-starter-netflix-ribbon from your project."); } } >>>>>>> @ConditionalOnBean(LoadBalancerClientFactory.class) @ConditionalOnMissingBean public LoadBalancerClient blockingLoadBalancerClient(LoadBalancerClientFactory loadBalancerClientFactory, LoadBalancerProperties properties) { return new BlockingLoadBalancerClient(loadBalancerClientFactory, properties); } @Configuration @ConditionalOnClass(RetryTemplate.class) @EnableConfigurationProperties(LoadBalancerRetryProperties.class) protected static class BlockingLoadBalancerRetryConfig { @Bean @ConditionalOnMissingBean LoadBalancedRetryFactory loadBalancedRetryFactory(LoadBalancerRetryProperties retryProperties) { return new BlockingLoadBalancedRetryFactory(retryProperties); }
<<<<<<< @ConditionalOnClass( name = "org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient") public BlockingLoadBalancerClientRibbonWarnLogger blockingLoadBalancerClientRibbonWarnLogger() { return new BlockingLoadBalancerClientRibbonWarnLogger(); ======= @ConditionalOnClass(name = "org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient") @ConditionalOnProperty(value = "spring.cloud.loadbalancer.ribbon.enabled", matchIfMissing = true) public RibbonWarnLogger ribbonWarnLogger() { return new RibbonWarnLogger(); >>>>>>> @ConditionalOnClass( name = "org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient") @ConditionalOnProperty(value = "spring.cloud.loadbalancer.ribbon.enabled", matchIfMissing = true) public BlockingLoadBalancerClientRibbonWarnLogger blockingLoadBalancerClientRibbonWarnLogger() { return new BlockingLoadBalancerClientRibbonWarnLogger();
<<<<<<< .features(); assertThat(features, is(notNullValue())); assertThat(features.getEnabled().size(), is(equalTo(2))); assertThat(features.getDisabled().size(), is(equalTo(1))); ======= .invoke(); assertThat(features).isNotNull(); assertThat(features.getEnabled()).hasSize(2) .contains(newFeature("foo", Foo.class), newFeature("Baz Feature", Baz.class)); assertThat(features.getDisabled()).hasSize(1).contains("Bar"); } private FeaturesEndpoint.Feature newFeature(String name, Class<?> type) { return new FeaturesEndpoint.Feature(name, type.getCanonicalName(), null, null); >>>>>>> .features(); assertThat(features).isNotNull(); assertThat(features.getEnabled()).hasSize(2) .contains(newFeature("foo", Foo.class), newFeature("Baz Feature", Baz.class)); assertThat(features.getDisabled()).hasSize(1).contains("Bar"); } private FeaturesEndpoint.Feature newFeature(String name, Class<?> type) { return new FeaturesEndpoint.Feature(name, type.getCanonicalName(), null, null);
<<<<<<< import com.fasterxml.jackson.databind.ObjectMapper; ======= import java.net.URI; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; >>>>>>> import com.fasterxml.jackson.databind.ObjectMapper; <<<<<<< return () -> "testRegistration1"; ======= return new Registration() { @Override public String getServiceId() { return "testRegistration1"; } @Override public String getHost() { return null; } @Override public int getPort() { return 0; } @Override public boolean isSecure() { return false; } @Override public URI getUri() { return null; } @Override public Map<String, String> getMetadata() { return null; } }; } @Bean ServiceRegistryEndpoint serviceRegistryEndpoint(Registration reg) { ServiceRegistryEndpoint endpoint = new ServiceRegistryEndpoint(serviceRegistry()); endpoint.setRegistration(reg); return endpoint; >>>>>>> return new Registration() { @Override public String getServiceId() { return "testRegistration1"; } @Override public String getHost() { return null; } @Override public int getPort() { return 0; } @Override public boolean isSecure() { return false; } @Override public URI getUri() { return null; } @Override public Map<String, String> getMetadata() { return null; } };
<<<<<<< // import org.springframework.boot.context.embedded.EmbeddedServletContainer; // import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext; import org.springframework.boot.context.properties.EnableConfigurationProperties; ======= import org.springframework.boot.context.embedded.EmbeddedServletContainer; import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext; >>>>>>> // import org.springframework.boot.context.embedded.EmbeddedServletContainer; // import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext;
<<<<<<< import java.net.URI; import java.util.Collection; ======= >>>>>>> import java.util.Collection; <<<<<<< properties.getInstances().put("myservice", Collections.singletonList( new SimpleDiscoveryProperties.SimpleServiceInstance(URI.create("https://test.example:9999")))); ======= DefaultServiceInstance serviceInstance = new DefaultServiceInstance(null, null, "test.example", 9999, true); properties.getInstances().put("myservice", Collections.singletonList(serviceInstance)); >>>>>>> DefaultServiceInstance serviceInstance = new DefaultServiceInstance(null, null, "test.example", 9999, true); properties.getInstances().put("myservice", Collections.singletonList(serviceInstance));
<<<<<<< return this.refreshables.contains(type); } return false; } private void bindEnvironmentIfNeeded(BeanDefinitionRegistry registry) { if (!bound) { // only bind once if (this.environment == null && registry instanceof BeanFactory) { this.environment = ((BeanFactory) registry) .getBean(Environment.class); } ======= >>>>>>> return this.refreshables.contains(type); } return false; } private void bindEnvironmentIfNeeded(BeanDefinitionRegistry registry) { if (!bound) { // only bind once
<<<<<<< ======= import org.junit.jupiter.api.Test; import java.util.UUID; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; >>>>>>> import org.junit.jupiter.api.Test; import java.util.UUID; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; <<<<<<< ======= @Test public void shouldNotGetRandomHero() { String uuid = UUID.randomUUID().toString(); given() .pathParam("name", uuid) .when().get("/api/heroes/{name}") .then() .statusCode(200); } @Test public void shouldPingHeroEndpoint() { given() .when().get("/api/heroes/ping") .then() .statusCode(200) .body(is("ping heroes")); } >>>>>>> @Test public void shouldNotGetRandomHero() { String uuid = UUID.randomUUID().toString(); given() .pathParam("name", uuid) .when().get("/api/heroes/{name}") .then() .statusCode(200); } @Test public void shouldPingHeroEndpoint() { given() .when().get("/api/heroes/ping") .then() .statusCode(200) .body(is("ping heroes")); }
<<<<<<< ======= import spade.core.Edge; import spade.reporter.audit.OPMConstants; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Map; >>>>>>> import spade.reporter.audit.OPMConstants; <<<<<<< private static final long serialVersionUID = 616956634821720644L; private String level; ======= >>>>>>> private static final long serialVersionUID = -6200790370474776849L; <<<<<<< newVertex.addAnnotations(vertex.getCopyOfAnnotations()); ======= newVertex.addAnnotations(vertex.getAnnotations()); newVertex.setDepth(vertex.getDepth()); >>>>>>> newVertex.addAnnotations(vertex.getCopyOfAnnotations()); <<<<<<< newEdge.setChildVertex(copyVertex(edge.getChildVertex())); newEdge.setParentVertex(copyVertex(edge.getParentVertex())); newEdge.addAnnotations(edge.getCopyOfAnnotations()); ======= newEdge.addAnnotations(edge.getAnnotations()); >>>>>>> newEdge.addAnnotations(edge.getCopyOfAnnotations());
<<<<<<< graph = super.putGraph(graph, queryMetaData); ======= graph = super.transform(graph, queryMetaData); graph.commitIndex(); >>>>>>> graph = super.transform(graph, queryMetaData);
<<<<<<< try (ServerSocket shutdownServer = new ServerSocket(shutdownPort)) { shutdownServer.accept(); } ======= ServerSocket shutdownServer = new ServerSocket(shutdownPort); shutdownServer.accept().close(); >>>>>>> try (ServerSocket shutdownServer = new ServerSocket(shutdownPort)) { shutdownServer.accept().close(); }
<<<<<<< private String ADD_KM_KEY = "localEndpoints"; private boolean ADD_KM; // Default value set where flags are being initialized from arguments (unlike the variables above). private String HANDLE_KM_RECORDS_KEY = "handleLocalEndpoints"; private boolean HANDLE_KM_RECORDS; // Default value set where flags are being initialized from arguments (unlike the variables above). ======= >>>>>>> private String ADD_KM_KEY = "localEndpoints"; private boolean ADD_KM; // Default value set where flags are being initialized from arguments (unlike the variables above). private String HANDLE_KM_RECORDS_KEY = "handleLocalEndpoints"; private boolean HANDLE_KM_RECORDS; // Default value set where flags are being initialized from arguments (unlike the variables above). <<<<<<< private final String AUDIT_SYSCALL_SOURCE = OPMConstants.SOURCE_AUDIT_SYSCALL; private final String kernelModulePath = "lib/kernel-modules/netio.ko"; private final String kernelModuleControllerPath = "lib/kernel-modules/netio_controller.ko"; private static final String PROTOCOL_NAME_UDP = "udp", PROTOCOL_NAME_TCP = "tcp"; ======= >>>>>>> private final String AUDIT_SYSCALL_SOURCE = OPMConstants.SOURCE_AUDIT_SYSCALL; private final String kernelModulePath = "lib/kernel-modules/netio.ko"; private final String kernelModuleControllerPath = "lib/kernel-modules/netio_controller.ko"; private static final String PROTOCOL_NAME_UDP = "udp", PROTOCOL_NAME_TCP = "tcp"; <<<<<<< // Setting default values here instead of where variables are defined because default values for KM vars depend // on whether the data is live or playback. boolean logPlayback = argsSpecifyLogPlayback(args); if(logPlayback){ // default values ADD_KM = false; HANDLE_KM_RECORDS = false; }else{ // live audit ADD_KM = false; HANDLE_KM_RECORDS = false; } // Parsing the values for the KM vars after the default values have be set appropriately (see above) argValue = args.get(ADD_KM_KEY); if(isValidBoolean(argValue)){ ADD_KM = parseBoolean(argValue, ADD_KM); }else{ logger.log(Level.SEVERE, "Invalid flag value for '"+ADD_KM_KEY+"': " + argValue); return false; } argValue = args.get(HANDLE_KM_RECORDS_KEY); if(isValidBoolean(argValue)){ HANDLE_KM_RECORDS = parseBoolean(argValue, HANDLE_KM_RECORDS); }else{ logger.log(Level.SEVERE, "Invalid flag value for '"+HANDLE_KM_RECORDS_KEY+"': " + argValue); return false; } if((ADD_KM && NETFILTER_RULES) // both can't be true || (HANDLE_KM_RECORDS && REFINE_NET)){ // both can't be true logger.log(Level.SEVERE, "Incompatible flags value (Can only handle data from either module or iptables): " + "netfilter={0}, refineNet={1}, {2}={3}, {4}={5}", new Object[]{NETFILTER_RULES, REFINE_NET, ADD_KM_KEY, ADD_KM, HANDLE_KM_RECORDS_KEY, HANDLE_KM_RECORDS}); return false; }else{ if(ADD_KM && !HANDLE_KM_RECORDS){ logger.log(Level.SEVERE, "Must handle kernel module data if kernel module added."); return false; }else{ // Logging only relevant flags now for debugging logger.log(Level.INFO, "Audit flags: {0}={1}, {2}={3}, {4}={5}, {6}={7}, {8}={9}, {10}={11}, {12}={13}, " + "{14}={15}, {16}={17}, {18}={19}, {20}={21}, {22}={23}", new Object[]{"fileIO", USE_READ_WRITE, "netIO", USE_SOCK_SEND_RCV, "units", CREATE_BEEP_UNITS, "unixSockets", UNIX_SOCKETS, "waitForLog", WAIT_FOR_LOG_END, "versions", KEEP_VERSIONS, "epochs", KEEP_EPOCHS, "permissions", KEEP_PATH_PERMISSIONS, "netfilter", NETFILTER_RULES, "refineNet", REFINE_NET, ADD_KM_KEY, ADD_KM, HANDLE_KM_RECORDS_KEY, HANDLE_KM_RECORDS}); return true; } } ======= return true; >>>>>>> // Setting default values here instead of where variables are defined because default values for KM vars depend // on whether the data is live or playback. boolean logPlayback = argsSpecifyLogPlayback(args); if(logPlayback){ // default values ADD_KM = false; HANDLE_KM_RECORDS = false; }else{ // live audit ADD_KM = false; HANDLE_KM_RECORDS = false; } // Parsing the values for the KM vars after the default values have be set appropriately (see above) argValue = args.get(ADD_KM_KEY); if(isValidBoolean(argValue)){ ADD_KM = parseBoolean(argValue, ADD_KM); }else{ logger.log(Level.SEVERE, "Invalid flag value for '"+ADD_KM_KEY+"': " + argValue); return false; } argValue = args.get(HANDLE_KM_RECORDS_KEY); if(isValidBoolean(argValue)){ HANDLE_KM_RECORDS = parseBoolean(argValue, HANDLE_KM_RECORDS); }else{ logger.log(Level.SEVERE, "Invalid flag value for '"+HANDLE_KM_RECORDS_KEY+"': " + argValue); return false; } if((ADD_KM && NETFILTER_RULES) // both can't be true || (HANDLE_KM_RECORDS && REFINE_NET)){ // both can't be true logger.log(Level.SEVERE, "Incompatible flags value (Can only handle data from either module or iptables): " + "netfilter={0}, refineNet={1}, {2}={3}, {4}={5}", new Object[]{NETFILTER_RULES, REFINE_NET, ADD_KM_KEY, ADD_KM, HANDLE_KM_RECORDS_KEY, HANDLE_KM_RECORDS}); return false; }else{ if(ADD_KM && !HANDLE_KM_RECORDS){ logger.log(Level.SEVERE, "Must handle kernel module data if kernel module added."); return false; }else{ // Logging only relevant flags now for debugging logger.log(Level.INFO, "Audit flags: {0}={1}, {2}={3}, {4}={5}, {6}={7}, {8}={9}, {10}={11}, {12}={13}, " + "{14}={15}, {16}={17}, {18}={19}, {20}={21}, {22}={23}", new Object[]{"fileIO", USE_READ_WRITE, "netIO", USE_SOCK_SEND_RCV, "units", CREATE_BEEP_UNITS, "unixSockets", UNIX_SOCKETS, "waitForLog", WAIT_FOR_LOG_END, "versions", KEEP_VERSIONS, "epochs", KEEP_EPOCHS, "permissions", KEEP_PATH_PERMISSIONS, "netfilter", NETFILTER_RULES, "refineNet", REFINE_NET, ADD_KM_KEY, ADD_KM, HANDLE_KM_RECORDS_KEY, HANDLE_KM_RECORDS}); return true; } } <<<<<<< if(REFINE_NET){ handleNetfilterPacketEvent(eventData); } }else if(AuditEventReader.KMODULE_RECORD_TYPE.equals(recordType)){ if(HANDLE_KM_RECORDS){ handleKernelModuleEvent(eventData); } ======= handleNetfilterPacketEvent(eventData); >>>>>>> if(REFINE_NET){ handleNetfilterPacketEvent(eventData); } }else if(AuditEventReader.KMODULE_RECORD_TYPE.equals(recordType)){ if(HANDLE_KM_RECORDS){ handleKernelModuleEvent(eventData); } <<<<<<< private void handleKernelModuleEvent(Map<String, String> eventData){ String eventId = eventData.get(AuditEventReader.EVENT_ID); String time = eventData.get(AuditEventReader.TIME); SYSCALL syscall = null; try{ String pid = eventData.get(AuditEventReader.PID); Integer syscallNumber = CommonFunctions.parseInt(eventData.get(AuditEventReader.SYSCALL), null); String exit = eventData.get(AuditEventReader.EXIT); int success = CommonFunctions.parseInt(eventData.get(AuditEventReader.SUCCESS), -1); String sockFd = eventData.get(AuditEventReader.KMODULE_FD); int sockType = Integer.parseInt(eventData.get(AuditEventReader.KMODULE_SOCKTYPE)); String localSaddr = eventData.get(AuditEventReader.KMODULE_LOCAL_SADDR); String remoteSaddr = eventData.get(AuditEventReader.KMODULE_REMOTE_SADDR); if(success == 1){ syscall = getSyscall(syscallNumber); if(syscall == null || syscall == SYSCALL.UNSUPPORTED){ log(Level.WARNING, "Invalid syscall: " + syscallNumber, null, time, eventId, null); }else{ switch (syscall) { case BIND: handleBindKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr); break; case ACCEPT: case ACCEPT4: handleAcceptKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr); break; case CONNECT: handleConnectKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr); break; case SENDMSG: case SENDTO: // case SENDMMSG: // TODO handleNetworkIOKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr, false); break; case RECVMSG: case RECVFROM: // case RECVMMSG: handleNetworkIOKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr, true); break; default: log(Level.WARNING, "Unexpected syscall: " + syscallNumber, null, time, eventId, syscall); break; } } } }catch(Exception e){ log(Level.WARNING, "Failed to parse kernel module event", null, time, eventId, syscall); } } private SYSCALL getSyscall(int syscallNumber){ int arch = -1; if(ARCH_32BIT){ arch = 32; }else{ arch = 64; } return SYSCALL.getSyscall(syscallNumber, arch); } ======= >>>>>>> private void handleKernelModuleEvent(Map<String, String> eventData){ String eventId = eventData.get(AuditEventReader.EVENT_ID); String time = eventData.get(AuditEventReader.TIME); SYSCALL syscall = null; try{ String pid = eventData.get(AuditEventReader.PID); Integer syscallNumber = CommonFunctions.parseInt(eventData.get(AuditEventReader.SYSCALL), null); String exit = eventData.get(AuditEventReader.EXIT); int success = CommonFunctions.parseInt(eventData.get(AuditEventReader.SUCCESS), -1); String sockFd = eventData.get(AuditEventReader.KMODULE_FD); int sockType = Integer.parseInt(eventData.get(AuditEventReader.KMODULE_SOCKTYPE)); String localSaddr = eventData.get(AuditEventReader.KMODULE_LOCAL_SADDR); String remoteSaddr = eventData.get(AuditEventReader.KMODULE_REMOTE_SADDR); if(success == 1){ syscall = getSyscall(syscallNumber); if(syscall == null || syscall == SYSCALL.UNSUPPORTED){ log(Level.WARNING, "Invalid syscall: " + syscallNumber, null, time, eventId, null); }else{ switch (syscall) { case BIND: handleBindKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr); break; case ACCEPT: case ACCEPT4: handleAcceptKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr); break; case CONNECT: handleConnectKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr); break; case SENDMSG: case SENDTO: // case SENDMMSG: // TODO handleNetworkIOKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr, false); break; case RECVMSG: case RECVFROM: // case RECVMMSG: handleNetworkIOKernelModule(eventData, time, eventId, syscall, pid, exit, sockFd, sockType, localSaddr, remoteSaddr, true); break; default: log(Level.WARNING, "Unexpected syscall: " + syscallNumber, null, time, eventId, syscall); break; } } } }catch(Exception e){ log(Level.WARNING, "Failed to parse kernel module event", null, time, eventId, syscall); } } private SYSCALL getSyscall(int syscallNumber){ int arch = -1; if(ARCH_32BIT){ arch = 32; }else{ arch = 64; } return SYSCALL.getSyscall(syscallNumber, arch); } <<<<<<< } class AddressPort{ public final String address, port; public AddressPort(String address, String port){ this.address = address; this.port = port; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((address == null) ? 0 : address.hashCode()); result = prime * result + ((port == null) ? 0 : port.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AddressPort other = (AddressPort) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (port == null) { if (other.port != null) return false; } else if (!port.equals(other.port)) return false; return true; } ======= >>>>>>> } class AddressPort{ public final String address, port; public AddressPort(String address, String port){ this.address = address; this.port = port; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((address == null) ? 0 : address.hashCode()); result = prime * result + ((port == null) ? 0 : port.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AddressPort other = (AddressPort) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (port == null) { if (other.port != null) return false; } else if (!port.equals(other.port)) return false; return true; }
<<<<<<< protected Map<String, String> annotations = new HashMap<>(); private AbstractVertex childVertex; private AbstractVertex parentVertex; /** * Checks if edge is empty * * @return Returns true if edge contains no annotation, * and both end points are empty */ public final boolean isEmpty() { return annotations.size() == 0 && childVertex != null && parentVertex != null; } ======= protected Map<String, String> annotations = new TreeMap<>(); private AbstractVertex sourceVertex; private AbstractVertex destinationVertex; >>>>>>> protected Map<String, String> annotations = new TreeMap<>(); private AbstractVertex childVertex; private AbstractVertex parentVertex; /** * Checks if edge is empty * * @return Returns true if edge contains no annotation, * and both end points are empty */ public final boolean isEmpty() { return annotations.size() == 0 && childVertex != null && parentVertex != null; }
<<<<<<< protected Map<String, String> annotations = new HashMap<>(); private AbstractVertex childVertex; private AbstractVertex parentVertex; /** * Checks if edge is empty * * @return Returns true if edge contains no annotation, * and both end points are empty */ public final boolean isEmpty() { return annotations.size() == 0 && childVertex != null && parentVertex != null; } ======= protected Map<String, String> annotations = new TreeMap<>(); private AbstractVertex sourceVertex; private AbstractVertex destinationVertex; >>>>>>> protected Map<String, String> annotations = new TreeMap<>(); private AbstractVertex childVertex; private AbstractVertex parentVertex; /** * Checks if edge is empty * * @return Returns true if edge contains no annotation, * and both end points are empty */ public final boolean isEmpty() { return annotations.size() == 0 && childVertex != null && parentVertex != null; }
<<<<<<< String fd = String.valueOf(HelperFunctions.parseLong(eventData.get(AuditEventReader.ARG0), -1L)); ArtifactIdentifier closedArtifactIdentifier = processManager.removeFd(pid, fd); ======= String fd = String.valueOf(CommonFunctions.parseLong(eventData.get(AuditEventReader.ARG0), -1L)); FileDescriptor closedFileDescriptor = processManager.removeFd(pid, fd); >>>>>>> String fd = String.valueOf(HelperFunctions.parseLong(eventData.get(AuditEventReader.ARG0), -1L)); FileDescriptor closedFileDescriptor = processManager.removeFd(pid, fd); <<<<<<< ArtifactIdentifier fdIdentifier = processManager.getFd(pid, sockFd); if(fdIdentifier instanceof NetworkSocketIdentifier){ NetworkSocketIdentifier fdNetworkIdentifier = (NetworkSocketIdentifier)fdIdentifier; if(HelperFunctions.isNullOrEmpty(fdNetworkIdentifier.getRemoteHost())){ ======= FileDescriptor fileDescriptor = processManager.getFd(pid, sockFd); if(fileDescriptor != null && fileDescriptor.identifier instanceof NetworkSocketIdentifier){ NetworkSocketIdentifier fdNetworkIdentifier = (NetworkSocketIdentifier)fileDescriptor.identifier; if(CommonFunctions.isNullOrEmpty(fdNetworkIdentifier.getRemoteHost())){ >>>>>>> FileDescriptor fileDescriptor = processManager.getFd(pid, sockFd); if(fileDescriptor != null && fileDescriptor.identifier instanceof NetworkSocketIdentifier){ NetworkSocketIdentifier fdNetworkIdentifier = (NetworkSocketIdentifier)fileDescriptor.identifier; if(HelperFunctions.isNullOrEmpty(fdNetworkIdentifier.getRemoteHost())){
<<<<<<< ArrayList<Range> ranges = new ArrayList<>(); ranges.add(new Range(new Text(String.format("%06d", 1)))); ranges.add(new Range(new Text(String.format("%06d", 6)), new Text(String.format("%06d", 16)))); ranges.add(new Range(new Text(String.format("%06d", 20)))); ranges.add(new Range(new Text(String.format("%06d", 23)))); ranges.add(new Range(new Text(String.format("%06d", 56)), new Text(String.format("%06d", 61)))); ranges.add(new Range(new Text(String.format("%06d", 501)), new Text(String.format("%06d", 504)))); ranges.add(new Range(new Text(String.format("%06d", 998)), new Text(String.format("%06d", 1000)))); ======= ArrayList<Range> ranges = new ArrayList<>(); ranges.add(new Range(new Text(String.format("%06d", 1)))); ranges.add(new Range(new Text(String.format("%06d", 6)), new Text(String.format("%06d", 16)))); ranges.add(new Range(new Text(String.format("%06d", 20)))); ranges.add(new Range(new Text(String.format("%06d", 23)))); ranges.add(new Range(new Text(String.format("%06d", 56)), new Text(String.format("%06d", 61)))); ranges .add(new Range(new Text(String.format("%06d", 501)), new Text(String.format("%06d", 504)))); ranges.add( new Range(new Text(String.format("%06d", 998)), new Text(String.format("%06d", 1000)))); >>>>>>> ArrayList<Range> ranges = new ArrayList<>(); ranges.add(new Range(new Text(String.format("%06d", 1)))); ranges .add(new Range(new Text(String.format("%06d", 6)), new Text(String.format("%06d", 16)))); ranges.add(new Range(new Text(String.format("%06d", 20)))); ranges.add(new Range(new Text(String.format("%06d", 23)))); ranges .add(new Range(new Text(String.format("%06d", 56)), new Text(String.format("%06d", 61)))); ranges.add( new Range(new Text(String.format("%06d", 501)), new Text(String.format("%06d", 504)))); ranges.add( new Range(new Text(String.format("%06d", 998)), new Text(String.format("%06d", 1000))));
<<<<<<< @Override ======= @Override public ABlockWriter prepareMetaBlock(String name, String compressionName) throws IOException { _bw = new BlockWrite(_bc.prepareMetaBlock(name, compressionName)); return _bw; } @Override >>>>>>> @Override <<<<<<< static class SeekableByteArrayInputStream extends ByteArrayInputStream { public SeekableByteArrayInputStream(byte[] buf) { super(buf); } public void seek(int position) { if (pos < 0 || pos >= buf.length) throw new IllegalArgumentException("pos = " + pos + " buf.lenght = " + buf.length); this.pos = position; } public int getPosition() { return this.pos; } } ======= >>>>>>> <<<<<<< ======= this.size = size; } /** * Size is the size of the bytearray that was read form the cache */ @Override public long getRawSize() { return size; >>>>>>>
<<<<<<< import java.nio.ByteBuffer; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.avro.generic.GenericContainer; import org.apache.commons.codec.binary.Hex; import org.apache.kafka.clients.producer.ProducerConfig; import com.bbn.tc.schema.avro.cdm18.AbstractObject; import com.bbn.tc.schema.avro.cdm18.EndMarker; import com.bbn.tc.schema.avro.cdm18.Event; import com.bbn.tc.schema.avro.cdm18.EventType; import com.bbn.tc.schema.avro.cdm18.FileObject; import com.bbn.tc.schema.avro.cdm18.FileObjectType; import com.bbn.tc.schema.avro.cdm18.Host; import com.bbn.tc.schema.avro.cdm18.HostIdentifier; import com.bbn.tc.schema.avro.cdm18.HostType; import com.bbn.tc.schema.avro.cdm18.InstrumentationSource; import com.bbn.tc.schema.avro.cdm18.Interface; import com.bbn.tc.schema.avro.cdm18.MemoryObject; import com.bbn.tc.schema.avro.cdm18.NetFlowObject; import com.bbn.tc.schema.avro.cdm18.Principal; import com.bbn.tc.schema.avro.cdm18.PrincipalType; import com.bbn.tc.schema.avro.cdm18.SHORT; import com.bbn.tc.schema.avro.cdm18.SrcSinkObject; import com.bbn.tc.schema.avro.cdm18.SrcSinkType; import com.bbn.tc.schema.avro.cdm18.StartMarker; import com.bbn.tc.schema.avro.cdm18.Subject; import com.bbn.tc.schema.avro.cdm18.SubjectType; import com.bbn.tc.schema.avro.cdm18.TCCDMDatum; import com.bbn.tc.schema.avro.cdm18.TimeMarker; import com.bbn.tc.schema.avro.cdm18.UUID; import com.bbn.tc.schema.avro.cdm18.UnitDependency; import com.bbn.tc.schema.avro.cdm18.UnnamedPipeObject; import com.bbn.tc.schema.serialization.AvroConfig; import spade.core.AbstractEdge; import spade.core.AbstractVertex; import spade.reporter.audit.OPMConstants; import spade.utility.CommonFunctions; import spade.vertex.prov.Agent; ======= import java.nio.ByteBuffer; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.avro.generic.GenericContainer; import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.digest.DigestUtils; import org.apache.kafka.clients.producer.ProducerConfig; import com.bbn.tc.schema.avro.AbstractObject; import com.bbn.tc.schema.avro.Event; import com.bbn.tc.schema.avro.EventType; import com.bbn.tc.schema.avro.FileObject; import com.bbn.tc.schema.avro.FileObjectType; import com.bbn.tc.schema.avro.InstrumentationSource; import com.bbn.tc.schema.avro.MemoryObject; import com.bbn.tc.schema.avro.NetFlowObject; import com.bbn.tc.schema.avro.Principal; import com.bbn.tc.schema.avro.PrincipalType; import com.bbn.tc.schema.avro.SHORT; import com.bbn.tc.schema.avro.SrcSinkObject; import com.bbn.tc.schema.avro.SrcSinkType; import com.bbn.tc.schema.avro.Subject; import com.bbn.tc.schema.avro.SubjectType; import com.bbn.tc.schema.avro.TCCDMDatum; import com.bbn.tc.schema.avro.UUID; import com.bbn.tc.schema.avro.UnitDependency; import com.bbn.tc.schema.avro.UnnamedPipeObject; import com.bbn.tc.schema.serialization.AvroConfig; import spade.core.AbstractEdge; import spade.core.AbstractVertex; import spade.reporter.audit.OPMConstants; import spade.utility.CommonFunctions; import spade.vertex.prov.Agent; >>>>>>> import java.nio.ByteBuffer; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.avro.generic.GenericContainer; import org.apache.commons.codec.binary.Hex; import org.apache.kafka.clients.producer.ProducerConfig; import com.bbn.tc.schema.avro.cdm18.AbstractObject; import com.bbn.tc.schema.avro.cdm18.EndMarker; import com.bbn.tc.schema.avro.cdm18.Event; import com.bbn.tc.schema.avro.cdm18.EventType; import com.bbn.tc.schema.avro.cdm18.FileObject; import com.bbn.tc.schema.avro.cdm18.FileObjectType; import com.bbn.tc.schema.avro.cdm18.Host; import com.bbn.tc.schema.avro.cdm18.HostIdentifier; import com.bbn.tc.schema.avro.cdm18.HostType; import com.bbn.tc.schema.avro.cdm18.InstrumentationSource; import com.bbn.tc.schema.avro.cdm18.Interface; import com.bbn.tc.schema.avro.cdm18.MemoryObject; import com.bbn.tc.schema.avro.cdm18.NetFlowObject; import com.bbn.tc.schema.avro.cdm18.Principal; import com.bbn.tc.schema.avro.cdm18.PrincipalType; import com.bbn.tc.schema.avro.cdm18.SHORT; import com.bbn.tc.schema.avro.cdm18.SrcSinkObject; import com.bbn.tc.schema.avro.cdm18.SrcSinkType; import com.bbn.tc.schema.avro.cdm18.StartMarker; import com.bbn.tc.schema.avro.cdm18.Subject; import com.bbn.tc.schema.avro.cdm18.SubjectType; import com.bbn.tc.schema.avro.cdm18.TCCDMDatum; import com.bbn.tc.schema.avro.cdm18.TimeMarker; import com.bbn.tc.schema.avro.cdm18.UUID; import com.bbn.tc.schema.avro.cdm18.UnitDependency; import com.bbn.tc.schema.avro.cdm18.UnnamedPipeObject; import com.bbn.tc.schema.serialization.AvroConfig; import spade.core.AbstractEdge; import spade.core.AbstractVertex; import spade.reporter.audit.OPMConstants; import spade.utility.CommonFunctions; import spade.vertex.prov.Agent; <<<<<<< public boolean initialize(String arguments) { Map<String, String> argumentsMap = CommonFunctions.parseKeyValPairs(arguments); if("false".equals(argumentsMap.get("hexUUIDs"))){ hexUUIDs = false; ======= public boolean initialize(String arguments){ Map<String, String> argumentsMap = CommonFunctions.parseKeyValPairs(arguments); String hexUUIDsArgValue = argumentsMap.get("hexUUIDs"); if(hexUUIDsArgValue != null){ hexUUIDsArgValue = hexUUIDsArgValue.trim(); if("false".equals(hexUUIDsArgValue)){ hexUUIDs = false; }else if("true".equals(hexUUIDsArgValue)){ hexUUIDs = true; }else{ logger.log(Level.SEVERE, "Invalid 'hexUUIDs' value: " + hexUUIDsArgValue + ". Only 'true' or 'false'"); return false; } } boolean initResult = super.initialize(arguments); if(!initResult){ return false; >>>>>>> public boolean initialize(String arguments){ Map<String, String> argumentsMap = CommonFunctions.parseKeyValPairs(arguments); String hexUUIDsArgValue = argumentsMap.get("hexUUIDs"); if(hexUUIDsArgValue != null){ hexUUIDsArgValue = hexUUIDsArgValue.trim(); if("false".equals(hexUUIDsArgValue)){ hexUUIDs = false; }else if("true".equals(hexUUIDsArgValue)){ hexUUIDs = true; }else{ logger.log(Level.SEVERE, "Invalid 'hexUUIDs' value: " + hexUUIDsArgValue + ". Only 'true' or 'false'"); return false; }
<<<<<<< private void handleCreat(Map<String, String> eventData){ //creat() receives the following message(s): // - SYSCALL // - CWD // - PATH of the parent with nametype=PARENT // - PATH of the created file with nametype=CREATE // - EOE //as mentioned in open syscall manpage int defaultFlags = O_CREAT|O_WRONLY|O_TRUNC; //modify the eventData as expected by open syscall and call open syscall function eventData.put(AuditEventReader.ARG2, eventData.get(AuditEventReader.ARG1)); //set mode to argument 3 (in open) from 2 (in creat) eventData.put(AuditEventReader.ARG1, String.valueOf(defaultFlags)); //flags is argument 2 in open handleOpen(eventData, SYSCALL.CREATE); //TODO change to creat. kept as create to keep current CDM data consistent } /** * Get path from audit log. First see, if a path with CREATE nametype exists. * If yes then return that. If no then check if path with NORMAL nametype exists. * If yes then return that else return null. * * @param eventData audit log event data as key values * @return path/null */ private PathRecord getPathWithCreateOrNormalNametype(Map<String, String> eventData){ PathRecord pathRecord = getFirstPathWithNametype(eventData, AuditEventReader.NAMETYPE_CREATE); if(pathRecord != null){ return pathRecord; }else{ pathRecord = getFirstPathWithNametype(eventData, AuditEventReader.NAMETYPE_NORMAL); return pathRecord; } } private void handleOpenat(Map<String, String> eventData, SYSCALL syscall){ //openat() receives the following message(s): // - SYSCALL // - CWD // - PATH // - PATH // - EOE String time = eventData.get(AuditEventReader.TIME); String eventId = eventData.get(AuditEventReader.EVENT_ID); PathRecord pathRecord = getPathWithCreateOrNormalNametype(eventData); if(pathRecord == null){ log(Level.INFO, "Missing PATH record", null, time, eventId, syscall); return; } String path = pathRecord.getPath(); // If not absolute then only run the following logic according to the manpage if(!path.startsWith(File.separator)){ Long dirFd = HelperFunctions.parseLong(eventData.get(AuditEventReader.ARG0), -1L); //according to manpage if following true then use cwd if path not absolute, which is already handled by open if(dirFd != AT_FDCWD){ //checking if cwd needs to be replaced by dirFd's path String pid = eventData.get(AuditEventReader.PID); String dirFdString = String.valueOf(dirFd); //if null of if not file then cannot process it FileDescriptor fileDescriptor = processManager.getFd(pid, dirFdString); if(fileDescriptor == null || !(fileDescriptor.identifier instanceof PathIdentifier)){ log(Level.INFO, "Expected 'dir' type fd: '" + fileDescriptor.identifier + "'", null, time, eventId, syscall); return; }else{ //is file String dirPath = ((PathIdentifier)fileDescriptor.identifier).getPath(); eventData.put(AuditEventReader.CWD, dirPath); //replace cwd with dirPath to make eventData compatible with open } } } //modify the eventData to match open syscall and then call it's function eventData.put(AuditEventReader.ARG0, eventData.get(AuditEventReader.ARG1)); //moved pathname address to first like in open eventData.put(AuditEventReader.ARG1, eventData.get(AuditEventReader.ARG2)); //moved flags to second like in open eventData.put(AuditEventReader.ARG2, eventData.get(AuditEventReader.ARG3)); //moved mode to third like in open handleOpen(eventData, syscall); } private void handleOpen(Map<String, String> eventData, SYSCALL syscall) { ======= private void handleOpen(Map<String, String> eventData, SYSCALL syscall){ >>>>>>> private void handleOpen(Map<String, String> eventData, SYSCALL syscall){ <<<<<<< String path = pathRecord.getPath(); // If not absolute then only run the following logic according to the manpage if(!path.startsWith(File.separator)){ String fd = eventData.get(AuditEventReader.ARG0); Long fdLong = HelperFunctions.parseLong(fd, null); ArtifactIdentifier artifactIdentifier = null; ======= >>>>>>> <<<<<<< constructNetworkIdentifier(syscall, time, eventId, localSaddr, remoteSaddr, sockType); ======= constructNetworkIdentifier(syscall, time, eventId, localSaddr, remoteSaddr, sockType, pid); >>>>>>> constructNetworkIdentifier(syscall, time, eventId, localSaddr, remoteSaddr, sockType, pid);
<<<<<<< public List<BaseDanmaku> getVisibleDanmakusOnTime(long time); ======= public void clearDanmakusOnScreen(long currMillis); >>>>>>> public void clearDanmakusOnScreen(long currMillis); public List<BaseDanmaku> getVisibleDanmakusOnTime(long time);
<<<<<<< private OnClickListener mOnClickListener; private OnDanmakuClickListener mOnDanmakuClickListener; private DanmakuTouchHelper mTouchHelper; ======= >>>>>>> private OnDanmakuClickListener mOnDanmakuClickListener; private DanmakuTouchHelper mTouchHelper; <<<<<<< mTouchHelper = DanmakuTouchHelper.instance(this); setOnClickListener(this); } @Override public void setOnClickListener(OnClickListener l) { if (l != this) { mOnClickListener = l; } else super.setOnClickListener(l); ======= DrawHelper.useDrawColorToClearCanvas(true, true); >>>>>>> DrawHelper.useDrawColorToClearCanvas(true, true); mTouchHelper = DanmakuTouchHelper.instance(this); <<<<<<< @Override public void onClick(View view) { if (mOnClickListener != null) { mOnClickListener.onClick(view); } } @Override public boolean onTouchEvent(MotionEvent event) { if (null != mTouchHelper) { mTouchHelper.onTouchEvent(event); } return super.onTouchEvent(event); } ======= >>>>>>> @Override public boolean onTouchEvent(MotionEvent event) { if (null != mTouchHelper) { mTouchHelper.onTouchEvent(event); } return super.onTouchEvent(event); }
<<<<<<< import static java.util.Objects.requireNonNull; ======= import java.util.ArrayList; import java.util.EnumMap; import java.util.HashMap; import java.util.List; >>>>>>> import static java.util.Objects.requireNonNull; import java.util.ArrayList; import java.util.EnumMap; import java.util.HashMap; import java.util.List; <<<<<<< import java.util.function.Predicate; ======= import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicReference; >>>>>>> import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Predicate; <<<<<<< ======= import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; >>>>>>> import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; <<<<<<< public TableConfiguration(Instance instance, Table.ID tableId, NamespaceConfiguration parent) { this.instance = requireNonNull(instance); this.tableId = requireNonNull(tableId); this.parent = requireNonNull(parent); ======= private EnumMap<IteratorScope,AtomicReference<ParsedIteratorConfig>> iteratorConfig; public TableConfiguration(Instance instance, String tableId, NamespaceConfiguration parent) { this.instance = instance; this.tableId = tableId; this.parent = parent; iteratorConfig = new EnumMap<>(IteratorScope.class); for (IteratorScope scope : IteratorScope.values()) { iteratorConfig.put(scope, new AtomicReference<ParsedIteratorConfig>(null)); } >>>>>>> private EnumMap<IteratorScope,AtomicReference<ParsedIteratorConfig>> iteratorConfig; public TableConfiguration(Instance instance, Table.ID tableId, NamespaceConfiguration parent) { this.instance = requireNonNull(instance); this.tableId = requireNonNull(tableId); this.parent = requireNonNull(parent); iteratorConfig = new EnumMap<>(IteratorScope.class); for (IteratorScope scope : IteratorScope.values()) { iteratorConfig.put(scope, new AtomicReference<ParsedIteratorConfig>(null)); }
<<<<<<< ArrayList<DoubleMap> availableLayers = new ArrayList<>(); for (DoubleMap l : atlas.getLayers()) { if (atlas.getLayers().indexOf(l) == layer) { valueToDitribute -= add(l, x, y, attenuatedInc); ======= ArrayList<AtlasLayer> availableLayers = new ArrayList<>(); for (AtlasLayer l : atlas.layers) { if (atlas.layers.indexOf(l) == layer) { valueToDitribute -= l.addAndReturnExcess(x, y, attenuatedInc); >>>>>>> ArrayList<AtlasLayer> availableLayers = new ArrayList<>(); for (AtlasLayer l : atlas.getLayers()) { if (atlas.getLayers().indexOf(l) == layer) { valueToDitribute -= l.addAndReturnExcess(x, y, attenuatedInc); <<<<<<< ArrayList<DoubleMap> availableLayers = new ArrayList<>(); for (DoubleMap l : atlas.getLayers()) { if (atlas.getLayers().indexOf(l) == layer) { valueToDitribute -= subtract(l, x, y, attenuatedInc); ======= ArrayList<AtlasLayer> availableLayers = new ArrayList<>(); for (AtlasLayer l : atlas.layers) { if (atlas.layers.indexOf(l) == layer) { valueToDitribute -= l.withdrawAndReturnExcess(x, y, attenuatedInc); >>>>>>> ArrayList<AtlasLayer> availableLayers = new ArrayList<>(); for (AtlasLayer l : atlas.getLayers()) { if (atlas.getLayers().indexOf(l) == layer) { valueToDitribute -= l.withdrawAndReturnExcess(x, y, attenuatedInc); <<<<<<< for (DoubleMap l : atlas.getLayers()) { if (l.get(centerX, centerY) > atlas.getLayers().get(autoLayer).get(centerX, centerY)) { autoLayer = atlas.getLayers().indexOf(l); ======= for (AtlasLayer l : atlas.layers) { if (l.get(centerX, centerY) > atlas.layers.get(autoLayer).get(centerX, centerY)) { autoLayer = atlas.layers.indexOf(l); >>>>>>> for (AtlasLayer l : atlas.getLayers()) { if (l.get(centerX, centerY) > atlas.getLayers().get(autoLayer).get(centerX, centerY)) { autoLayer = atlas.getLayers().indexOf(l); <<<<<<< for (DoubleMap l : atlas.getLayers()) { ======= for (AtlasLayer l : atlas.layers) { >>>>>>> for (AtlasLayer l : atlas.getLayers()) { <<<<<<< for (DoubleMap l : atlas.getLayers()) { ======= for (AtlasLayer l : atlas.layers) { >>>>>>> for (AtlasLayer l : atlas.getLayers()) { <<<<<<< private void updateAtlasPixel(int x, int y) { for (int i = 0; i < 2; i++) { ByteBuffer buffer = atlas.getBuffer(i); int r = (int) Math.round(atlas.getLayers().get(i).get(x, y)) << 24; int g = (int) Math.round(atlas.getLayers().get(i + 1).get(x, y)) << 16; int b = (int) Math.round(atlas.getLayers().get(i + 2).get(x, y)) << 8; int a = (int) Math.round(atlas.getLayers().get(i + 3).get(x, y)); buffer.asIntBuffer().put(y * atlas.getWidth() + x, r + g + b + a); } atlas.setToUpdate(true); } private double add(DoubleMap map, int x, int y, double val) { double rest = 0; double newVal = map.get(x, y) + val; if (newVal > 255) { rest = newVal - 255; newVal = 255; } map.set(x, y, newVal); return rest; } private double subtract(DoubleMap map, int x, int y, double val) { double rest = 0; double newVal = map.get(x, y) - val; if (newVal < 0) { rest = -newVal; newVal = 0; } map.set(x, y, newVal); return rest; } ======= >>>>>>>
<<<<<<< private static int LAYER_COUNT = 8; private static int RESOLUTION_RATIO = 8; @JsonProperty private int mapWidth, mapHeight; @JsonIgnore private int width, height; @JsonIgnore private List<AtlasLayer> layers = new ArrayList<>(); @JsonIgnore List<ByteBuffer> buffers = new ArrayList<>(); @JsonIgnore private boolean toUpdate = false; public Atlas() { } public Atlas(int mapWidth, int mapHeight) { this.mapWidth = mapWidth; this.mapHeight = mapHeight; width = mapWidth * RESOLUTION_RATIO; height = mapHeight * RESOLUTION_RATIO; } @Override public void finalize() { for (int i = 0; i < LAYER_COUNT; i++) { AtlasLayer layer = new AtlasLayer(width, height); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (i == 0) { layer.set(x, y, 255d); } else { layer.set(x, y, 0d); } } } layers.add(layer); } buffers.add(buildBuffer(0)); buffers.add(buildBuffer(1)); } private ByteBuffer buildBuffer(int index) { ByteBuffer res = ByteBuffer.allocateDirect(width * height * 4); int firstLayerIndex = index * 4; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { res.asIntBuffer().put(y * width + x, getBufferVal(x, y, firstLayerIndex)); } } return res; } public ByteBuffer getBuffer(int index) { return buffers.get(index); } public void saveToFile(String fileName) { byte[] bytes = new byte[width * height * LAYER_COUNT]; int index = 0; for (AtlasLayer l : layers) { for (Double d : l.getAll()) { int i = (int) Math.floor(d - 128); bytes[index++] = (byte) i; } } try { FileOutputStream fos = new FileOutputStream(fileName + "atlas"); fos.write(bytes); fos.close(); } catch (IOException e) { System.out.println("IOException : " + e); } } public void loadFromFile(String fileName) { byte[] bytes = new byte[width * height * LAYER_COUNT]; try { FileInputStream fis = new FileInputStream(fileName + "atlas"); fis.read(bytes, 0, width * height * LAYER_COUNT); fis.close(); } catch (IOException e) { System.err.println("IOException : " + e); } int index = 0; layers.clear(); for (int i = 0; i < LAYER_COUNT; i++) { AtlasLayer l = new AtlasLayer(width, height); for (int xy = 0; xy < width * height; xy++) { l.set(xy, (double) bytes[index++] + 128); } layers.add(l); } buffers.clear(); buffers.add(buildBuffer(0)); buffers.add(buildBuffer(1)); toUpdate = true; } ======= private static int LAYER_COUNT = 8; private static int RESOLUTION_RATIO = 8; @Element private int mapWidth, mapHeight; public int width, height; public List<AtlasLayer> layers = new ArrayList<>(); List<ByteBuffer> buffers = new ArrayList<>(); public boolean toUpdate = false; public Atlas(@Element(name="mapWidth")int mapWidth, @Element(name="mapHeight")int mapHeight) { this.mapWidth = mapWidth; this.mapHeight = mapHeight; width = mapWidth*RESOLUTION_RATIO; height = mapHeight*RESOLUTION_RATIO; } @Override public void finalize(){ for(int i=0; i<LAYER_COUNT; i++){ AtlasLayer layer = new AtlasLayer(width, height); for(int x=0; x<width; x++) for(int y=0; y<height; y++) if(i == 0) layer.set(x, y, 1d); else layer.set(x, y, 0d); layers.add(layer); } buffers.add(buildBuffer(0)); buffers.add(buildBuffer(1)); } private ByteBuffer buildBuffer(int index){ ByteBuffer res = ByteBuffer.allocateDirect(width*height*4); int firstLayerIndex = index*4; for(int x=0; x<width; x++) for(int y=0; y<height; y++){ res.asIntBuffer().put(y*width+x, getBufferVal(x, y, firstLayerIndex)); } return res; } public ByteBuffer getBuffer(int index){ return buffers.get(index); } public void saveToFile(String fileName){ byte[] bytes = new byte[width*height*LAYER_COUNT]; int index = 0; for(AtlasLayer l : layers) for(Byte b : l.getBytes()){ // int i = (int)Math.floor(f-128); // bytes[index++] = (byte)i; bytes[index++] = b; } try { FileOutputStream fos = new FileOutputStream(fileName+"atlas"); fos.write(bytes); fos.close(); } catch (IOException e){ System.out.println("IOException : " + e); } } public void loadFromFile(String fileName){ byte[] bytes = new byte[width*height*LAYER_COUNT]; try { FileInputStream fis = new FileInputStream(fileName+"atlas"); fis.read(bytes, 0, width*height*LAYER_COUNT); fis.close(); } catch (IOException e){ System.out.println("IOException : " + e); } int index = 0; layers.clear(); for(int i=0; i<LAYER_COUNT; i++){ AtlasLayer l = new AtlasLayer(width, height); for(int xy=0; xy<width*height; xy++) l.setByte(xy, bytes[index++]); layers.add(l); } buffers.clear(); buffers.add(buildBuffer(0)); buffers.add(buildBuffer(1)); toUpdate = true; } >>>>>>> private static int LAYER_COUNT = 8; private static int RESOLUTION_RATIO = 8; @JsonProperty private int mapWidth, mapHeight; @JsonIgnore private int width, height; @JsonIgnore private List<AtlasLayer> layers = new ArrayList<>(); @JsonIgnore List<ByteBuffer> buffers = new ArrayList<>(); @JsonIgnore private boolean toUpdate = false; public Atlas() { } public Atlas(int mapWidth, int mapHeight) { this.mapWidth = mapWidth; this.mapHeight = mapHeight; width = mapWidth*RESOLUTION_RATIO; height = mapHeight*RESOLUTION_RATIO; } @Override public void finalize(){ for(int i=0; i<LAYER_COUNT; i++){ AtlasLayer layer = new AtlasLayer(width, height); for(int x=0; x<width; x++) { for(int y=0; y<height; y++) { if(i == 0) { layer.set(x, y, 1d); } else { layer.set(x, y, 0d); } } } layers.add(layer); } buffers.add(buildBuffer(0)); buffers.add(buildBuffer(1)); } private ByteBuffer buildBuffer(int index){ ByteBuffer res = ByteBuffer.allocateDirect(width*height*4); int firstLayerIndex = index*4; for(int x=0; x<width; x++) { for(int y=0; y<height; y++){ res.asIntBuffer().put(y*width+x, getBufferVal(x, y, firstLayerIndex)); } } return res; } public ByteBuffer getBuffer(int index){ return buffers.get(index); } public void saveToFile(String fileName){ byte[] bytes = new byte[width*height*LAYER_COUNT]; int index = 0; for(AtlasLayer l : layers) { for(Byte b : l.getBytes()){ // int i = (int)Math.floor(f-128); // bytes[index++] = (byte)i; bytes[index++] = b; } } try { FileOutputStream fos = new FileOutputStream(fileName+"atlas"); fos.write(bytes); fos.close(); } catch (IOException e){ System.out.println("IOException : " + e); } } public void loadFromFile(String fileName){ byte[] bytes = new byte[width*height*LAYER_COUNT]; try { FileInputStream fis = new FileInputStream(fileName+"atlas"); fis.read(bytes, 0, width*height*LAYER_COUNT); fis.close(); } catch (IOException e){ System.out.println("IOException : " + e); } int index = 0; layers.clear(); for(int i=0; i<LAYER_COUNT; i++){ AtlasLayer l = new AtlasLayer(width, height); for(int xy=0; xy<width*height; xy++) { l.setByte(xy, bytes[index++]); } layers.add(l); } buffers.clear(); buffers.add(buildBuffer(0)); buffers.add(buildBuffer(1)); toUpdate = true; } <<<<<<< private int getBufferVal(int x, int y, int firstLayerIndex) { int r = (int) Math.round(layers.get(firstLayerIndex).get(x, y)) << 24; int g = (int) Math.round(layers.get(firstLayerIndex + 1).get(x, y)) << 16; int b = (int) Math.round(layers.get(firstLayerIndex + 2).get(x, y)) << 8; int a = (int) Math.round(layers.get(firstLayerIndex + 3).get(x, y)); return (r + g + b + a); ======= private int getBufferVal(int x, int y, int firstLayerIndex){ int r = (int) Math.round(layers.get(firstLayerIndex).get(x, y)*255) << 24; int g = (int) Math.round(layers.get(firstLayerIndex + 1).get(x, y)*255) << 16; int b = (int) Math.round(layers.get(firstLayerIndex + 2).get(x, y)*255) << 8; int a = (int) Math.round(layers.get(firstLayerIndex + 3).get(x, y)*255); return(r + g + b + a); >>>>>>> private int getBufferVal(int x, int y, int firstLayerIndex) { int r = (int) Math.round(layers.get(firstLayerIndex).get(x, y)*255) << 24; int g = (int) Math.round(layers.get(firstLayerIndex + 1).get(x, y)*255) << 16; int b = (int) Math.round(layers.get(firstLayerIndex + 2).get(x, y)*255) << 8; int a = (int) Math.round(layers.get(firstLayerIndex + 3).get(x, y)*255); return (r + g + b + a);
<<<<<<< import geometry.geom2d.AlignedBoundingBox; ======= import event.EventManager; import event.InputEvent; >>>>>>> import geometry.geom2d.AlignedBoundingBox; <<<<<<< import model.battlefield.army.ArmyManager; import model.battlefield.army.components.Unit; import view.math.Translator; ======= >>>>>>> import model.battlefield.army.ArmyManager; import model.battlefield.army.components.Unit; import view.math.Translator; <<<<<<< // simple clic // if (!endSelection()) { // CommandManager.select(ctrl.spatialSelector.getEntityId(), getSpatialCoord()); // } ======= if(!((BattlefieldController) ctrl).isDrawingZone()) CommandManager.select(ctrl.spatialSelector.getEntityId(), getSpatialCoord()); >>>>>>> if(!((BattlefieldController) ctrl).isDrawingZone()) { CommandManager.select(ctrl.spatialSelector.getEntityId(), getSpatialCoord()); } <<<<<<< private void beginSelection() { selectionStart = Translator.toPoint2D(ctrl.inputManager.getCursorPosition()); } public void updateSelection(){ Point2D selectionEnd = Translator.toPoint2D(ctrl.inputManager.getCursorPosition()); if(selectionEnd.equals(selectionStart) || selectionEnd.getDistance(selectionStart) < 10){ return; } AlignedBoundingBox rect = new AlignedBoundingBox(selectionStart, selectionEnd); List<Unit> inSelection = new ArrayList<>(); for (Unit u : ArmyManager.getUnits()) { if(rect.contains(ctrl.spatialSelector.getScreenCoord(u.getPos()))) { inSelection.add(u); } } CommandManager.select(inSelection); } private boolean endSelection() { Point2D selectionEnd = Translator.toPoint2D(ctrl.inputManager.getCursorPosition()); if(selectionEnd.equals(selectionStart) || selectionEnd.getDistance(selectionStart) < 10){ selectionStart = null; return false; } AlignedBoundingBox rect = new AlignedBoundingBox(selectionStart, selectionEnd); List<Unit> inSelection = new ArrayList<>(); for (Unit u : ArmyManager.getUnits()) { if(rect.contains(ctrl.spatialSelector.getScreenCoord(u.getPos()))) { inSelection.add(u); } } CommandManager.select(inSelection); selectionStart = null; return !inSelection.isEmpty(); } ======= >>>>>>>
<<<<<<< if (action == MotionEvent.ACTION_DOWN) { timer.isInTouchMode = true; } if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { timer.isInTouchMode = false; } ======= if (action == MotionEvent.ACTION_DOWN) stopTimer(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) startTimer(); >>>>>>> if (action == MotionEvent.ACTION_DOWN) { stopTimer(); } if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { startTimer(); <<<<<<< if (timer == null || viewPager == null) { ======= if (timer == null || !timer.isStopped) >>>>>>> if (timer == null || viewPager == null || !timer.isStopped) <<<<<<< timer.startTimer(); ======= timer.sendEmptyMessageDelayed(TimerHandler.MSG_TIMER_ID, timer.interval); timer.isStopped = false; >>>>>>> timer.startTimer(); timer.isStopped = false; <<<<<<< if (timer == null || viewPager == null) { ======= if (timer == null || timer.isStopped) >>>>>>> if (timer == null || viewPager == null || timer.isStopped) {s