conflict_resolution
stringlengths
27
16k
<<<<<<< ======= private void observe(final Object message) { final ActorRef self = self(); final Observe request = (Observe) message; final ActorRef observer = request.observer(); if (observer != null) { synchronized (observers) { observers.add(observer); observer.tell(new Observing(self), self); } } } private void startRecordingCall() throws Exception { logger.info("Start recording call"); boolean playBeep = false; String finishOnKey = "1234567890*#"; int maxLength = 3600; int timeout = 5; recordStarted = DateTime.now(); Record record = null; record = new Record(recordingUri, timeout, maxLength, finishOnKey); group.tell(record, null); recording = true; } private void stopRecordingCall() throws UnsupportedAudioFileException, IOException { logger.info("Stop recording call"); if (group != null) { // recording = false; //No need to stop the group here, it was stopped earlier by VoiceInterpreter group.tell(new Stop(), null); //VoiceInterpreter.finishDialing (if BYE sent by initial calls OR Call.ClosingRemoteConnection (if BYE sent by outbound call) //Will take care to create the recording object } else { logger.info("Tried to stop recording but group was null."); } } >>>>>>> <<<<<<< onStopRecordingCall((StopRecordingCall) message, self, sender); ======= if (recording) { StopRecordingCall stopRecoringdCall = (StopRecordingCall) message; if (runtimeSettings == null) this.runtimeSettings = stopRecoringdCall.getRuntimeSetting(); if (daoManager == null) daoManager = stopRecoringdCall.getDaoManager(); if (accountId == null) accountId = stopRecoringdCall.getAccountId(); stopRecordingCall(); } } else if (RecordingStarted.class.equals(klass)) { //VoiceInterpreter executed the Record verb and notified the call actor that we are in recording now //so Call should wait for NTFY for Recording before complete the call recording = true; } else if (MediaGatewayResponse.class.equals(klass)) { if (acquiringMediaGatewayInfo.equals(state)) { fsm.transition(message, acquiringMediaSession); } else if (acquiringMediaSession.equals(state)) { fsm.transition(message, acquiringBridge); } else if (acquiringBridge.equals(state)) { if (!liveCallModification) { fsm.transition(message, acquiringRemoteConnection); } else { fsm.transition(message, inProgress); } } else if (acquiringRemoteConnection.equals(state)) { fsm.transition(message, initializingRemoteConnection); } else if (acquiringInternalLink.equals(state)) { fsm.transition(message, initializingInternalLink); } } else if (ConnectionStateChanged.class.equals(klass)) { final ConnectionStateChanged event = (ConnectionStateChanged) message; if (ConnectionStateChanged.State.CLOSED == event.state()) { if (initializingRemoteConnection.equals(state)) { fsm.transition(message, openingRemoteConnection); } else if (openingRemoteConnection.equals(state)) { fsm.transition(message, failed); } else if (failing.equals(state)) { fsm.transition(message, failed); } else if (failingBusy.equals(state)) { fsm.transition(message, busy); } else if (failingNoAnswer.equals(state)) { fsm.transition(message, noAnswer); } else if (muting.equals(state) || unmuting.equals(state)) { fsm.transition(message, closingRemoteConnection); } else if (closingRemoteConnection.equals(state)) { context().stop(remoteConn); remoteConn = null; if (internalLink != null) { fsm.transition(message, closingInternalLink); } else { fsm.transition(message, completed); } } } else if (ConnectionStateChanged.State.HALF_OPEN == event.state()) { fsm.transition(message, dialing); } else if (ConnectionStateChanged.State.OPEN == event.state()) { fsm.transition(message, inProgress); } >>>>>>> onStopRecordingCall((StopRecordingCall) message, self, sender); } else if (RecordingStarted.class.equals(klass)) { //VoiceInterpreter executed the Record verb and notified the call actor that we are in recording now //so Call should wait for NTFY for Recording before complete the call recording = true; <<<<<<< ======= if (recording) { recording = false; logger.info("Call - Will stop recording now"); if (recordingUri != null) { Double duration = WavUtils.getAudioDuration(recordingUri); if (duration.equals(0.0)) { logger.info("Call wraping up recording. File doesn't exist since duration is 0"); final DateTime end = DateTime.now(); duration = new Double((end.getMillis() - recordStarted.getMillis()) / 1000); } else { logger.info("Call wraping up recording. File already exists, length: "+ (new File(recordingUri).length())); } final Recording.Builder builder = Recording.builder(); builder.setSid(recordingSid); builder.setAccountSid(accountId); builder.setCallSid(id); builder.setDuration(duration); builder.setApiVersion(runtimeSettings.getString("api-version")); StringBuilder buffer = new StringBuilder(); buffer.append("/").append(runtimeSettings.getString("api-version")).append("/Accounts/") .append(accountId.toString()); buffer.append("/Recordings/").append(recordingSid.toString()); builder.setUri(URI.create(buffer.toString())); final Recording recording = builder.build(); RecordingsDao recordsDao = daoManager.getRecordingsDao(); recordsDao.addRecording(recording); } } >>>>>>> if (recording) { recording = false; logger.info("Call - Will stop recording now"); if (recordingUri != null) { Double duration = WavUtils.getAudioDuration(recordingUri); if (duration.equals(0.0)) { logger.info("Call wraping up recording. File doesn't exist since duration is 0"); final DateTime end = DateTime.now(); duration = new Double((end.getMillis() - recordStarted.getMillis()) / 1000); } else { logger.info("Call wraping up recording. File already exists, length: "+ (new File(recordingUri).length())); } final Recording.Builder builder = Recording.builder(); builder.setSid(recordingSid); builder.setAccountSid(accountId); builder.setCallSid(id); builder.setDuration(duration); builder.setApiVersion(runtimeSettings.getString("api-version")); StringBuilder buffer = new StringBuilder(); buffer.append("/").append(runtimeSettings.getString("api-version")).append("/Accounts/") .append(accountId.toString()); buffer.append("/Recordings/").append(recordingSid.toString()); builder.setUri(URI.create(buffer.toString())); final Recording recording = builder.build(); RecordingsDao recordsDao = daoManager.getRecordingsDao(); recordsDao.addRecording(recording); } } <<<<<<< ======= if (recording) { if (!direction.contains("outbound")) { //Initial Call sent BYE recording = false; logger.info("Call Direction: "+direction); logger.info("Initial Call - Will stop recording now"); stopRecordingCall(); //VoiceInterpreter will take care to prepare the Recording object } else if (conference != null) { //Outbound call sent BYE. !Important conference is the initial call here. conference.tell(new StopRecordingCall(accountId, runtimeSettings, daoManager), null); } } >>>>>>> if (recording) { if (!direction.contains("outbound")) { //Initial Call sent BYE recording = false; logger.info("Call Direction: "+direction); logger.info("Initial Call - Will stop recording now"); stopRecordingCall(); //VoiceInterpreter will take care to prepare the Recording object } else if (conference != null) { //Outbound call sent BYE. !Important conference is the initial call here. conference.tell(new StopRecordingCall(accountId, runtimeSettings, daoManager), null); } }
<<<<<<< ======= import org.restcomm.connect.http.asyncclient.HttpAsycClientHelper; import org.restcomm.connect.interpreter.rcml.SmsVerb; >>>>>>> <<<<<<< this.uriUtils = RestcommConnectServiceProvider.getInstance().uriUtils(); ======= httpAsycClientHelper = httpAsycClientHelper(); >>>>>>> httpAsycClientHelper = httpAsycClientHelper(); this.uriUtils = RestcommConnectServiceProvider.getInstance().uriUtils();
<<<<<<< public Conference(final String name, final MediaServerControllerFactory factory, final DaoManager storage) { ======= private final ActorRef conferenceCenter; public Conference(final String name, final ActorRef msController, final DaoManager storage, final ActorRef conferenceCenter) { >>>>>>> private final ActorRef conferenceCenter; public Conference(final String name, final MediaServerControllerFactory factory, final DaoManager storage, final ActorRef conferenceCenter) {
<<<<<<< private VoiceInterpreter(VoiceInterpreterParams params) { ======= private String conferenceNameWithAccountAndFriendlyName; private Sid callSid; public VoiceInterpreter(final Configuration configuration, final Sid account, final Sid phone, final String version, final URI url, final String method, final URI fallbackUrl, final String fallbackMethod, final URI viStatusCallback, final String statusCallbackMethod, final String referTarget, final String transferor, final String transferee, final String emailAddress, final ActorRef callManager, final ActorRef conferenceManager, final ActorRef bridgeManager, final ActorRef sms, final DaoManager storage, final ActorRef monitoring, final String rcml, final boolean asImsUa, final String imsUaLogin, final String imsUaPassword) { >>>>>>> private String conferenceNameWithAccountAndFriendlyName; private Sid callSid; private VoiceInterpreter(VoiceInterpreterParams params) { <<<<<<< this.accountId = params.getAccount(); this.phoneId = params.getPhone(); this.version = params.getVersion(); this.url = params.getUrl(); this.method = params.getMethod(); this.fallbackUrl = params.getFallbackUrl(); this.fallbackMethod = params.getFallbackMethod(); this.viStatusCallback = params.getStatusCallback(); this.viStatusCallbackMethod = params.getStatusCallbackMethod(); this.referTarget = params.getReferTarget(); this.transferor = params.getTransferor(); this.transferee = params.getTransferee(); this.emailAddress = params.getEmailAddress(); this.configuration = params.getConfiguration(); this.callManager = params.getCallManager(); this.conferenceManager = params.getConferenceCenter(); this.bridgeManager = params.getBridgeManager(); this.smsService = params.getSmsService(); ======= this.accountId = account; this.phoneId = phone; this.version = version; this.url = url; this.method = method; this.fallbackUrl = fallbackUrl; this.fallbackMethod = fallbackMethod; this.viStatusCallback = viStatusCallback; this.viStatusCallbackMethod = statusCallbackMethod; this.referTarget = referTarget; this.transferor = transferor; this.transferee = transferee; this.emailAddress = emailAddress; this.configuration = configuration; this.callManager = callManager; this.conferenceCenter = conferenceManager; this.bridgeManager = bridgeManager; this.smsService = sms; >>>>>>> this.accountId = params.getAccount(); this.phoneId = params.getPhone(); this.version = params.getVersion(); this.url = params.getUrl(); this.method = params.getMethod(); this.fallbackUrl = params.getFallbackUrl(); this.fallbackMethod = params.getFallbackMethod(); this.viStatusCallback = params.getStatusCallback(); this.viStatusCallbackMethod = params.getStatusCallbackMethod(); this.referTarget = params.getReferTarget(); this.transferor = params.getTransferor(); this.transferee = params.getTransferee(); this.emailAddress = params.getEmailAddress(); this.configuration = params.getConfiguration(); this.callManager = params.getCallManager(); this.conferenceCenter = params.getConferenceCenter(); this.bridgeManager = params.getBridgeManager(); this.smsService = params.getSmsService();
<<<<<<< ======= import java.text.ParseException; import java.util.ArrayList; import java.util.List; import static javax.ws.rs.core.MediaType.*; import javax.annotation.PostConstruct; import javax.servlet.ServletContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import static javax.ws.rs.core.Response.*; import static javax.ws.rs.core.Response.Status.*; import javax.ws.rs.core.UriInfo; >>>>>>> <<<<<<< import org.restcomm.connect.commons.dao.Sid; import org.restcomm.connect.commons.util.UriUtils; ======= import org.restcomm.connect.commons.configuration.RestcommConfiguration; import org.restcomm.connect.http.converter.RecordingListConverter; import org.restcomm.connect.http.converter.RestCommResponseConverter; >>>>>>> import org.restcomm.connect.commons.dao.Sid; import org.restcomm.connect.commons.util.UriUtils; <<<<<<< ======= import org.restcomm.connect.commons.dao.Sid; import org.restcomm.connect.dao.entities.Account; import org.restcomm.connect.dao.entities.RecordingFilter; >>>>>>> import org.restcomm.connect.commons.dao.Sid; import org.restcomm.connect.dao.entities.Account; <<<<<<< protected S3AccessTool s3AccessTool; ======= protected RecordingListConverter listConverter; protected String instanceId; >>>>>>> protected S3AccessTool s3AccessTool; protected RecordingListConverter listConverter; protected String instanceId; <<<<<<< if(!amazonS3Configuration.isEmpty()) { // Do not fail with NPE is amazonS3Configuration is not present for older install boolean amazonS3Enabled = amazonS3Configuration.getBoolean("enabled"); if (amazonS3Enabled) { final String accessKey = amazonS3Configuration.getString("access-key"); final String securityKey = amazonS3Configuration.getString("security-key"); final String bucketName = amazonS3Configuration.getString("bucket-name"); final String bucketFolder = amazonS3Configuration.getString("folder"); final boolean reducedRedundancy = amazonS3Configuration.getBoolean("reduced-redundancy"); final int minutesToRetainPublicUrl = amazonS3Configuration.getInt("minutes-to-retain-public-url", 10); final boolean removeOriginalFile = amazonS3Configuration.getBoolean("remove-original-file"); final String bucketRegion = amazonS3Configuration.getString("bucket-region"); final boolean testing = amazonS3Configuration.getBoolean("testing",false); final String testingUrl = amazonS3Configuration.getString("testing-url",null); s3AccessTool = new S3AccessTool(accessKey, securityKey, bucketName, bucketFolder, reducedRedundancy, minutesToRetainPublicUrl, removeOriginalFile,bucketRegion, testing, testingUrl); } } ======= xstream.registerConverter(listConverter); instanceId = RestcommConfiguration.getInstance().getMain().getInstanceId(); >>>>>>> if(!amazonS3Configuration.isEmpty()) { // Do not fail with NPE is amazonS3Configuration is not present for older install boolean amazonS3Enabled = amazonS3Configuration.getBoolean("enabled"); if (amazonS3Enabled) { final String accessKey = amazonS3Configuration.getString("access-key"); final String securityKey = amazonS3Configuration.getString("security-key"); final String bucketName = amazonS3Configuration.getString("bucket-name"); final String bucketFolder = amazonS3Configuration.getString("folder"); final boolean reducedRedundancy = amazonS3Configuration.getBoolean("reduced-redundancy"); final int minutesToRetainPublicUrl = amazonS3Configuration.getInt("minutes-to-retain-public-url", 10); final boolean removeOriginalFile = amazonS3Configuration.getBoolean("remove-original-file"); final String bucketRegion = amazonS3Configuration.getString("bucket-region"); final boolean testing = amazonS3Configuration.getBoolean("testing",false); final String testingUrl = amazonS3Configuration.getString("testing-url",null); s3AccessTool = new S3AccessTool(accessKey, securityKey, bucketName, bucketFolder, reducedRedundancy, minutesToRetainPublicUrl, removeOriginalFile,bucketRegion, testing, testingUrl); } } xstream.registerConverter(listConverter); instanceId = RestcommConfiguration.getInstance().getMain().getInstanceId(); <<<<<<< protected Response getRecordingWav (String accountSid, String sid) { Account operatedAccount = accountsDao.getAccount(accountSid); // secure(operatedAccount, "RestComm:Read:Recordings"); final Recording recording = dao.getRecording(new Sid(sid)); if (recording == null) { if (logger.isInfoEnabled()) { logger.info("Recording with SID: "+sid+", was not found"); } return status(NOT_FOUND).build(); } else { // secure(operatedAccount, recording.getAccountSid(), SecuredType.SECURED_STANDARD); URI recordingUri = null; try { if (recording.getS3Uri() != null) { recordingUri = s3AccessTool.getPublicUrl(recording.getSid() + ".wav"); } else { String recFile = "/restcomm/recordings/" + recording.getSid() + ".wav"; recordingUri = UriUtils.resolve(new URI(recFile)); } } catch (Exception e) { if (logger.isInfoEnabled()) { logger.info("Problem during preparation of Recording wav file link, ",e); } } return temporaryRedirect(recordingUri).build(); } } ======= >>>>>>> protected Response getRecordingWav (String accountSid, String sid) { Account operatedAccount = accountsDao.getAccount(accountSid); // secure(operatedAccount, "RestComm:Read:Recordings"); final Recording recording = dao.getRecording(new Sid(sid)); if (recording == null) { if (logger.isInfoEnabled()) { logger.info("Recording with SID: "+sid+", was not found"); } return status(NOT_FOUND).build(); } else { // secure(operatedAccount, recording.getAccountSid(), SecuredType.SECURED_STANDARD); URI recordingUri = null; try { if (recording.getS3Uri() != null) { recordingUri = s3AccessTool.getPublicUrl(recording.getSid() + ".wav"); } else { String recFile = "/restcomm/recordings/" + recording.getSid() + ".wav"; recordingUri = UriUtils.resolve(new URI(recFile)); } } catch (Exception e) { if (logger.isInfoEnabled()) { logger.info("Problem during preparation of Recording wav file link, ",e); } } return temporaryRedirect(recordingUri).build(); } }
<<<<<<< ======= import org.eclipse.jgit.errors.ConfigInvalidException; import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.PersonIdent; >>>>>>> <<<<<<< return Guice.createInjector( Stage.DEVELOPMENT, new AbstractModule() { @Override protected void configure() { bind(SchemaVersion.class).to(SchemaVersion.C); for (Key<?> k : new Key<?>[] { Key.get(PersonIdent.class, GerritPersonIdent.class), Key.get(String.class, AnonymousCowardName.class), }) { rebind(parent, k); } for (Class<?> c : new Class<?>[] { AllProjectsName.class, AllUsersCreator.class, AllUsersName.class, GitRepositoryManager.class, SitePaths.class, SystemGroupBackend.class, }) { rebind(parent, Key.get(c)); } } private <T> void rebind(Injector parent, Key<T> c) { bind(c).toProvider(parent.getProvider(c)); } }); ======= return Guice.createInjector(Stage.DEVELOPMENT, new AbstractModule() { @Override protected void configure() { bind(SchemaVersion.class).to(SchemaVersion.C); for (Key<?> k : new Key<?>[]{ Key.get(PersonIdent.class, GerritPersonIdent.class), Key.get(String.class, AnonymousCowardName.class), Key.get(Config.class, GerritServerConfig.class), }) { rebind(parent, k); } for (Class<?> c : new Class<?>[] { AllProjectsName.class, AllUsersCreator.class, AllUsersName.class, GitRepositoryManager.class, SitePaths.class, }) { rebind(parent, Key.get(c)); } } private <T> void rebind(Injector parent, Key<T> c) { bind(c).toProvider(parent.getProvider(c)); } }); >>>>>>> return Guice.createInjector( Stage.DEVELOPMENT, new AbstractModule() { @Override protected void configure() { bind(SchemaVersion.class).to(SchemaVersion.C); for (Key<?> k : new Key<?>[] { Key.get(PersonIdent.class, GerritPersonIdent.class), Key.get(String.class, AnonymousCowardName.class), Key.get(Config.class, GerritServerConfig.class), }) { rebind(parent, k); } for (Class<?> c : new Class<?>[] { AllProjectsName.class, AllUsersCreator.class, AllUsersName.class, GitRepositoryManager.class, SitePaths.class, SystemGroupBackend.class, }) { rebind(parent, Key.get(c)); } } private <T> void rebind(Injector parent, Key<T> c) { bind(c).toProvider(parent.getProvider(c)); } });
<<<<<<< input .stream() .filter(Objects::nonNull) ======= input.stream() >>>>>>> input.stream() .filter(Objects::nonNull)
<<<<<<< import com.qcadoo.model.api.search.CustomRestriction; import com.qcadoo.model.api.search.SearchCriteriaBuilder; ======= import com.qcadoo.model.api.search.Restriction; import com.qcadoo.model.api.search.Restrictions; import com.qcadoo.model.api.search.SimpleCustomRestriction; import com.qcadoo.report.api.Pair; import com.qcadoo.view.QcadooViewConstants; >>>>>>> import com.qcadoo.model.api.search.CustomRestriction; import com.qcadoo.model.api.search.SearchCriteriaBuilder; import com.qcadoo.view.QcadooViewConstants;
<<<<<<< setTypeface(typeface); ======= paint.setTypeface(typeface); StepView.this.nextStepCircleEnabled = nextStepCircleEnabled; StepView.this.nextStepCircleColor = nextStepCircleColor; >>>>>>> setTypeface(typeface); StepView.this.nextStepCircleEnabled = nextStepCircleEnabled; StepView.this.nextStepCircleColor = nextStepCircleColor;
<<<<<<< import com.ubhave.sensormanager.process.push.ConnectionStrengthProcessor; ======= import com.ubhave.sensormanager.process.push.LightProcessor; >>>>>>> import com.ubhave.sensormanager.process.push.ConnectionStrengthProcessor; import com.ubhave.sensormanager.process.push.LightProcessor; <<<<<<< case SensorUtils.SENSOR_TYPE_PHONE_RADIO: return new PhoneRadioProcessor(c, setRawData, setProcessedData); case SensorUtils.SENSOR_TYPE_CONNECTION_STRENGTH: return new ConnectionStrengthProcessor(c, setRawData, setProcessedData); ======= case SensorUtils.SENSOR_TYPE_GYROSCOPE: return new GyroscopeProcessor(c, setRawData, setProcessedData); case SensorUtils.SENSOR_TYPE_LIGHT: return new LightProcessor(c, setRawData, setProcessedData); >>>>>>> case SensorUtils.SENSOR_TYPE_PHONE_RADIO: return new PhoneRadioProcessor(c, setRawData, setProcessedData); case SensorUtils.SENSOR_TYPE_CONNECTION_STRENGTH: return new ConnectionStrengthProcessor(c, setRawData, setProcessedData); case SensorUtils.SENSOR_TYPE_GYROSCOPE: return new GyroscopeProcessor(c, setRawData, setProcessedData); case SensorUtils.SENSOR_TYPE_LIGHT: return new LightProcessor(c, setRawData, setProcessedData);
<<<<<<< public void addFilesToWatch(String fileToWatch, Event fields, int deadTime, Multiline multiline) { ======= public void addFilesToWatch(String fileToWatch, Event fields, long deadTime) { >>>>>>> public void addFilesToWatch(String fileToWatch, Event fields, long deadTime, Multiline multiline) { <<<<<<< private void addSingleFile(String fileToWatch, Event fields, int deadTime, Multiline multiline) throws Exception { ======= private void addSingleFile(String fileToWatch, Event fields, long deadTime) throws Exception { >>>>>>> private void addSingleFile(String fileToWatch, Event fields, long deadTime, Multiline multiline) throws Exception { <<<<<<< private void addWildCardFiles(String filesToWatch, Event fields, int deadTime, Multiline multiline) throws Exception { ======= private void addWildCardFiles(String filesToWatch, Event fields, long deadTime) throws Exception { >>>>>>> private void addWildCardFiles(String filesToWatch, Event fields, long deadTime, Multiline multiline) throws Exception {
<<<<<<< } this.currentState = CURRENT_STATE_NORMAL; ======= // if (isCurrentMediaListener()) {//这里没有设置listener//这代码干什么用的 // Log.i(TAG, "onScrollChange setup " + hashCode()); // startWindowTiny();//这里用不用检测是列表type的 // } >>>>>>> } <<<<<<< // 解决全屏模式下的CURRENT_STATE_ERROR状态下, 点击重新加载后退出了全屏模式. // 间接解决因为mediaplayer状态混乱(全屏模式下会prepare, 全屏模式被退出后小窗口状态异常,被点击后容易导致)引起的App Crash问题 if (currentScreen != SCREEN_WINDOW_FULLSCREEN) { if (JCVideoPlayerManager.listener() != null) { JCVideoPlayerManager.listener().onCompletion(); } } JCVideoPlayerManager.setListener(this); ======= JCVideoPlayerManager.completeAll(); JCVideoPlayerManager.putListener(this); >>>>>>> JCVideoPlayerManager.completeAll(); JCVideoPlayerManager.putListener(this); <<<<<<< setUiWitStateAndScreen(CURRENT_STATE_PREPARING); ======= setUiWitStateAndScreen(CURRENT_STATE_PREPAREING); if (currentState == SCREEN_LAYOUT_LIST) { JCVideoPlayer.setCurrentScrollPlayerListener(this); } >>>>>>> setUiWitStateAndScreen(CURRENT_STATE_PREPARING); if (currentState == SCREEN_LAYOUT_LIST) { JCVideoPlayer.setCurrentScrollPlayerListener(this); } <<<<<<< ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT); ======= ViewGroup vp = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView(); // .findViewById(Window.ID_ANDROID_CONTENT); >>>>>>> ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).getWindow().getDecorView(); // .findViewById(Window.ID_ANDROID_CONTENT); <<<<<<< JCVideoPlayerManager.setListener(null);//这里还不完全, // JCVideoPlayerManager.setLastListener(null); JCMediaManager.instance().currentVideoWidth = 0; JCMediaManager.instance().currentVideoHeight = 0; // 清理缓存变量 JCMediaManager.instance().bufferPercent = 0; JCMediaManager.instance().videoRotation = 0; ======= >>>>>>> JCMediaManager.instance().currentVideoWidth = 0; JCMediaManager.instance().currentVideoHeight = 0; // 清理缓存变量 JCMediaManager.instance().bufferPercent = 0; JCMediaManager.instance().videoRotation = 0; <<<<<<< ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT); ======= ViewGroup vp = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView(); //.findViewById(Window.ID_ANDROID_CONTENT); >>>>>>> ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).getWindow().getDecorView(); // .findViewById(Window.ID_ANDROID_CONTENT); <<<<<<< JCMediaManager.textureView.setVideoSize(JCMediaManager.instance().getVideoSize()); } @Override public void goBackThisListener() { Log.i(TAG, "goBackThisListener " + " [" + this.hashCode() + "] "); currentState = JCMediaManager.instance().lastState; setUiWitStateAndScreen(currentState); addTextureView(); showSupportActionBar(getContext()); ======= JCMediaManager.textureView.requestLayout(); >>>>>>> JCMediaManager.textureView.setVideoSize(JCMediaManager.instance().getVideoSize()); <<<<<<< ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT); ======= ViewGroup vp = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView(); // .findViewById(Window.ID_ANDROID_CONTENT); >>>>>>> ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).getWindow().getDecorView(); // .findViewById(Window.ID_ANDROID_CONTENT); <<<<<<< ViewGroup vp = (ViewGroup) (JCUtils.getAppCompActivity(context)).findViewById(Window.ID_ANDROID_CONTENT); ======= ViewGroup vp = (ViewGroup) ((AppCompatActivity) context).getWindow().getDecorView(); //.findViewById(Window.ID_ANDROID_CONTENT); >>>>>>> ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(context).getWindow().getDecorView(); // .findViewById(Window.ID_ANDROID_CONTENT);
<<<<<<< .set("lineWrapping", false) .set("matchBrackets", prefs.matchBrackets()) .set("mode", getFileSize() == FileSize.SMALL ? getContentType(meta) : null) .set("readOnly", true) ======= .set("tabSize", prefs.tabSize()) .set("mode", fileSize == FileSize.SMALL ? getContentType(meta) : null) .set("lineWrapping", prefs.lineWrapping()) >>>>>>> .set("lineWrapping", false) .set("matchBrackets", prefs.matchBrackets()) .set("lineWrapping", prefs.lineWrapping()) .set("mode", getFileSize() == FileSize.SMALL ? getContentType(meta) : null) .set("readOnly", true)
<<<<<<< JCUtils.scanForActivity(getContext()).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); ======= ((Activity) getContext()).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); ViewGroup vp = (ViewGroup) ((Activity) getContext()).findViewById(Window.ID_ANDROID_CONTENT); View oldF = vp.findViewById(FULLSCREEN_ID); View oldT = vp.findViewById(TINY_ID); if (oldF != null) { vp.removeView(oldF); } if (oldT != null) { vp.removeView(oldT); } >>>>>>> JCUtils.scanForActivity(getContext()).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); ViewGroup vp = (ViewGroup) ((Activity) getContext()).findViewById(Window.ID_ANDROID_CONTENT); View oldF = vp.findViewById(FULLSCREEN_ID); View oldT = vp.findViewById(TINY_ID); if (oldF != null) { vp.removeView(oldF); } if (oldT != null) { vp.removeView(oldT); }
<<<<<<< ======= import static org.ta4j.core.TATestsUtils.assertDecimalEquals; import org.ta4j.core.Tick; >>>>>>> import static org.ta4j.core.TATestsUtils.assertDecimalEquals; <<<<<<< List<Bar> bars = new ArrayList<Bar>(); bars.add(new MockBar(11577.43, 11670.75, 11711.47, 11577.35)); bars.add(new MockBar(11670.90, 11691.18, 11698.22, 11635.74)); bars.add(new MockBar(11688.61, 11722.89, 11742.68, 11652.89)); bars.add(new MockBar(11716.93, 11697.31, 11736.74, 11667.46)); bars.add(new MockBar(11696.86, 11674.76, 11726.94, 11599.68)); bars.add(new MockBar(11672.34, 11637.45, 11677.33, 11573.87)); bars.add(new MockBar(11638.51, 11671.88, 11704.12, 11635.48)); bars.add(new MockBar(11673.62, 11755.44, 11782.23, 11673.62)); bars.add(new MockBar(11753.70, 11731.90, 11757.25, 11700.53)); bars.add(new MockBar(11732.13, 11787.38, 11794.15, 11698.83)); bars.add(new MockBar(11783.82, 11837.93, 11858.78, 11777.99)); bars.add(new MockBar(11834.21, 11825.29, 11861.24, 11798.46)); bars.add(new MockBar(11823.70, 11822.80, 11845.16, 11744.77)); bars.add(new MockBar(11822.95, 11871.84, 11905.48, 11822.80)); bars.add(new MockBar(11873.43, 11980.52, 11982.94, 11867.98)); bars.add(new MockBar(11980.52, 11977.19, 11985.97, 11898.74)); bars.add(new MockBar(11978.85, 11985.44, 12020.52, 11961.83)); bars.add(new MockBar(11985.36, 11989.83, 12019.53, 11971.93)); bars.add(new MockBar(11824.39, 11891.93, 11891.93, 11817.88)); bars.add(new MockBar(11892.50, 12040.16, 12050.75, 11892.50)); bars.add(new MockBar(12038.27, 12041.97, 12057.91, 12018.51)); bars.add(new MockBar(12040.68, 12062.26, 12080.54, 11981.05)); bars.add(new MockBar(12061.73, 12092.15, 12092.42, 12025.78)); bars.add(new MockBar(12092.38, 12161.63, 12188.76, 12092.30)); bars.add(new MockBar(12152.70, 12233.15, 12238.79, 12150.05)); bars.add(new MockBar(12229.29, 12239.89, 12254.23, 12188.19)); bars.add(new MockBar(12239.66, 12229.29, 12239.66, 12156.94)); bars.add(new MockBar(12227.78, 12273.26, 12285.94, 12180.48)); bars.add(new MockBar(12266.83, 12268.19, 12276.21, 12235.91)); bars.add(new MockBar(12266.75, 12226.64, 12267.66, 12193.27)); bars.add(new MockBar(12219.79, 12288.17, 12303.16, 12219.79)); bars.add(new MockBar(12287.72, 12318.14, 12331.31, 12253.24)); bars.add(new MockBar(12389.74, 12212.79, 12389.82, 12176.31)); data = new MockTimeSeries(bars); ======= List<Tick> ticks = new ArrayList<>(); ticks.add(new MockTick(11577.43, 11670.75, 11711.47, 11577.35)); ticks.add(new MockTick(11670.90, 11691.18, 11698.22, 11635.74)); ticks.add(new MockTick(11688.61, 11722.89, 11742.68, 11652.89)); ticks.add(new MockTick(11716.93, 11697.31, 11736.74, 11667.46)); ticks.add(new MockTick(11696.86, 11674.76, 11726.94, 11599.68)); ticks.add(new MockTick(11672.34, 11637.45, 11677.33, 11573.87)); ticks.add(new MockTick(11638.51, 11671.88, 11704.12, 11635.48)); ticks.add(new MockTick(11673.62, 11755.44, 11782.23, 11673.62)); ticks.add(new MockTick(11753.70, 11731.90, 11757.25, 11700.53)); ticks.add(new MockTick(11732.13, 11787.38, 11794.15, 11698.83)); ticks.add(new MockTick(11783.82, 11837.93, 11858.78, 11777.99)); ticks.add(new MockTick(11834.21, 11825.29, 11861.24, 11798.46)); ticks.add(new MockTick(11823.70, 11822.80, 11845.16, 11744.77)); ticks.add(new MockTick(11822.95, 11871.84, 11905.48, 11822.80)); ticks.add(new MockTick(11873.43, 11980.52, 11982.94, 11867.98)); ticks.add(new MockTick(11980.52, 11977.19, 11985.97, 11898.74)); ticks.add(new MockTick(11978.85, 11985.44, 12020.52, 11961.83)); ticks.add(new MockTick(11985.36, 11989.83, 12019.53, 11971.93)); ticks.add(new MockTick(11824.39, 11891.93, 11891.93, 11817.88)); ticks.add(new MockTick(11892.50, 12040.16, 12050.75, 11892.50)); ticks.add(new MockTick(12038.27, 12041.97, 12057.91, 12018.51)); ticks.add(new MockTick(12040.68, 12062.26, 12080.54, 11981.05)); ticks.add(new MockTick(12061.73, 12092.15, 12092.42, 12025.78)); ticks.add(new MockTick(12092.38, 12161.63, 12188.76, 12092.30)); ticks.add(new MockTick(12152.70, 12233.15, 12238.79, 12150.05)); ticks.add(new MockTick(12229.29, 12239.89, 12254.23, 12188.19)); ticks.add(new MockTick(12239.66, 12229.29, 12239.66, 12156.94)); ticks.add(new MockTick(12227.78, 12273.26, 12285.94, 12180.48)); ticks.add(new MockTick(12266.83, 12268.19, 12276.21, 12235.91)); ticks.add(new MockTick(12266.75, 12226.64, 12267.66, 12193.27)); ticks.add(new MockTick(12219.79, 12288.17, 12303.16, 12219.79)); ticks.add(new MockTick(12287.72, 12318.14, 12331.31, 12253.24)); ticks.add(new MockTick(12389.74, 12212.79, 12389.82, 12176.31)); data = new MockTimeSeries(ticks); >>>>>>> List<Bar> bars = new ArrayList<Bar>(); bars.add(new MockBar(11577.43, 11670.75, 11711.47, 11577.35)); bars.add(new MockBar(11670.90, 11691.18, 11698.22, 11635.74)); bars.add(new MockBar(11688.61, 11722.89, 11742.68, 11652.89)); bars.add(new MockBar(11716.93, 11697.31, 11736.74, 11667.46)); bars.add(new MockBar(11696.86, 11674.76, 11726.94, 11599.68)); bars.add(new MockBar(11672.34, 11637.45, 11677.33, 11573.87)); bars.add(new MockBar(11638.51, 11671.88, 11704.12, 11635.48)); bars.add(new MockBar(11673.62, 11755.44, 11782.23, 11673.62)); bars.add(new MockBar(11753.70, 11731.90, 11757.25, 11700.53)); bars.add(new MockBar(11732.13, 11787.38, 11794.15, 11698.83)); bars.add(new MockBar(11783.82, 11837.93, 11858.78, 11777.99)); bars.add(new MockBar(11834.21, 11825.29, 11861.24, 11798.46)); bars.add(new MockBar(11823.70, 11822.80, 11845.16, 11744.77)); bars.add(new MockBar(11822.95, 11871.84, 11905.48, 11822.80)); bars.add(new MockBar(11873.43, 11980.52, 11982.94, 11867.98)); bars.add(new MockBar(11980.52, 11977.19, 11985.97, 11898.74)); bars.add(new MockBar(11978.85, 11985.44, 12020.52, 11961.83)); bars.add(new MockBar(11985.36, 11989.83, 12019.53, 11971.93)); bars.add(new MockBar(11824.39, 11891.93, 11891.93, 11817.88)); bars.add(new MockBar(11892.50, 12040.16, 12050.75, 11892.50)); bars.add(new MockBar(12038.27, 12041.97, 12057.91, 12018.51)); bars.add(new MockBar(12040.68, 12062.26, 12080.54, 11981.05)); bars.add(new MockBar(12061.73, 12092.15, 12092.42, 12025.78)); bars.add(new MockBar(12092.38, 12161.63, 12188.76, 12092.30)); bars.add(new MockBar(12152.70, 12233.15, 12238.79, 12150.05)); bars.add(new MockBar(12229.29, 12239.89, 12254.23, 12188.19)); bars.add(new MockBar(12239.66, 12229.29, 12239.66, 12156.94)); bars.add(new MockBar(12227.78, 12273.26, 12285.94, 12180.48)); bars.add(new MockBar(12266.83, 12268.19, 12276.21, 12235.91)); bars.add(new MockBar(12266.75, 12226.64, 12267.66, 12193.27)); bars.add(new MockBar(12219.79, 12288.17, 12303.16, 12219.79)); bars.add(new MockBar(12287.72, 12318.14, 12331.31, 12253.24)); bars.add(new MockBar(12389.74, 12212.79, 12389.82, 12176.31)); data = new MockTimeSeries(bars); <<<<<<< assertDecimalEquals(kl.getValue(13), 11645.2878); assertDecimalEquals(kl.getValue(14), 11666.9952); assertDecimalEquals(kl.getValue(15), 11688.7782); assertDecimalEquals(kl.getValue(16), 11712.5707); assertDecimalEquals(kl.getValue(17), 11735.3684); assertDecimalEquals(kl.getValue(18), 11724.4143); assertDecimalEquals(kl.getValue(19), 11735.5588); assertDecimalEquals(kl.getValue(20), 11761.7046); assertDecimalEquals(kl.getValue(21), 11778.7855); assertDecimalEquals(kl.getValue(22), 11802.0144); assertDecimalEquals(kl.getValue(23), 11827.1846); assertDecimalEquals(kl.getValue(24), 11859.4459); assertDecimalEquals(kl.getValue(25), 11891.4189); assertDecimalEquals(kl.getValue(26), 11915.3814); assertDecimalEquals(kl.getValue(27), 11938.7221); assertDecimalEquals(kl.getValue(28), 11967.3156); assertDecimalEquals(kl.getValue(29), 11981.9387); ======= assertDecimalEquals(kl.getValue(13), 11556.5468); assertDecimalEquals(kl.getValue(14), 11583.7971); assertDecimalEquals(kl.getValue(15), 11610.8331); assertDecimalEquals(kl.getValue(16), 11639.5955); assertDecimalEquals(kl.getValue(17), 11667.0877); assertDecimalEquals(kl.getValue(18), 11660.5619); assertDecimalEquals(kl.getValue(19), 11675.8782); assertDecimalEquals(kl.getValue(20), 11705.9497); assertDecimalEquals(kl.getValue(21), 11726.7208); assertDecimalEquals(kl.getValue(22), 11753.4154); assertDecimalEquals(kl.getValue(23), 11781.8375); assertDecimalEquals(kl.getValue(24), 11817.1476); assertDecimalEquals(kl.getValue(25), 11851.9771); assertDecimalEquals(kl.getValue(26), 11878.6139); assertDecimalEquals(kl.getValue(27), 11904.4570); assertDecimalEquals(kl.getValue(28), 11935.3907); assertDecimalEquals(kl.getValue(29), 11952.2012); >>>>>>> assertDecimalEquals(kl.getValue(13), 11645.2878); assertDecimalEquals(kl.getValue(14), 11666.9952); assertDecimalEquals(kl.getValue(15), 11688.7782); assertDecimalEquals(kl.getValue(16), 11712.5707); assertDecimalEquals(kl.getValue(17), 11735.3684); assertDecimalEquals(kl.getValue(18), 11724.4143); assertDecimalEquals(kl.getValue(19), 11735.5588); assertDecimalEquals(kl.getValue(20), 11761.7046); assertDecimalEquals(kl.getValue(21), 11778.7855); assertDecimalEquals(kl.getValue(22), 11802.0144); assertDecimalEquals(kl.getValue(23), 11827.1846); assertDecimalEquals(kl.getValue(24), 11859.4459); assertDecimalEquals(kl.getValue(25), 11891.4189); assertDecimalEquals(kl.getValue(26), 11915.3814); assertDecimalEquals(kl.getValue(27), 11938.7221); assertDecimalEquals(kl.getValue(28), 11967.3156); assertDecimalEquals(kl.getValue(29), 11981.9387);
<<<<<<< ======= import static org.ta4j.core.TATestsUtils.assertDecimalEquals; import org.ta4j.core.Tick; >>>>>>> import static org.ta4j.core.TATestsUtils.assertDecimalEquals; <<<<<<< List<Bar> bars = new ArrayList<Bar>(); ======= List<Tick> ticks = new ArrayList<>(); >>>>>>> List<Bar> bars = new ArrayList<Bar>();
<<<<<<< import org.ta4j.core.Bar; ======= import static org.ta4j.core.TATestsUtils.assertDecimalEquals; import org.ta4j.core.Tick; >>>>>>> import static org.ta4j.core.TATestsUtils.assertDecimalEquals; import org.ta4j.core.Bar; <<<<<<< List<Bar> bars = new ArrayList<Bar>(); bars.add(new MockBar(44.98, 45.05, 45.17, 44.96)); bars.add(new MockBar(45.05, 45.10, 45.15, 44.99)); bars.add(new MockBar(45.11, 45.19, 45.32, 45.11)); bars.add(new MockBar(45.19, 45.14, 45.25, 45.04)); bars.add(new MockBar(45.12, 45.15, 45.20, 45.10)); bars.add(new MockBar(45.15, 45.14, 45.20, 45.10)); bars.add(new MockBar(45.13, 45.10, 45.16, 45.07)); bars.add(new MockBar(45.12, 45.15, 45.22, 45.10)); bars.add(new MockBar(45.15, 45.22, 45.27, 45.14)); bars.add(new MockBar(45.24, 45.43, 45.45, 45.20)); bars.add(new MockBar(45.43, 45.44, 45.50, 45.39)); bars.add(new MockBar(45.43, 45.55, 45.60, 45.35)); bars.add(new MockBar(45.58, 45.55, 45.61, 45.39)); bars.add(new MockBar(45.45, 45.01, 45.55, 44.80)); bars.add(new MockBar(45.03, 44.23, 45.04, 44.17)); bars.add(new MockBar(44.23, 43.95, 44.29, 43.81)); bars.add(new MockBar(43.91, 43.08, 43.99, 43.08)); bars.add(new MockBar(43.07, 43.55, 43.65, 43.06)); bars.add(new MockBar(43.56, 43.95, 43.99, 43.53)); bars.add(new MockBar(43.93, 44.47, 44.58, 43.93)); data = new MockTimeSeries(bars); ======= List<Tick> ticks = new ArrayList<>(); ticks.add(new MockTick(44.98, 45.05, 45.17, 44.96)); ticks.add(new MockTick(45.05, 45.10, 45.15, 44.99)); ticks.add(new MockTick(45.11, 45.19, 45.32, 45.11)); ticks.add(new MockTick(45.19, 45.14, 45.25, 45.04)); ticks.add(new MockTick(45.12, 45.15, 45.20, 45.10)); ticks.add(new MockTick(45.15, 45.14, 45.20, 45.10)); ticks.add(new MockTick(45.13, 45.10, 45.16, 45.07)); ticks.add(new MockTick(45.12, 45.15, 45.22, 45.10)); ticks.add(new MockTick(45.15, 45.22, 45.27, 45.14)); ticks.add(new MockTick(45.24, 45.43, 45.45, 45.20)); ticks.add(new MockTick(45.43, 45.44, 45.50, 45.39)); ticks.add(new MockTick(45.43, 45.55, 45.60, 45.35)); ticks.add(new MockTick(45.58, 45.55, 45.61, 45.39)); ticks.add(new MockTick(45.45, 45.01, 45.55, 44.80)); ticks.add(new MockTick(45.03, 44.23, 45.04, 44.17)); ticks.add(new MockTick(44.23, 43.95, 44.29, 43.81)); ticks.add(new MockTick(43.91, 43.08, 43.99, 43.08)); ticks.add(new MockTick(43.07, 43.55, 43.65, 43.06)); ticks.add(new MockTick(43.56, 43.95, 43.99, 43.53)); ticks.add(new MockTick(43.93, 44.47, 44.58, 43.93)); data = new MockTimeSeries(ticks); >>>>>>> List<Bar> bars = new ArrayList<Bar>(); bars.add(new MockBar(44.98, 45.05, 45.17, 44.96)); bars.add(new MockBar(45.05, 45.10, 45.15, 44.99)); bars.add(new MockBar(45.11, 45.19, 45.32, 45.11)); bars.add(new MockBar(45.19, 45.14, 45.25, 45.04)); bars.add(new MockBar(45.12, 45.15, 45.20, 45.10)); bars.add(new MockBar(45.15, 45.14, 45.20, 45.10)); bars.add(new MockBar(45.13, 45.10, 45.16, 45.07)); bars.add(new MockBar(45.12, 45.15, 45.22, 45.10)); bars.add(new MockBar(45.15, 45.22, 45.27, 45.14)); bars.add(new MockBar(45.24, 45.43, 45.45, 45.20)); bars.add(new MockBar(45.43, 45.44, 45.50, 45.39)); bars.add(new MockBar(45.43, 45.55, 45.60, 45.35)); bars.add(new MockBar(45.58, 45.55, 45.61, 45.39)); bars.add(new MockBar(45.45, 45.01, 45.55, 44.80)); bars.add(new MockBar(45.03, 44.23, 45.04, 44.17)); bars.add(new MockBar(44.23, 43.95, 44.29, 43.81)); bars.add(new MockBar(43.91, 43.08, 43.99, 43.08)); bars.add(new MockBar(43.07, 43.55, 43.65, 43.06)); bars.add(new MockBar(43.56, 43.95, 43.99, 43.53)); bars.add(new MockBar(43.93, 44.47, 44.58, 43.93)); data = new MockTimeSeries(bars); <<<<<<< assertDecimalEquals(rwih.getValue(6), 0.2118); assertDecimalEquals(rwih.getValue(7), 0.1581); assertDecimalEquals(rwih.getValue(8), 0.3741); assertDecimalEquals(rwih.getValue(9), 0.5798); assertDecimalEquals(rwih.getValue(10), 0.7518); assertDecimalEquals(rwih.getValue(11), 0.9861); assertDecimalEquals(rwih.getValue(12), 0.9652); assertDecimalEquals(rwih.getValue(13), 0.5408); assertDecimalEquals(rwih.getValue(14), -0.1607); assertDecimalEquals(rwih.getValue(15), -1.0879); assertDecimalEquals(rwih.getValue(16), -1.1186); assertDecimalEquals(rwih.getValue(17), -1.4072); assertDecimalEquals(rwih.getValue(18), -0.6779); ======= assertDecimalEquals(rwih.getValue(6), 0.5006); assertDecimalEquals(rwih.getValue(7), 0.3381); assertDecimalEquals(rwih.getValue(8), 0.7223); assertDecimalEquals(rwih.getValue(9), 0.9549); assertDecimalEquals(rwih.getValue(10), 1.1681); assertDecimalEquals(rwih.getValue(11), 1.3740); assertDecimalEquals(rwih.getValue(12), 1.2531); assertDecimalEquals(rwih.getValue(13), 0.6202); assertDecimalEquals(rwih.getValue(14), -0.1743); assertDecimalEquals(rwih.getValue(15), -1.1591); assertDecimalEquals(rwih.getValue(16), -1.1662); assertDecimalEquals(rwih.getValue(17), -1.4539); assertDecimalEquals(rwih.getValue(18), -0.6963); >>>>>>> assertDecimalEquals(rwih.getValue(6), 0.2118); assertDecimalEquals(rwih.getValue(7), 0.1581); assertDecimalEquals(rwih.getValue(8), 0.3741); assertDecimalEquals(rwih.getValue(9), 0.5798); assertDecimalEquals(rwih.getValue(10), 0.7518); assertDecimalEquals(rwih.getValue(11), 0.9861); assertDecimalEquals(rwih.getValue(12), 0.9652); assertDecimalEquals(rwih.getValue(13), 0.5408); assertDecimalEquals(rwih.getValue(14), -0.1607); assertDecimalEquals(rwih.getValue(15), -1.0879); assertDecimalEquals(rwih.getValue(16), -1.1186); assertDecimalEquals(rwih.getValue(17), -1.4072); assertDecimalEquals(rwih.getValue(18), -0.6779);
<<<<<<< ======= /** * Returns the correctly rounded natural logarithm (base e) of the <code>double</code> value of this {@code Decimal}. * /!\ Warning! Uses the {@code StrictMath#log(double)} method under the hood. * @return the natural logarithm (base e) of {@code this} * @see StrictMath#log(double) */ public Decimal log() { if (this == NaN) { return NaN; } return new Decimal(StrictMath.log(delegate.doubleValue())); } >>>>>>> /** * Returns the correctly rounded positive square root of the <code>double</code> value of this {@code Decimal}. * /!\ Warning! Uses the {@code StrictMath#sqrt(double)} method under the hood. * @return the positive square root of {@code this} * @see StrictMath#sqrt(double) */ public Decimal sqrt() { if (this == NaN) { return NaN; } return new Decimal(StrictMath.sqrt(delegate.doubleValue())); } <<<<<<< public static Decimal valueOf(BigDecimal val){ return new Decimal(val); } ======= /** * Returns a {@code Decimal} version of the given {@code float}. * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(float val) { if (val == Float.NaN) { return Decimal.NaN; } return new Decimal(val); } /** * Returns a {@code Decimal} version of the given {@code double}. * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(double val) { if (val == Double.NaN) { return Decimal.NaN; } return new Decimal(val); } /** * Returns a {@code Decimal} version of the given {@code Decimal}. * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(Decimal val) { return val; } /** * Returns a {@code Decimal} version of the given {@code Number}. * Warning: This method turns the number into a string first * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(Number val) { return new Decimal(val.toString()); } >>>>>>> /** * Returns a {@code Decimal} version of the given {@code float}. * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(float val) { if (val == Float.NaN) { return Decimal.NaN; } return new Decimal(val); } public static Decimal valueOf(BigDecimal val){ return new Decimal(val); } /** * Returns a {@code Decimal} version of the given {@code double}. * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(double val) { if (val == Double.NaN) { return Decimal.NaN; } return new Decimal(val); } /** * Returns a {@code Decimal} version of the given {@code Decimal}. * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(Decimal val) { return val; } /** * Returns a {@code Decimal} version of the given {@code Number}. * Warning: This method turns the number into a string first * @param val the number * @return the {@code Decimal} */ public static Decimal valueOf(Number val) { return new Decimal(val.toString()); }
<<<<<<< ======= import static org.ta4j.core.TATestsUtils.assertDecimalEquals; import org.ta4j.core.Tick; >>>>>>> import static org.ta4j.core.TATestsUtils.assertDecimalEquals; <<<<<<< List<Bar> bars = new ArrayList<Bar>(); ======= List<Tick> ticks = new ArrayList<>(); >>>>>>> List<Bar> bars = new ArrayList<Bar>();
<<<<<<< import org.eurekastreams.server.domain.Person; import org.eurekastreams.server.search.modelview.DomainGroupModelView; ======= >>>>>>> import org.eurekastreams.server.search.modelview.DomainGroupModelView;
<<<<<<< import org.apache.commons.logging.Log; import org.eurekastreams.commons.actions.TaskHandlerExecutionStrategy; ======= >>>>>>> import org.eurekastreams.commons.actions.TaskHandlerExecutionStrategy;
<<<<<<< * Compare against a log level that is associated with a context value. By default the context is the * {@link ThreadContext}, but users may {@linkplain ContextDataInjectorFactory configure} a custom * {@link ContextDataInjector} which obtains context data from some other source. ======= * Compares against a log level that is associated with an MDC value. >>>>>>> * Compares against a log level that is associated with a context value. By default the context is the * {@link ThreadContext}, but users may {@linkplain ContextDataInjectorFactory configure} a custom * {@link ContextDataInjector} which obtains context data from some other source. <<<<<<< private final ContextDataInjector injector = ContextDataInjectorFactory.createInjector(); ======= >>>>>>> private final ContextDataInjector injector = ContextDataInjectorFactory.createInjector();
<<<<<<< final boolean sendTimestamp, final Property[] properties, final String key) { ======= final Property[] properties, final String key, final String retryCount) { >>>>>>> final boolean sendTimestamp, final Property[] properties, final String key, final String retryCount) { <<<<<<< final boolean syncSend, final boolean sendTimestamp, final Property[] properties, final String key) { ======= final boolean syncSend, final Property[] properties, final String key, final String retryCount) { >>>>>>> final boolean syncSend, final boolean sendTimestamp, final Property[] properties, final String key, final String retryCount) { <<<<<<< return getManager(sb.toString(), factory, new FactoryData(loggerContext, topic, syncSend, sendTimestamp, properties, key)); ======= return getManager(sb.toString(), factory, new FactoryData(loggerContext, topic, syncSend, properties, key, retryCount)); >>>>>>> return getManager(sb.toString(), factory, new FactoryData(loggerContext, topic, syncSend, sendTimestamp, properties, key, retryCount)); <<<<<<< final boolean sendTimestamp, final Property[] properties, final String key) { ======= final Property[] properties, final String key, final String retryCount) { >>>>>>> final boolean sendTimestamp, final Property[] properties, final String key, final String retryCount) { <<<<<<< return new KafkaManager(data.loggerContext, name, data.topic, data.syncSend, data.sendTimestamp, data.properties, data.key); ======= return new KafkaManager(data.loggerContext, name, data.topic, data.syncSend, data.properties, data.key, data.retryCount); >>>>>>> return new KafkaManager(data.loggerContext, name, data.topic, data.syncSend, data.sendTimestamp, data.properties, data.key, data.retryCount);
<<<<<<< import java.util.Map; import java.util.concurrent.ConcurrentHashMap; ======= import static org.junit.Assert.assertNotNull; >>>>>>> <<<<<<< private final Class<? extends ContextSelector> contextSelectorClass; private final Map<String, String> systemProperties = new ConcurrentHashMap<>(); ======= >>>>>>> <<<<<<< /** * Sets a system property before the test and clears that property after the test. * * @param key system property key * @param value system property value * @return {@code this} * @since 2.7 */ public LoggerContextRule withSystemProperty(final String key, final String value) { this.systemProperties.put(key, value); return this; } ======= >>>>>>> <<<<<<< for (final Map.Entry<String, String> systemProperty : systemProperties.entrySet()) { System.setProperty(systemProperty.getKey(), systemProperty.getValue()); } context = Configurator.initialize( description.getDisplayName(), description.getTestClass().getClassLoader(), configLocation ); ======= context = Configurator.initialize(description.getDisplayName(), description.getTestClass().getClassLoader(), configLocation); >>>>>>> context = Configurator.initialize(description.getDisplayName(), description.getTestClass().getClassLoader(), configLocation);
<<<<<<< import com.google.api.codegen.config.FieldType; import com.google.api.codegen.config.InterfaceConfig; import com.google.api.codegen.config.MethodConfig; import com.google.api.codegen.config.PageStreamingConfig; ======= import com.google.api.codegen.config.GapicInterfaceConfig; import com.google.api.codegen.config.GapicMethodConfig; >>>>>>> import com.google.api.codegen.config.FieldType; import com.google.api.codegen.config.InterfaceConfig; import com.google.api.codegen.config.MethodConfig; <<<<<<< public String getFieldAddFunctionName(TypeRef type, Name identifier) { return publicMethodName(Name.from("add").join(identifier)); } @Override public String getFieldAddFunctionName(FieldType field) { return publicMethodName(Name.from("add").join(field.getSimpleName())); } @Override public String getFieldGetFunctionName(FieldType field) { if (field.isRepeated() && !field.isMap()) { return publicMethodName(Name.from("get").join(field.getSimpleName()).join("list")); } else { return publicMethodName(Name.from("get").join(field.getSimpleName())); } } @Override ======= >>>>>>> public String getFieldAddFunctionName(TypeRef type, Name identifier) { return publicMethodName(Name.from("add").join(identifier)); } @Override public String getFieldAddFunctionName(FieldType field) { return publicMethodName(Name.from("add").join(field.getSimpleName())); } @Override public String getFieldGetFunctionName(FieldType field) { if (field.isRepeated() && !field.isMap()) { return publicMethodName(Name.from("get").join(field.getSimpleName()).join("list")); } else { return publicMethodName(Name.from("get").join(field.getSimpleName())); } } @Override
<<<<<<< abstract ImmutableMap<String, InterfaceConfig> getInterfaceConfigMap(); ======= /** Returns the interface config map. */ public abstract ImmutableMap<String, GapicInterfaceConfig> getInterfaceConfigMap(); >>>>>>> abstract ImmutableMap<String, InterfaceConfig> getInterfaceConfigMap(); /** Returns the interface config map. */ public abstract ImmutableMap<String, GapicInterfaceConfig> getInterfaceConfigMap();
<<<<<<< String getSimpleName(); @Nullable SmokeTestConfig getSmokeTestConfig(); List<? extends MethodConfig> getMethodConfigs(); ImmutableMap<String, ImmutableSet<Code>> getRetryCodesDefinition(); ImmutableMap<String, RetrySettings> getRetrySettingsDefinition(); ImmutableList<String> getRequiredConstructorParams(); String getManualDoc(); MethodConfig getMethodConfig(Method method); MethodConfig getMethodConfig(com.google.api.codegen.discovery.Method method); boolean hasPageStreamingMethods(); boolean hasLongRunningOperations(); boolean hasDefaultServiceAddress(); boolean hasDefaultServiceScopes(); boolean hasBatchingMethods(); boolean hasGrpcStreamingMethods(); boolean hasDefaultInstance(); @Nullable ImmutableList<SingleResourceNameConfig> getSingleResourceNameConfigs(); boolean hasInterfaceNameOverride(); ======= String getRawName(); >>>>>>> @Nullable SmokeTestConfig getSmokeTestConfig(); List<? extends MethodConfig> getMethodConfigs(); ImmutableMap<String, ImmutableSet<Code>> getRetryCodesDefinition(); ImmutableMap<String, RetrySettings> getRetrySettingsDefinition(); ImmutableList<String> getRequiredConstructorParams(); String getManualDoc(); MethodConfig getMethodConfig(Method method); MethodConfig getMethodConfig(com.google.api.codegen.discovery.Method method); boolean hasPageStreamingMethods(); boolean hasLongRunningOperations(); boolean hasDefaultServiceAddress(); boolean hasDefaultServiceScopes(); boolean hasBatchingMethods(); boolean hasGrpcStreamingMethods(); boolean hasDefaultInstance(); @Nullable ImmutableList<SingleResourceNameConfig> getSingleResourceNameConfigs(); boolean hasInterfaceNameOverride(); String getRawName();
<<<<<<< import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; ======= import com.google.common.collect.HashMultimap; >>>>>>> import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.HashMultimap; <<<<<<< ======= import com.google.common.collect.Maps; import com.google.common.collect.SetMultimap; >>>>>>> import com.google.common.collect.SetMultimap; <<<<<<< private ListMultimap<Change.Id, Ref> refsByChange; private Map<ObjectId, Ref> refsById; ======= private SetMultimap<ObjectId, Ref> refsById; >>>>>>> private ListMultimap<Change.Id, Ref> refsByChange; private SetMultimap<ObjectId, Ref> refsById;
<<<<<<< import com.boydti.fawe.util.TaskManager; import static com.google.common.base.Preconditions.checkNotNull; ======= >>>>>>> import com.boydti.fawe.util.TaskManager; <<<<<<< import javax.annotation.Nullable; import java.util.regex.Pattern; ======= import javax.annotation.Nullable; import java.util.regex.Pattern; import static com.google.common.base.Preconditions.checkNotNull; >>>>>>> import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkNotNull; import java.util.regex.Pattern;
<<<<<<< import com.sk89q.worldedit.util.formatting.WorldEditText; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter; ======= import com.sk89q.worldedit.util.formatting.WorldEditText; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; >>>>>>> import com.sk89q.worldedit.util.formatting.WorldEditText; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter; <<<<<<< @Override public boolean togglePermission(String permission) { return false; } @Override public void setPermission(String permission, boolean value) { } @Override public void checkPermission(String permission) throws AuthorizationException { } @Override ======= @Override public void checkPermission(String permission) throws AuthorizationException { } @Override >>>>>>> @Override public void setPermission(String permission, boolean value) { } @Override public void checkPermission(String permission) throws AuthorizationException { } @Override <<<<<<< if (sender instanceof Entity) { Entity entity = (Entity) sender; return (entity.isValid() && !entity.isDead()); } return true; ======= return true; >>>>>>> if (sender instanceof Entity) { Entity entity = (Entity) sender; return (entity.isValid() && !entity.isDead()); } return true;
<<<<<<< ======= import com.sk89q.worldedit.MaxChangedBlocksException; >>>>>>> <<<<<<< ======= import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; >>>>>>> import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; <<<<<<< BlockType initialType = clicked.getExtent().getBlock(clicked.toBlockPoint()).getBlockType(); ======= BlockType initialType = clicked.getExtent().getBlock(clicked.toVector().toBlockPoint()).getBlockType(); >>>>>>> BlockType initialType = clicked.getExtent().getBlock(clicked.toBlockPoint()).getBlockType(); <<<<<<< for (int x = ox - range; x <= ox + range; ++x) { for (int z = oz - range; z <= oz + range; ++z) { for (int y = oy + range; y >= oy - range; --y) { if (initialType.equals(editSession.getLazyBlock(x, y, z))) { continue; // try (EditSession editSession = session.createEditSession(player)) { // editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop); // // try { // for (int x = ox - range; x <= ox + range; ++x) { // for (int y = oy - range; y <= oy + range; ++y) { // for (int z = oz - range; z <= oz + range; ++z) { // BlockVector3 pos = new BlockVector3(x, y, z); // if (editSession.getBlock(pos).getBlockType() != initialType) { // continue; // } // // ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toBlockPoint().distanceSq(pos)); // // editSession.setBlock(pos, BlockTypes.AIR.getDefaultState()); // } ======= try { for (int x = ox - range; x <= ox + range; ++x) { for (int y = oy - range; y <= oy + range; ++y) { for (int z = oz - range; z <= oz + range; ++z) { BlockVector3 pos = BlockVector3.at(x, y, z); if (editSession.getBlock(pos).getBlockType() != initialType) { continue; } ((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toVector().toBlockPoint().distanceSq(pos)); editSession.setBlock(pos, BlockTypes.AIR.getDefaultState()); } >>>>>>> for (int x = ox - range; x <= ox + range; ++x) { for (int z = oz - range; z <= oz + range; ++z) { for (int y = oy + range; y >= oy - range; --y) { if (initialType.equals(editSession.getLazyBlock(x, y, z))) { continue;
<<<<<<< public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws WorldEditException; ======= void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException; >>>>>>> void build(EditSession editSession, Vector position, Pattern pattern, double size) throws WorldEditException;
<<<<<<< import javax.annotation.Nullable; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; ======= import java.util.Collections; import java.util.Comparator; >>>>>>> import javax.annotation.Nullable; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; <<<<<<< ======= private final Map<Property<?>, Object> values; >>>>>>> <<<<<<< BlockState(BlockType blockType) { ======= // Neighbouring state table. private Table<Property<?>, Object, BlockState> states; BlockState(BlockType blockType) { >>>>>>> BlockState(BlockType blockType) { <<<<<<< charSequence.setSubstring(propStrStart + name.length() + 2, state.length() - 1); ======= for(final Map.Entry<Property<?>, Object> entry : this.values.entrySet()) { final Property<Object> property = (Property<Object>) entry.getKey(); >>>>>>> charSequence.setSubstring(propStrStart + name.length() + 2, state.length() - 1); <<<<<<< // suggest PropertyKey key = PropertyKey.get(charSequence); if (key == null || !type.hasProperty(key)) { // Suggest property String input = charSequence.toString(); BlockType finalType = type; throw new SuggestInputParseException("Invalid property " + type + " | " + input, input, () -> finalType.getProperties().stream() .map(p -> p.getName()) .filter(p -> p.startsWith(input)) .collect(Collectors.toList())); } else { throw new SuggestInputParseException("No operator for " + state, "", () -> Arrays.asList("=")); } ======= System.out.println(stateMap); WorldEdit.logger.warn("Found a null state at " + this.withValue(property, value)); >>>>>>> // suggest PropertyKey key = PropertyKey.get(charSequence); if (key == null || !type.hasProperty(key)) { // Suggest property String input = charSequence.toString(); BlockType finalType = type; throw new SuggestInputParseException("Invalid property " + type + " | " + input, input, () -> finalType.getProperties().stream() .map(p -> p.getName()) .filter(p -> p.startsWith(input)) .collect(Collectors.toList())); } else { throw new SuggestInputParseException("No operator for " + state, "", () -> Arrays.asList("=")); } <<<<<<< try { BlockType type = getBlockType(); int newState = ((AbstractProperty) property).modify(this.getInternalId(), value); return newState != this.getInternalId() ? type.withStateId(newState) : this; } catch (ClassCastException e) { throw new IllegalArgumentException("Property not found: " + property); } } @Override public <V> BlockState with(final PropertyKey property, final V value) { try { BlockType type = getBlockType(); int newState = ((AbstractProperty) type.getProperty(property)).modify(this.getInternalId(), value); return newState != this.getInternalId() ? type.withStateId(newState) : this; } catch (ClassCastException e) { throw new IllegalArgumentException("Property not found: " + property); } } @Override public final <V> V getState(final Property<V> property) { try { AbstractProperty ap = (AbstractProperty) property; return (V) ap.getValue(this.getInternalId()); } catch (ClassCastException e) { throw new IllegalArgumentException("Property not found: " + property); } ======= BlockState result = states.get(property, value); return result == null ? this : result; >>>>>>> try { BlockType type = getBlockType(); int newState = ((AbstractProperty) property).modify(this.getInternalId(), value); return newState != this.getInternalId() ? type.withStateId(newState) : this; } catch (ClassCastException e) { throw new IllegalArgumentException("Property not found: " + property); } } @Override public <V> BlockState with(final PropertyKey property, final V value) { try { BlockType type = getBlockType(); int newState = ((AbstractProperty) type.getProperty(property)).modify(this.getInternalId(), value); return newState != this.getInternalId() ? type.withStateId(newState) : this; } catch (ClassCastException e) { throw new IllegalArgumentException("Property not found: " + property); } } @Override public final <V> V getState(final Property<V> property) { try { AbstractProperty ap = (AbstractProperty) property; return (V) ap.getValue(this.getInternalId()); } catch (ClassCastException e) { throw new IllegalArgumentException("Property not found: " + property); } <<<<<<< @Override public int hashCode() { return getOrdinal(); } ======= >>>>>>> <<<<<<< public String toString() { return getAsString(); ======= public BaseBlock toBaseBlock() { return this.emptyBaseBlock; >>>>>>> public BaseBlock toBaseBlock() { return this.emptyBaseBlock;
<<<<<<< import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; ======= import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.math.BlockVector3; >>>>>>> import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.math.BlockVector3; <<<<<<< public HeightMap(EditSession session, Region region) { this(session, region, false); } public HeightMap(EditSession session, Region region, boolean naturalOnly) { this(session, region, naturalOnly, false); } public HeightMap(EditSession session, Region region, boolean naturalOnly, boolean layers) { ======= public HeightMap(EditSession session, Region region, @Nullable Mask mask) { >>>>>>> public HeightMap(EditSession session, Region region) { this(session, region, false); } public HeightMap(EditSession session, Region region, Mask mask) { this(session, region, mask, false); } public HeightMap(EditSession session, Region region, Mask mask, boolean layers) { <<<<<<< invalid = new boolean[data.length]; if (layers) { BlockVector3 min = region.getMinimumPoint(); BlockVector3 max = region.getMaximumPoint(); int bx = min.getBlockX(); int bz = min.getBlockZ(); Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion(); Iterator<BlockVector2> iter = new Fast2DIterator(flat, session).iterator(); int layer = 0; while (iter.hasNext()) { BlockVector2 pos = iter.next(); int x = pos.getBlockX(); int z = pos.getBlockZ(); layer = session.getNearestSurfaceLayer(x, z, (layer + 7) >> 3, 0, maxY); data[(z - bz) * width + (x - bx)] = layer; } } else { // Store current heightmap data int index = 0; if (naturalOnly) { for (int z = 0; z < height; ++z) { for (int x = 0; x < width; ++x, index++) { data[index] = session.getHighestTerrainBlock(x + minX, z + minZ, minY, maxY); } } } else { int yTmp = 255; for (int z = 0; z < height; ++z) { for (int x = 0; x < width; ++x, index++) { yTmp = session.getNearestSurfaceTerrainBlock(x + minX, z + minZ, yTmp, minY, maxY, Integer.MIN_VALUE, Integer.MAX_VALUE); switch (yTmp) { case Integer.MIN_VALUE: yTmp = minY; invalid[index] = true; break; case Integer.MAX_VALUE: yTmp = maxY; invalid[index] = true; break; } data[index] = yTmp; } } ======= for (int z = 0; z < height; ++z) { for (int x = 0; x < width; ++x) { data[z * width + x] = session.getHighestTerrainBlock(x + minX, z + minZ, minY, maxY, mask); >>>>>>> invalid = new boolean[data.length]; if (layers) { BlockVector3 min = region.getMinimumPoint(); BlockVector3 max = region.getMaximumPoint(); int bx = min.getBlockX(); int bz = min.getBlockZ(); Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion(); Iterator<BlockVector2> iter = new Fast2DIterator(flat, session).iterator(); int layer = 0; while (iter.hasNext()) { BlockVector2 pos = iter.next(); int x = pos.getBlockX(); int z = pos.getBlockZ(); layer = session.getNearestSurfaceLayer(x, z, (layer + 7) >> 3, 0, maxY, mask); data[(z - bz) * width + (x - bx)] = layer; } } else { // Store current heightmap data int index = 0; int yTmp = 255; for (int z = 0; z < height; ++z) { for (int x = 0; x < width; ++x, index++) { yTmp = session.getNearestSurfaceTerrainBlock(x + minX, z + minZ, yTmp, minY, maxY, Integer.MIN_VALUE, Integer.MAX_VALUE, mask); switch (yTmp) { case Integer.MIN_VALUE: yTmp = minY; invalid[index] = true; break; case Integer.MAX_VALUE: yTmp = maxY; invalid[index] = true; break; } data[index] = yTmp; } <<<<<<< for (int setY = newBlock - 1, getY = curBlock; setY >= curBlock; --setY, getY--) { BlockStateHolder get = session.getBlock(xr, getY, zr); if (get != EditSession.nullBlock) tmpBlock = get; session.setBlock(xr, setY, zr, tmpBlock); ++blocksChanged; } int setData = newHeight & 15; if (setData != 0) { existing = PropertyGroup.LEVEL.set(existing, setData - 1); session.setBlock(xr, newBlock, zr, existing); ++blocksChanged; } else { existing = PropertyGroup.LEVEL.set(existing, 15); session.setBlock(xr, newBlock, zr, existing); //======= // BlockState existing = session.getBlock(BlockVector3.at(xr, curHeight, zr)); // // // Skip water/lava // if (existing.getBlockType() != BlockTypes.WATER && existing.getBlockType() != BlockTypes.LAVA) { // session.setBlock(BlockVector3.at(xr, newHeight, zr), existing); // ++blocksChanged; // // // Grow -- start from 1 below top replacing airblocks // for (int y = newHeight - 1 - originY; y >= 0; --y) { // int copyFrom = (int) (y * scale); // session.setBlock(BlockVector3.at(xr, originY + y, zr), session.getBlock(BlockVector3.at(xr, originY + copyFrom, zr))); //>>>>>>> 2c8b2fe0... Move vectors to static creators, for caching ======= for (int y = newHeight - 1 - originY; y >= 0; --y) { int copyFrom = (int) (y * scale); session.setBlock(BlockVector3.at(xr, originY + y, zr), session.getBlock(BlockVector3.at(xr, originY + copyFrom, zr))); >>>>>>> for (int setY = newBlock - 1, getY = curBlock; setY >= curBlock; --setY, getY--) { BlockStateHolder get = session.getBlock(xr, getY, zr); if (get != EditSession.nullBlock) tmpBlock = get; session.setBlock(xr, setY, zr, tmpBlock); ++blocksChanged; } int setData = newHeight & 15; if (setData != 0) { existing = PropertyGroup.LEVEL.set(existing, setData - 1); session.setBlock(xr, newBlock, zr, existing); ++blocksChanged; } else { existing = PropertyGroup.LEVEL.set(existing, 15); session.setBlock(xr, newBlock, zr, existing); <<<<<<< //<<<<<<< HEAD // Fill rest with air for (int y = newBlock + 1; y <= ((curHeight + 15) >> 4); ++y) { session.setBlock(xr, y, zr, fillerAir); //======= // // Shrink -- start from bottom // for (int y = 0; y < newHeight - originY; ++y) { // int copyFrom = (int) (y * scale); // session.setBlock(BlockVector3.at(xr, originY + y, zr), session.getBlock(BlockVector3.at(xr, originY + copyFrom, zr))); //>>>>>>> 2c8b2fe0... Move vectors to static creators, for caching ======= // Shrink -- start from bottom for (int y = 0; y < newHeight - originY; ++y) { int copyFrom = (int) (y * scale); session.setBlock(BlockVector3.at(xr, originY + y, zr), session.getBlock(BlockVector3.at(xr, originY + copyFrom, zr))); >>>>>>> // Fill rest with air for (int y = newBlock + 1; y <= ((curHeight + 15) >> 4); ++y) { session.setBlock(xr, y, zr, fillerAir);
<<<<<<< import net.minecraft.block.properties.IProperty; import net.minecraft.util.ResourceLocation; ======= import net.minecraft.state.IProperty; >>>>>>> import net.minecraft.block.properties.IProperty; import net.minecraft.util.ResourceLocation; import net.minecraft.state.IProperty; <<<<<<< @Nullable @Override public String getName(BlockType blockType) { return Block.REGISTRY.getObject(new ResourceLocation(blockType.getId())).getLocalizedName(); } ======= @Nullable @Override public String getName(BlockType blockType) { Block block = ForgeAdapter.adapt(blockType); if (block != null) { return block.getNameTextComponent().getFormattedText(); } else { return super.getName(blockType); } } >>>>>>> @Nullable @Override public String getName(BlockType blockType) { Block block = ForgeAdapter.adapt(blockType); if (block != null) { return block.getNameTextComponent().getFormattedText(); } else { return super.getName(blockType); } }
<<<<<<< ======= import com.sk89q.worldedit.util.formatting.component.MessageBox; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.paste.ActorCallbackPaste; import com.sk89q.worldedit.util.report.ConfigReport; import com.sk89q.worldedit.util.report.ReportList; import com.sk89q.worldedit.util.report.SystemInfoReport; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; import java.io.File; >>>>>>> import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.component.MessageBox; <<<<<<< ======= import java.nio.charset.StandardCharsets; >>>>>>> <<<<<<< import java.util.Locale; import java.util.Map; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; ======= >>>>>>> import java.util.Map; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; <<<<<<< FaweVersion fVer = Fawe.get().getVersion(); String fVerStr = fVer == null ? "unknown" : "-" + fVer.build; actor.print("FastAsyncWorldEdit" + fVerStr + " created by Empire92"); if (fVer != null) { actor.printDebug("----------- Platforms -----------"); FaweVersion version = Fawe.get().getVersion(); Date date = new GregorianCalendar(2000 + version.year, version.month - 1, version.day) .getTime(); actor.printDebug(" - DATE: " + date.toLocaleString()); actor.printDebug(" - COMMIT: " + Integer.toHexString(version.hash)); actor.printDebug(" - BUILD: " + version.build); actor.printDebug(" - PLATFORM: " + Settings.IMP.PLATFORM); actor.printDebug("------------------------------------"); } ======= actor.printInfo(TranslatableComponent.of("worldedit.version.version", TextComponent.of(WorldEdit.getVersion()))); actor.printInfo(TextComponent.of("https://github.com/EngineHub/worldedit/")); >>>>>>> FaweVersion fVer = Fawe.get().getVersion(); String fVerStr = fVer == null ? "unknown" : "-" + fVer.build; actor.print("FastAsyncWorldEdit" + fVerStr + " created by Empire92"); if (fVer != null) { FaweVersion version = Fawe.get().getVersion(); Date date = new GregorianCalendar(2000 + version.year, version.month - 1, version.day) .getTime(); TextComponent dateArg = TextComponent.of(date.toLocaleString()); TextComponent commitArg = TextComponent.of(Integer.toHexString(version.hash)); TextComponent buildArg = TextComponent.of(version.build); TextComponent platformArg = TextComponent.of(Settings.IMP.PLATFORM); actor.printInfo(TranslatableComponent.of("worldedit.version.version", dateArg, commitArg, buildArg, platformArg)); } actor.printInfo(TextComponent.of("Wiki: https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/wiki")); <<<<<<< Fawe.get().setupConfigs(); actor.print("Configuration and translations reloaded!"); ======= actor.printInfo(TranslatableComponent.of("worldedit.reload.config")); >>>>>>> Fawe.get().setupConfigs(); actor.printInfo(TranslatableComponent.of("worldedit.reload.config"));
<<<<<<< ======= import org.bukkit.Bukkit; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.EntityType; import org.enginehub.piston.CommandManager; import javax.annotation.Nullable; >>>>>>> <<<<<<< import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nullable; import org.bukkit.Bukkit; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.EntityType; import org.enginehub.piston.CommandManager; ======= import java.util.stream.Collectors; import java.util.stream.Stream; import static com.sk89q.worldedit.util.formatting.WorldEditText.reduceToText; >>>>>>> import java.util.stream.Collectors; import java.util.stream.Stream; import org.bukkit.Bukkit; import javax.annotation.Nullable; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.entity.EntityType; import org.enginehub.piston.CommandManager;
<<<<<<< import java.util.Optional; ======= import com.google.inject.assistedinject.Assisted; import java.io.IOException; >>>>>>> import com.google.inject.assistedinject.Assisted; import java.util.Optional;
<<<<<<< public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { BBC.SELECTOR_CENTER.send(player, pos, 0); ======= public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { player.print("Starting a new cylindrical selection at " + pos + "."); >>>>>>> public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { BBC.SELECTOR_CENTER.send(player, pos, 0); <<<<<<< if (!center.equals(BlockVector3.ZERO)) { BBC.SELECTOR_RADIUS.send(player, NUMBER_FORMAT.format(region.getRadius().getX()) + "/" + NUMBER_FORMAT.format(region.getRadius().getZ()), region.getArea()); ======= if (!center.equals(Vector3.ZERO)) { player.print("Radius set to " + NUMBER_FORMAT.format(region.getRadius().getX()) + "/" + NUMBER_FORMAT.format(region.getRadius().getZ()) + " blocks. (" + region.getArea() + ")."); >>>>>>> if (!center.equals(Vector3.ZERO)) { BBC.SELECTOR_RADIUS.send(player, NUMBER_FORMAT.format(region.getRadius().getX()) + "/" + NUMBER_FORMAT.format(region.getRadius().getZ()), region.getArea());
<<<<<<< import static com.google.common.base.Preconditions.checkNotNull; ======= >>>>>>> import static com.google.common.base.Preconditions.checkNotNull; <<<<<<< import javax.annotation.Nullable; import java.util.List; /** * A base class for {@link Extent}s that merely passes extents onto another. */ public class AbstractDelegateExtent implements LightingExtent { private transient final Extent extent; protected MutableBlockVector3 mutable = new MutableBlockVector3(0, 0, 0); /** * Create a new instance. * * @param extent the extent */ public AbstractDelegateExtent(Extent extent) { checkNotNull(extent); this.extent = extent; } public int getSkyLight(int x, int y, int z) { if (extent instanceof LightingExtent) { return ((LightingExtent) extent).getSkyLight(x, y, z); } return 0; } @Override public int getMaxY() { return extent.getMaxY(); } ======= >>>>>>>
<<<<<<< import com.boydti.fawe.FaweAPI; import com.boydti.fawe.FaweCache; import com.boydti.fawe.config.BBC; import com.boydti.fawe.object.FaweLimit; import com.sk89q.jnbt.CompoundTag; ======= import com.google.common.collect.Lists; >>>>>>> import com.boydti.fawe.FaweAPI; import com.boydti.fawe.FaweCache; import com.boydti.fawe.config.BBC; import com.boydti.fawe.object.FaweLimit; import com.sk89q.jnbt.CompoundTag; <<<<<<< import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; ======= import com.sk89q.worldedit.util.formatting.component.TextUtils; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; >>>>>>> import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.util.formatting.component.TextUtils; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.world.block.BlockTypes; <<<<<<< actor.printError("//curve only works with convex polyhedral selections"); return; ======= actor.printError(TranslatableComponent.of("worldedit.curve.convex-only")); return 0; >>>>>>> actor.printError(TranslatableComponent.of("worldedit.curve.convex-only")); return; <<<<<<< actor.print(blocksChanged + " block(s) have been changed."); ======= actor.printInfo(TranslatableComponent.of("worldedit.curve.changed", TextComponent.of(blocksChanged))); return blocksChanged; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.curve.changed", TextComponent.of(blocksChanged))); <<<<<<< Mask finalFrom = from; int affected = editSession.replaceBlocks(region, finalFrom, to); actor.print(affected + " block(s) have been replaced."); ======= int affected = editSession.replaceBlocks(region, from, to); actor.printInfo(TranslatableComponent.of("worldedit.replace.replaced", TextComponent.of(affected))); return affected; >>>>>>> int affected = editSession.replaceBlocks(region, from, to); actor.printInfo(TranslatableComponent.of("worldedit.replace.replaced", TextComponent.of(affected))); <<<<<<< actor.print(affected + " block(s) have been overlaid."); } @Command( name = "/lay", desc = "Set the top block in the region" ) @CommandPermissions("worldedit.region.overlay") @Logging(REGION) @Confirm(Confirm.Processor.REGION) public void lay(Player player, EditSession editSession, @Selection Region region, @Arg(name = "pattern", desc = "The pattern of blocks to lay") Pattern patternArg) throws WorldEditException { BlockVector3 max = region.getMaximumPoint(); int maxY = max.getBlockY(); Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion(); Iterator<BlockVector2> iter = flat.iterator(); int y = 0; int affected = 0; while (iter.hasNext()) { BlockVector2 pos = iter.next(); int x = pos.getBlockX(); int z = pos.getBlockZ(); y = editSession.getNearestSurfaceTerrainBlock(x, z, y, 0, maxY); editSession.setBlock(x, y, z, patternArg); affected++; } BBC.VISITOR_BLOCK.send(player, affected); ======= actor.printInfo(TranslatableComponent.of("worldedit.overlay.overlaid", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.overlay.overlaid", TextComponent.of(affected))); } @Command( name = "/lay", desc = "Set the top block in the region" ) @CommandPermissions("worldedit.region.overlay") @Logging(REGION) @Confirm(Confirm.Processor.REGION) public void lay(Player player, EditSession editSession, @Selection Region region, @Arg(name = "pattern", desc = "The pattern of blocks to lay") Pattern patternArg) throws WorldEditException { BlockVector3 max = region.getMaximumPoint(); int maxY = max.getBlockY(); Iterable<BlockVector2> flat = Regions.asFlatRegion(region).asFlatRegion(); Iterator<BlockVector2> iter = flat.iterator(); int y = 0; int affected = 0; while (iter.hasNext()) { BlockVector2 pos = iter.next(); int x = pos.getBlockX(); int z = pos.getBlockZ(); y = editSession.getNearestSurfaceTerrainBlock(x, z, y, 0, maxY); editSession.setBlock(x, y, z, patternArg); affected++; } BBC.VISITOR_BLOCK.send(player, affected); <<<<<<< actor.print(affected + " block(s) have been made to look more natural."); ======= actor.printInfo(TranslatableComponent.of("worldedit.naturalize.naturalized", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.naturalize.naturalized", TextComponent.of(affected))); <<<<<<< actor.print(affected + " block(s) have been changed."); ======= actor.printInfo(TranslatableComponent.of("worldedit.walls.changed", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.walls.changed", TextComponent.of(affected))); <<<<<<< actor.print(affected + " block(s) have been changed."); ======= actor.printInfo(TranslatableComponent.of("worldedit.faces.changed", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.faces.changed", TextComponent.of(affected))); <<<<<<< Mask mask, @Switch(name = 's', desc = "TODO") boolean snow) throws WorldEditException { BlockVector3 min = region.getMinimumPoint(); BlockVector3 max = region.getMaximumPoint(); long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1)); FaweLimit limit = actor.getLimit(); if (volume >= limit.MAX_CHECKS) { throw FaweCache.MAX_CHECKS; } try { HeightMap heightMap = new HeightMap(editSession, region, mask, snow); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); int affected = heightMap.applyFilter(filter, iterations); actor.print("Terrain's height map smoothed. " + affected + " block(s) changed."); } catch (Throwable e) { throw new RuntimeException(e); } } @Command( name = "/wea", aliases = {"wea", "worldeditanywhere", "/worldeditanywhere", "/weanywhere"}, desc = "Bypass region restrictions", descFooter = "Bypass region restrictions" ) @CommandPermissions("fawe.admin") public void wea(Actor actor) throws WorldEditException { if (actor.togglePermission("fawe.bypass")) { actor.print(BBC.WORLDEDIT_BYPASSED.s()); } else { actor.print(BBC.WORLDEDIT_RESTRICTED.s()); } ======= Mask mask) throws WorldEditException { HeightMap heightMap = new HeightMap(editSession, region, mask); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); int affected = heightMap.applyFilter(filter, iterations); actor.printInfo(TranslatableComponent.of("worldedit.smooth.changed", TextComponent.of(affected))); return affected; >>>>>>> Mask mask, @Switch(name = 's', desc = "TODO") boolean snow) throws WorldEditException { BlockVector3 min = region.getMinimumPoint(); BlockVector3 max = region.getMaximumPoint(); long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1)); FaweLimit limit = actor.getLimit(); if (volume >= limit.MAX_CHECKS) { throw FaweCache.MAX_CHECKS; } try { HeightMap heightMap = new HeightMap(editSession, region, mask, snow); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); int affected = heightMap.applyFilter(filter, iterations); actor.printInfo(TranslatableComponent.of("worldedit.smooth.changed", TextComponent.of(affected))); } catch (Throwable e) { throw new RuntimeException(e); } } @Command( name = "/wea", aliases = {"wea", "worldeditanywhere", "/worldeditanywhere", "/weanywhere"}, desc = "Bypass region restrictions", descFooter = "Bypass region restrictions" ) @CommandPermissions("fawe.admin") public void wea(Actor actor) throws WorldEditException { if (actor.togglePermission("fawe.bypass")) { actor.print(BBC.WORLDEDIT_BYPASSED.s()); } else { actor.print(BBC.WORLDEDIT_RESTRICTED.s()); } <<<<<<< BBC.VISITOR_BLOCK.send(actor, affected); } @Command( name = "/fall", desc = "Have the blocks in the selection fall", descFooter = "Make the blocks in the selection fall\n" + "The -m flag will only fall within the vertical selection." ) @CommandPermissions("worldedit.region.fall") @Logging(ORIENTATION_REGION) @Confirm(Confirm.Processor.REGION) public void fall(Player player, EditSession editSession, LocalSession session, @Selection Region region, @Arg(desc = "BlockStateHolder", def = "air") BlockStateHolder replace, @Switch(name = 'm', desc = "TODO") boolean notFullHeight) throws WorldEditException { int affected = editSession.fall(region, !notFullHeight, replace); BBC.VISITOR_BLOCK.send(player, affected); ======= actor.printInfo(TranslatableComponent.of("worldedit.move.moved", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.move.moved", TextComponent.of(affected))); return affected; } @Command( name = "/fall", desc = "Have the blocks in the selection fall", descFooter = "Make the blocks in the selection fall\n" + "The -m flag will only fall within the vertical selection." ) @CommandPermissions("worldedit.region.fall") @Logging(ORIENTATION_REGION) @Confirm(Confirm.Processor.REGION) public void fall(Player player, EditSession editSession, LocalSession session, @Selection Region region, @Arg(desc = "BlockStateHolder", def = "air") BlockStateHolder replace, @Switch(name = 'm', desc = "TODO") boolean notFullHeight) throws WorldEditException { int affected = editSession.fall(region, !notFullHeight, replace); BBC.VISITOR_BLOCK.send(player, affected); <<<<<<< BBC.VISITOR_BLOCK.send(actor, affected); ======= actor.printInfo(TranslatableComponent.of("worldedit.stack.changed", TextComponent.of(affected))); return affected; } @Command( name = "/regen", desc = "Regenerates the contents of the selection", descFooter = "This command might affect things outside the selection,\n" + "if they are within the same chunk." ) @CommandPermissions("worldedit.regen") @Logging(REGION) public void regenerateChunk(Actor actor, World world, LocalSession session, EditSession editSession, @Selection Region region) throws WorldEditException { Mask mask = session.getMask(); try { session.setMask(null); world.regenerate(region, editSession); } finally { session.setMask(mask); } actor.printInfo(TranslatableComponent.of("worldedit.regen.regenerated")); >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.stack.changed", TextComponent.of(affected))); return affected; <<<<<<< actor.print(affected + " block(s) have been deformed."); ======= actor.printInfo(TranslatableComponent.of("worldedit.deform.deformed", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.deform.deformed", TextComponent.of(affected))); <<<<<<< Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask; int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask); actor.print(affected + " block(s) have been changed."); ======= int affected = editSession.hollowOutRegion(region, thickness, pattern); actor.printInfo(TranslatableComponent.of("worldedit.hollow.changed", TextComponent.of(affected))); return affected; >>>>>>> Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask; int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask); actor.printInfo(TranslatableComponent.of("worldedit.hollow.changed", TextComponent.of(affected))); <<<<<<< actor.print(affected + " flora created."); ======= actor.printInfo(TranslatableComponent.of("worldedit.flora.created", TextComponent.of(affected))); return affected; >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.flora.created", TextComponent.of(affected)));
<<<<<<< @CommandPermissions("worldedit.tool.info") public void info(Player player, LocalSession session, CommandContext args) throws WorldEditException { session.setTool(new QueryTool(), player); BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); BBC.TOOL_INFO.send(player, itemStack.getType().getName()); ======= public void none(Player player, LocalSession session) throws WorldEditException { session.setTool(player.getItemInHand(HandSide.MAIN_HAND).getType(), null); player.print("Tool unbound from your current item."); >>>>>>> @CommandPermissions("worldedit.tool.info") public void info(Player player, LocalSession session) throws WorldEditException { session.setTool(new QueryTool(), player); BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); BBC.TOOL_INFO.send(player, itemStack.getType().getName()); <<<<<<< @CommandPermissions("worldedit.tool.inspect") public void inspectBrush(Player player, LocalSession session, @Optional("1") double radius) throws WorldEditException { session.setTool(new InspectBrush(), player); BBC.TOOL_INSPECT.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); ======= @CommandPermissions("worldedit.tool.info") public void info(Player player, LocalSession session) throws WorldEditException { BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), new QueryTool()); player.print("Info tool bound to " + itemStack.getType().getName() + "."); >>>>>>> @CommandPermissions("worldedit.tool.inspect") public void inspectBrush(Player player, LocalSession session, @Optional("1") double radius) throws WorldEditException { session.setTool(new InspectBrush(), player); BBC.TOOL_INSPECT.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); <<<<<<< @SuppressWarnings("deprecation") public void tree(Player player, LocalSession session, @Optional("tree") TreeGenerator.TreeType type, CommandContext args) throws WorldEditException { session.setTool(new TreePlanter(type), player); BBC.TOOL_TREE.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); ======= public void tree(Player player, LocalSession session, CommandContext args) throws WorldEditException { TreeGenerator.TreeType type = args.argsLength() > 0 ? TreeGenerator.lookup(args.getString(0)) : TreeGenerator.TreeType.TREE; if (type == null) { player.printError("Tree type '" + args.getString(0) + "' is unknown."); return; } BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), new TreePlanter(type)); player.print("Tree tool bound to " + itemStack.getType().getName() + "."); >>>>>>> @SuppressWarnings("deprecation") public void tree(Player player, LocalSession session, @Optional("tree") TreeGenerator.TreeType type, CommandContext args) throws WorldEditException { session.setTool(new TreePlanter(type), player); BBC.TOOL_TREE.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); <<<<<<< public void cycler(Player player, LocalSession session, CommandContext args) throws WorldEditException { ======= public void cycler(Player player, LocalSession session) throws WorldEditException { >>>>>>> public void cycler(Player player, LocalSession session) throws WorldEditException { <<<<<<< public void deltree(Player player, LocalSession session, CommandContext args) throws WorldEditException { session.setTool(new FloatingTreeRemover(), player); BBC.TOOL_DELTREE.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); ======= public void deltree(Player player, LocalSession session) throws WorldEditException { BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), new FloatingTreeRemover()); player.print("Floating tree remover tool bound to " + itemStack.getType().getName() + "."); >>>>>>> public void deltree(Player player, LocalSession session, CommandContext args) throws WorldEditException { session.setTool(new FloatingTreeRemover(), player); BBC.TOOL_DELTREE.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); <<<<<<< public void farwand(Player player, LocalSession session, CommandContext args) throws WorldEditException { session.setTool(new DistanceWand(), player); BBC.TOOL_FARWAND.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); ======= public void farwand(Player player, LocalSession session) throws WorldEditException { BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), new DistanceWand()); player.print("Far wand tool bound to " + itemStack.getType().getName() + "."); >>>>>>> public void farwand(Player player, LocalSession session, CommandContext args) throws WorldEditException { session.setTool(new DistanceWand(), player); BBC.TOOL_FARWAND.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); <<<<<<< session.setTool(new LongRangeBuildTool(primary, secondary), player); BBC.TOOL_LRBUILD_BOUND.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); BBC.TOOL_LRBUILD_INFO.send(player, secondary, primary); ======= BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), new LongRangeBuildTool(primary, secondary)); player.print("Long-range building tool bound to " + itemStack.getType().getName() + "."); String primaryName = "pattern"; String secondaryName = "pattern"; if (primary instanceof BlockPattern) { primaryName = ((BlockPattern) primary).getBlock().getBlockType().getName(); } if (secondary instanceof BlockPattern) { secondaryName = ((BlockPattern) secondary).getBlock().getBlockType().getName(); } player.print("Left-click set to " + primaryName + "; right-click set to " + secondaryName + "."); >>>>>>> session.setTool(new LongRangeBuildTool(primary, secondary), player); BBC.TOOL_LRBUILD_BOUND.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName()); BBC.TOOL_LRBUILD_INFO.send(player, secondary, primary);
<<<<<<< import java.util.concurrent.Callable; ======= import java.util.concurrent.ConcurrentHashMap; >>>>>>> import java.util.concurrent.ConcurrentHashMap; <<<<<<< public static int EXPIRATION_GRACE = 0; private static final int FLUSH_PERIOD = 1000 * 60; ======= public static int EXPIRATION_GRACE = 600000; >>>>>>> public static int EXPIRATION_GRACE = 0; private static final int FLUSH_PERIOD = 1000 * 60; <<<<<<< ======= } catch (IOException e) { log.warn("Failed to write session for UUID " + getKey(key), e); >>>>>>>
<<<<<<< import com.sk89q.jnbt.StringTag; ======= import com.sk89q.jnbt.NamedTag; import com.sk89q.jnbt.ShortTag; import com.sk89q.jnbt.StringTag; >>>>>>> import com.sk89q.jnbt.StringTag; <<<<<<< import com.sk89q.worldedit.entity.BaseEntity; ======= import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.BaseEntity; >>>>>>> import com.sk89q.worldedit.entity.BaseEntity; <<<<<<< ======= import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; >>>>>>> <<<<<<< import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.DataFixer; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; ======= import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.DataFixer; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; >>>>>>> import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.DataFixer; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; <<<<<<< import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; ======= import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.storage.NBTConversions; >>>>>>> import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Capability; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; <<<<<<< import java.util.Map.Entry; import java.util.UUID; import java.util.function.Function; ======= import java.util.Map.Entry; import java.util.OptionalInt; import java.util.stream.Collectors; >>>>>>> import java.util.Map.Entry; import java.util.UUID; import java.util.function.Function; <<<<<<< private DataFixer fixer = null; private int dataVersion = -1; private FastByteArrayOutputStream blocksOut; private FaweOutputStream blocks; private FastByteArrayOutputStream biomesOut; private FaweOutputStream biomes; private List<Map<String, Object>> tiles; private List<Map<String, Object>> entities; private int width, height, length; private int offsetX, offsetY, offsetZ; private char[] palette, biomePalette; private BlockVector3 min = BlockVector3.ZERO; ======= private DataFixer fixer = null; private int schematicVersion = -1; private int dataVersion = -1; >>>>>>> private DataFixer fixer = null; private int dataVersion = -1; private FastByteArrayOutputStream blocksOut; private FaweOutputStream blocks; private FastByteArrayOutputStream biomesOut; private FaweOutputStream biomes; private List<Map<String, Object>> tiles; private List<Map<String, Object>> entities; private int width, height, length; private int offsetX, offsetY, offsetZ; private char[] palette, biomePalette; private BlockVector3 min = BlockVector3.ZERO; private int schematicVersion = -1; <<<<<<< @Override public Clipboard read(UUID uuid, Function<BlockVector3, Clipboard> createOutput) throws IOException { StreamDelegate root = createDelegate(); inputStream.readNamedTagLazy(root); if (blocks != null) blocks.close(); if (biomes != null) biomes.close(); blocks = null; biomes = null; ======= for (String palettePart : paletteObject.keySet()) { int id = requireTag(paletteObject, palettePart, IntTag.class).getValue(); if (fixer != null) { palettePart = fixer.fixUp(DataFixer.FixTypes.BLOCK_STATE, palettePart, dataVersion); } BlockState state; try { state = WorldEdit.getInstance().getBlockFactory().parseFromInput(palettePart, parserContext).toImmutableState(); } catch (InputParseException e) { log.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air."); state = BlockTypes.AIR.getDefaultState(); } palette.put(id, state); } >>>>>>> @Override public Clipboard read() throws IOException { CompoundTag schematicTag = getBaseTag(); Map<String, Tag> schematic = schematicTag.getValue(); final Platform platform = WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.WORLD_EDITING); int liveDataVersion = platform.getDataVersion(); if (schematicVersion == 1) { dataVersion = 1631; // this is a relatively safe assumption unless someone imports a schematic from 1.12, e.g. sponge 7.1- fixer = platform.getDataFixer(); return readVersion1(schematicTag); } else if (schematicVersion == 2) { dataVersion = requireTag(schematic, "DataVersion", IntTag.class).getValue(); if (dataVersion > liveDataVersion) { log.warn("Schematic was made in a newer Minecraft version ({} > {}). Data may be incompatible.", dataVersion, liveDataVersion); } else if (dataVersion < liveDataVersion) { fixer = platform.getDataFixer(); if (fixer != null) { log.debug("Schematic was made in an older Minecraft version ({} < {}), will attempt DFU.", dataVersion, liveDataVersion); } else { log.info("Schematic was made in an older Minecraft version ({} < {}), but DFU is not available. Data may be incompatible.", dataVersion, liveDataVersion); } } BlockArrayClipboard clip = readVersion1(schematicTag); return readVersion2(clip, schematicTag); } throw new IOException("This schematic version is currently not supported"); } @Override public OptionalInt getDataVersion() { try { CompoundTag schematicTag = getBaseTag(); Map<String, Tag> schematic = schematicTag.getValue(); if (schematicVersion == 1) { return OptionalInt.of(1631); } else if (schematicVersion == 2) { return OptionalInt.of(requireTag(schematic, "DataVersion", IntTag.class).getValue()); } return OptionalInt.empty(); } catch (IOException e) { return OptionalInt.empty(); } } @Override public Clipboard getBaseTag(UUID uuid, Function<BlockVector3, Clipboard> createOutput) throws IOException { StreamDelegate root = createDelegate(); inputStream.readNamedTagLazy(root); if (blocks != null) blocks.close(); if (biomes != null) biomes.close(); blocks = null; biomes = null; <<<<<<< int[] pos = tile.getIntArray("Pos"); int x,y,z; if (pos.length != 3) { if (!tile.containsKey("x") || !tile.containsKey("y") || !tile.containsKey("z")) { return null; } x = tile.getInt("x"); y = tile.getInt("y"); z = tile.getInt("z"); } else { x = pos[0]; y = pos[1]; z = pos[2]; ======= BlockArrayClipboard clipboard = new BlockArrayClipboard(region); clipboard.setOrigin(origin); int index = 0; int i = 0; int value; int varintLength; while (i < blocks.length) { value = 0; varintLength = 0; while (true) { value |= (blocks[i] & 127) << (varintLength++ * 7); if (varintLength > 5) { throw new IOException("VarInt too big (probably corrupted data)"); >>>>>>> int[] pos = tile.getIntArray("Pos"); int x,y,z; if (pos.length != 3) { if (!tile.containsKey("x") || !tile.containsKey("y") || !tile.containsKey("z")) { return null; } x = tile.getInt("x"); y = tile.getInt("y"); z = tile.getInt("z"); } else { x = pos[0]; y = pos[1]; z = pos[2]; <<<<<<< } // entities if (entities != null && !entities.isEmpty()) { for (Map<String, Object> entRaw : entities) { CompoundTag ent = FaweCache.IMP.asTag(entRaw); Map<String, Tag> value = ent.getValue(); StringTag id = (StringTag) value.get("Id"); if (id == null) { id = (StringTag) value.get("id"); if (id == null) { return null; } } value.put("id", id); value.remove("Id"); EntityType type = EntityTypes.parse(id.getValue()); if (type != null) { ent = fixEntity(ent); BaseEntity state = new BaseEntity(type, ent); Location loc = ent.getEntityLocation(clipboard); clipboard.createEntity(loc, state); ======= // index = (y * length * width) + (z * width) + x int y = index / (width * length); int z = (index % (width * length)) / width; int x = (index % (width * length)) % width; BlockState state = palette.get(value); BlockVector3 pt = BlockVector3.at(x, y, z); try { if (tileEntitiesMap.containsKey(pt)) { clipboard.setBlock(clipboard.getMinimumPoint().add(pt), state.toBaseBlock(new CompoundTag(tileEntitiesMap.get(pt)))); >>>>>>> } // entities if (entities != null && !entities.isEmpty()) { for (Map<String, Object> entRaw : entities) { CompoundTag ent = FaweCache.IMP.asTag(entRaw); Map<String, Tag> value = ent.getValue(); StringTag id = (StringTag) value.get("Id"); if (id == null) { id = (StringTag) value.get("id"); if (id == null) { return null; } } value.put("id", id); value.remove("Id"); EntityType type = EntityTypes.parse(id.getValue()); if (type != null) { ent = fixEntity(ent); BaseEntity state = new BaseEntity(type, ent); Location loc = ent.getEntityLocation(clipboard); clipboard.createEntity(loc, state);
<<<<<<< import com.boydti.fawe.config.BBC; ======= import com.google.common.collect.Lists; >>>>>>> import com.google.common.collect.Lists; import com.boydti.fawe.config.BBC; <<<<<<< import java.util.List; ======= import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; >>>>>>> import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; <<<<<<< public void addStatusMessages(List<String> messages) { messages.add(BBC.VISITOR_BLOCK.format(getAffected())); ======= public Iterable<Component> getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( "worldedit.operation.affected.block", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE)); >>>>>>> public Iterable<Component> getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( "worldedit.operation.affected.block", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE));
<<<<<<< import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; ======= >>>>>>> import static org.junit.jupiter.api.Assertions.assertEquals; <<<<<<< import org.junit.jupiter.api.Test; ======= import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; >>>>>>> import org.junit.jupiter.api.Test; import static org.mockito.Mockito.mock;
<<<<<<< import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.math.MutableBlockVector2; ======= import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; >>>>>>> import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.math.MutableBlockVector2; <<<<<<< private boolean useOldIterator; private int minX, minY, minZ, maxX, maxY, maxZ; private BlockVector3 pos1; private BlockVector3 pos2; ======= private BlockVector3 pos1; private BlockVector3 pos2; >>>>>>> private boolean useOldIterator; private int minX, minY, minZ, maxX, maxY, maxZ; private BlockVector3 pos1; private BlockVector3 pos2; <<<<<<< public Set<BlockVector2> getChunks() { BlockVector3 min = getMinimumPoint(); BlockVector3 max = getMaximumPoint(); final int maxX = max.getBlockX() >> ChunkStore.CHUNK_SHIFTS; final int minX = min.getBlockX() >> ChunkStore.CHUNK_SHIFTS; final int maxZ = max.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; final int minZ = min.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; final int size = (maxX - minX + 1) * (maxZ - minZ + 1); return new AbstractSet<BlockVector2>() { @Override public Iterator<BlockVector2> iterator() { return new Iterator<BlockVector2>() { private MutableBlockVector2 pos = new MutableBlockVector2().setComponents(maxX + 1, maxZ); ======= public void shift(BlockVector3 change) throws RegionOperationException { pos1 = pos1.add(change); pos2 = pos2.add(change); >>>>>>> public Set<BlockVector2> getChunks() { BlockVector3 min = getMinimumPoint(); BlockVector3 max = getMaximumPoint(); final int maxX = max.getBlockX() >> ChunkStore.CHUNK_SHIFTS; final int minX = min.getBlockX() >> ChunkStore.CHUNK_SHIFTS; final int maxZ = max.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; final int minZ = min.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; final int size = (maxX - minX + 1) * (maxZ - minZ + 1); return new AbstractSet<BlockVector2>() { @Override public Iterator<BlockVector2> iterator() { return new Iterator<BlockVector2>() { private MutableBlockVector2 pos = new MutableBlockVector2().setComponents(maxX + 1, maxZ); <<<<<<< //<<<<<<< HEAD public BlockVector3 next() { mutable.mutX(nextX); mutable.mutY(nextY); mutable.mutZ(nextZ); //======= // public BlockVector2 next() { // if (!hasNext()) throw new NoSuchElementException(); // BlockVector2 answer = BlockVector2.at(nextX, nextZ); //>>>>>>> 2c8b2fe0... Move vectors to static creators, for caching ======= public BlockVector2 next() { if (!hasNext()) throw new NoSuchElementException(); BlockVector2 answer = BlockVector2.at(nextX, nextZ); >>>>>>> public BlockVector3 next() { mutable.mutX(nextX); mutable.mutY(nextY); mutable.mutZ(nextZ); <<<<<<< }; } @Override public Iterable<BlockVector2> asFlatRegion() { return new Iterable<BlockVector2>() { @Override public Iterator<BlockVector2> iterator() { MutableBlockVector2 mutable = new MutableBlockVector2(); return new Iterator<BlockVector2>() { private BlockVector3 min = getMinimumPoint(); private BlockVector3 max = getMaximumPoint(); private int nextX = min.getBlockX(); private int nextZ = min.getBlockZ(); @Override public boolean hasNext() { return (nextZ != Integer.MAX_VALUE); } @Override public BlockVector2 next() { if (!hasNext()) throw new java.util.NoSuchElementException(); // BlockVector2 answer = mutable.setComponents(nextX, nextZ); BlockVector2 answer = BlockVector2.at(nextX, nextZ); if (++nextX > max.getBlockX()) { nextX = min.getBlockX(); if (++nextZ > max.getBlockZ()) { if (nextZ == Integer.MIN_VALUE) { throw new NoSuchElementException("End of iterator") { @Override public Throwable fillInStackTrace() { return this; } }; } nextZ = Integer.MAX_VALUE; nextX = Integer.MAX_VALUE; } } return answer; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } ======= >>>>>>> }; } @Override public Iterable<BlockVector2> asFlatRegion() { return new Iterable<BlockVector2>() { @Override public Iterator<BlockVector2> iterator() { MutableBlockVector2 mutable = new MutableBlockVector2(); return new Iterator<BlockVector2>() { private BlockVector3 min = getMinimumPoint(); private BlockVector3 max = getMaximumPoint(); private int nextX = min.getBlockX(); private int nextZ = min.getBlockZ(); @Override public boolean hasNext() { return (nextZ != Integer.MAX_VALUE); } @Override public BlockVector2 next() { if (!hasNext()) throw new java.util.NoSuchElementException(); // BlockVector2 answer = mutable.setComponents(nextX, nextZ); BlockVector2 answer = BlockVector2.at(nextX, nextZ); if (++nextX > max.getBlockX()) { nextX = min.getBlockX(); if (++nextZ > max.getBlockZ()) { if (nextZ == Integer.MIN_VALUE) { throw new NoSuchElementException("End of iterator") { @Override public Throwable fillInStackTrace() { return this; } }; } nextZ = Integer.MAX_VALUE; nextX = Integer.MAX_VALUE; } } return answer; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
<<<<<<< try { boolean successful = false; for (int i = 0; i < 10; i++) { if (treeType.generate(editSession, clicked.add(0, 1, 0).toBlockPoint())) { successful = true; break; } ======= for (int i = 0; i < 10; i++) { if (treeType.generate(editSession, clicked.toVector().add(0, 1, 0).toBlockPoint())) { successful = true; break; } >>>>>>> for (int i = 0; i < 10; i++) { if (treeType.generate(editSession, clicked.add(0, 1, 0).toBlockPoint())) { successful = true; break; <<<<<<< if (!successful) { player.printError("A tree can't go there."); } } catch (MaxChangedBlocksException e) { player.printError("Max. blocks changed reached."); } finally { session.remember(editSession); ======= if (!successful) { player.printError("A tree can't go there."); } } catch (MaxChangedBlocksException e) { player.printError("Max. blocks changed reached."); } finally { session.remember(editSession); } >>>>>>> } if (!successful) { player.printError("A tree can't go there."); } } catch (MaxChangedBlocksException e) { player.printError("Max. blocks changed reached."); } finally { session.remember(editSession);
<<<<<<< import java.util.UUID; ======= import org.bukkit.Bukkit; >>>>>>> import java.util.UUID; import org.bukkit.Bukkit; <<<<<<< import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; ======= import java.util.Locale; import java.util.UUID; import javax.annotation.Nullable; >>>>>>> import java.util.Locale; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
<<<<<<< @Override public void sendTitle(String title, String sub) { basePlayer.sendTitle(title, sub); } public Player getBasePlayer() { return basePlayer; } ======= @Override public void floatAt(int x, int y, int z, boolean alwaysGlass) { basePlayer.floatAt(x, y, z, alwaysGlass); } >>>>>>> @Override public void sendTitle(String title, String sub) { basePlayer.sendTitle(title, sub); } public Player getBasePlayer() { return basePlayer; } @Override public void floatAt(int x, int y, int z, boolean alwaysGlass) { basePlayer.floatAt(x, y, z, alwaysGlass); }
<<<<<<< import com.sk89q.worldedit.util.command.*; import com.sk89q.worldedit.util.command.binding.Range; ======= import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.util.command.CommandCallable; import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; >>>>>>> import com.sk89q.worldedit.util.command.binding.Range; import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.util.command.CommandCallable; import com.sk89q.worldedit.util.command.CommandMapping; import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.util.command.PrimaryAliasComparator; <<<<<<< @Command( aliases = {"/fill"}, usage = "<pattern> <radius> [depth] [direction]", desc = "Fill a hole", min = 2, max = 4 ) @CommandPermissions("worldedit.fill") @Logging(PLACEMENT) public void fill(Player player, LocalSession session, EditSession editSession, Pattern pattern, double radius, @Optional("1") double depth, @Optional("down") @Direction BlockVector3 direction) throws WorldEditException { worldEdit.checkMaxRadius(radius); BlockVector3 pos = session.getPlacementPosition(player); int affected; affected = editSession.fillDirection(pos, pattern, radius, (int) depth, direction); player.print(BBC.getPrefix() + affected + " block(s) have been created."); ======= BlockVector3 pos = session.getPlacementPosition(player); int affected = editSession.fillXZ(pos, pattern, radius, depth, false); player.print(affected + " block(s) have been created."); >>>>>>> @Command( aliases = {"/fill"}, usage = "<pattern> <radius> [depth] [direction]", desc = "Fill a hole", min = 2, max = 4 ) @CommandPermissions("worldedit.fill") @Logging(PLACEMENT) public void fill(Player player, LocalSession session, EditSession editSession, Pattern pattern, double radius, @Optional("1") double depth, @Optional("down") @Direction BlockVector3 direction) throws WorldEditException { worldEdit.checkMaxRadius(radius); BlockVector3 pos = session.getPlacementPosition(player); int affected; affected = editSession.fillDirection(pos, pattern, radius, (int) depth, direction); player.print(BBC.getPrefix() + affected + " block(s) have been created."); <<<<<<< public void drain(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException { worldEdit.checkMaxRadius(radius); ======= public void drain(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { double radius = Math.max(0, args.getDouble(0)); boolean waterlogged = args.hasFlag('w'); we.checkMaxRadius(radius); >>>>>>> public void drain(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException { worldEdit.checkMaxRadius(radius); <<<<<<< session.getPlacementPosition(player), radius); player.print(BBC.getPrefix() + affected + " block(s) have been changed."); ======= session.getPlacementPosition(player), radius, waterlogged); player.print(affected + " block(s) have been changed."); >>>>>>> session.getPlacementPosition(player), radius); player.print(BBC.getPrefix() + affected + " block(s) have been changed."); <<<<<<< public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException { worldEdit.checkMaxRadius(size); size = Math.max(1, size); int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size); player.print(BBC.getPrefix() + affected + " block(s) have been removed."); ======= public void removeNear(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException { ParserContext context = new ParserContext(); context.setActor(player); context.setWorld(player.getWorld()); context.setSession(session); context.setRestricted(false); context.setPreferringWildcard(false); BaseBlock block = we.getBlockFactory().parseFromInput(args.getString(0), context); int size = Math.max(1, args.getInteger(1, 50)); we.checkMaxRadius(size); int affected = editSession.removeNear(session.getPlacementPosition(player), block.getBlockType(), size); player.print(affected + " block(s) have been removed."); >>>>>>> public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException { worldEdit.checkMaxRadius(size); size = Math.max(1, size); int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size); player.print(BBC.getPrefix() + affected + " block(s) have been removed."); <<<<<<< aliases = {"/green", "green"}, usage = "[radius]", desc = "Greens the area", flags = "f", min = 0, max = 1 ======= aliases = { "/green", "green" }, usage = "[radius]", desc = "Greens the area", help = "Converts dirt to grass blocks. -f also converts coarse dirt.", flags = "f", min = 0, max = 1 >>>>>>> aliases = {"/green", "green"}, usage = "[radius]", desc = "Greens the area", help = "Converts dirt to grass blocks. -f also converts coarse dirt.", flags = "f", min = 0, max = 1 <<<<<<< session = worldEdit.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); ======= session = we.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); >>>>>>> session = worldEdit.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); editSession = session.createEditSession(player); List<? extends Entity> entities; if (radius >= 0) { CylinderRegion region = CylinderRegion.createRadius(editSession, center, radius); } else { } else { Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING); for (World world : platform.getWorlds()) { List<? extends Entity> entities = world.getEntities(); visitors.add(new EntityVisitor(entities.iterator(), flags.createFunction())); } } int killed = 0; for (EntityVisitor visitor : visitors) { Operations.completeLegacy(visitor); killed += visitor.getAffected(); } BBC.KILL_SUCCESS.send(actor, killed, radius); if (editSession != null) { session.remember(editSession); editSession.flushSession(); } } @Command( aliases = {"remove", "rem", "rement"}, usage = "<type> <radius>", desc = "Remove all entities of a type", min = 2, max = 2 ) @CommandPermissions("worldedit.remove") @Logging(PLACEMENT) public void remove(Actor actor, CommandContext args) throws WorldEditException, CommandException { String typeStr = args.getString(0); int radius = args.getInteger(1); Player player = actor instanceof Player ? (Player) actor : null; if (radius < -1) { actor.printError("Use -1 to remove all entities in loaded chunks"); return; } EntityRemover remover = new EntityRemover(); remover.fromString(typeStr); List<EntityVisitor> visitors = new ArrayList<>(); LocalSession session = null; EditSession editSession = null; if (player != null) { session = worldEdit.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); <<<<<<< session = worldEdit.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); ======= session = we.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); >>>>>>> session = worldEdit.getSessionManager().get(player); BlockVector3 center = session.getPlacementPosition(player); <<<<<<< FaweLimit limit = FawePlayer.wrap(actor).getLimit(); final Expression expression = Expression.compile(input); ExecutorService executor = Executors.newSingleThreadExecutor(); Future<Double> futureResult = executor.submit((Callable<Double>) expression::evaluate); Double result = Double.NaN; try { result = futureResult.get(limit.MAX_EXPRESSION_MS, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } catch (TimeoutException e) { futureResult.cancel(true); e.printStackTrace(); } executor.shutdownNow(); actor.print(BBC.getPrefix() + "= " + result); ======= Expression expression = Expression.compile(input); if (actor instanceof SessionOwner) { actor.print("= " + expression.evaluate( new double[]{}, WorldEdit.getInstance().getSessionManager().get((SessionOwner) actor).getTimeout())); } else { actor.print("= " + expression.evaluate()); } >>>>>>> FaweLimit limit = FawePlayer.wrap(actor).getLimit(); final Expression expression = Expression.compile(input); ExecutorService executor = Executors.newSingleThreadExecutor(); Future<Double> futureResult = executor.submit((Callable<Double>) expression::evaluate); Double result = Double.NaN; try { result = futureResult.get(limit.MAX_EXPRESSION_MS, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } catch (TimeoutException e) { futureResult.cancel(true); e.printStackTrace(); } executor.shutdownNow(); actor.print(BBC.getPrefix() + "= " + result);
<<<<<<< ======= import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; >>>>>>> <<<<<<< player.printError(BBC.NO_BLOCK.s()); ======= player.printError(TranslatableComponent.of("worldedit.raytrace.noblock")); >>>>>>> player.printError(TranslatableComponent.of("worldedit.raytrace.noblock")); <<<<<<< BBC.BIOME_LIST_HEADER.send(player, 1, 1); player.print(biomes.size() != 1 ? "Biomes " + qualifier + ":" : "Biome " + qualifier + ":"); for (BiomeType biome : biomes) { ======= List<Component> components = biomes.stream().map(biome -> { >>>>>>> List<Component> components = biomes.stream().map(biome -> { <<<<<<< BBC.BIOME_CHANGED.send(player, visitor.getAffected()); if (!player.hasPermission("fawe.tips")) { BBC.TIP_BIOME_PATTERN.or(BBC.TIP_BIOME_MASK).send(player); } ======= player.printInfo(TranslatableComponent.of( "worldedit.setbiome.changed", TextComponent.of(visitor.getAffected()) )); >>>>>>> player.printInfo(TranslatableComponent.of( "worldedit.setbiome.changed", TextComponent.of(visitor.getAffected()) )); if (!player.hasPermission("fawe.tips")) { BBC.TIP_BIOME_PATTERN.or(BBC.TIP_BIOME_MASK).send(player); }
<<<<<<< import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; ======= import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Vector2D; >>>>>>> import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector2;
<<<<<<< public static BiomeType register(final BiomeType biome) { return BiomeType.REGISTRY.register(biome.getId(), biome); ======= public static BiomeType getLegacy(int legacyId) { for (BiomeType type : values()) { if (type.getLegacyId() == legacyId) { return type; } } return null; } public static BiomeType get(int internalId) { return BiomeType.REGISTRY.getByInternalId(internalId); >>>>>>> public static BiomeType register(final BiomeType biome) { return BiomeType.REGISTRY.register(biome.getId(), biome); } public static BiomeType getLegacy(int legacyId) { for (BiomeType type : values()) { if (type.getLegacyId() == legacyId) { return type; } } return null; } public static BiomeType get(int internalId) { return BiomeType.REGISTRY.getByInternalId(internalId);
<<<<<<< public void wait(AtomicBoolean running, int timout) { ======= /** * Quickly run a task on the main thread, and wait for execution to finish:<br> * - Useful if you need to access something from the Bukkit API from another thread<br> * - Usualy wait time is around 25ms<br> * * @param function * @param <T> * @return */ public <T> T sync(final RunnableVal<T> function) { return sync(function, Integer.MAX_VALUE); } public <T> T sync(final Supplier<T> function) { return sync(function, Integer.MAX_VALUE); } public void wait(AtomicBoolean running, int timeout) { >>>>>>> public void wait(AtomicBoolean running, int timeout) {
<<<<<<< ======= >>>>>>> <<<<<<< public void waterId(Player player, BlockStateHolder block) throws WorldEditException { CFISettings settings = assertSettings(player); settings.getGenerator().setWaterId(block.getBlockType().getInternalId()); ======= public void waterId(Player fp, BlockStateHolder block) throws WorldEditException { CFISettings settings = assertSettings(fp); settings.getGenerator().setWater(block.toImmutableState()); >>>>>>> public void waterId(Player player, BlockStateHolder block) throws WorldEditException { CFISettings settings = assertSettings(player); settings.getGenerator().setWater(block.toImmutableState()); <<<<<<< public void baseId(Player player, BlockStateHolder block) throws WorldEditException { CFISettings settings = assertSettings(player); settings.getGenerator().setBedrockId(block.getBlockType().getInternalId()); player.print(TextComponent.of("Set base id!")); ======= public void baseId(Player fp, BlockStateHolder block) throws WorldEditException { CFISettings settings = assertSettings(fp); settings.getGenerator().setBedrock(block.toImmutableState()); fp.print(TextComponent.of("Set base id!")); >>>>>>> public void baseId(Player player, BlockStateHolder block) throws WorldEditException { CFISettings settings = assertSettings(player); settings.getGenerator().setBedrock(block.toImmutableState()); player.print(TextComponent.of("Set base id!"));
<<<<<<< ======= import java.util.LinkedHashSet; import java.util.Set; >>>>>>>
<<<<<<< import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Masks; ======= >>>>>>> <<<<<<< import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockStateHolder; ======= import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.ArrayList; import java.util.Collections; import java.util.List; >>>>>>> import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.ArrayList; import java.util.Collections; import java.util.List; <<<<<<< public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double sizeDouble) throws MaxChangedBlocksException { Mask mask = editSession.getMask(); if (mask == Masks.alwaysTrue() || mask == Masks.alwaysTrue2D()) { mask = null; } int size = (int) sizeDouble; int endY = position.getBlockY() + size; int startPerformY = Math.max(0, position.getBlockY() - size); int startCheckY = fullHeight ? 0 : startPerformY; for (int x = position.getBlockX() + size; x > position.getBlockX() - size; --x) { for (int z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) { int freeSpot = startCheckY; for (int y = startCheckY; y <= endY; y++) { BlockStateHolder block = editSession.getLazyBlock(x, y, z); ======= public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException { final double startY = fullHeight ? editSession.getWorld().getMaxY() : position.getBlockY() + size; for (double x = position.getBlockX() + size; x > position.getBlockX() - size; --x) { for (double z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) { double y = startY; final List<BlockState> blockTypes = new ArrayList<>(); for (; y > position.getBlockY() - size; --y) { final BlockVector3 pt = BlockVector3.at(x, y, z); final BlockState block = editSession.getBlock(pt); >>>>>>> public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double sizeDouble) throws MaxChangedBlocksException { Mask mask = editSession.getMask(); if (mask == Masks.alwaysTrue() || mask == Masks.alwaysTrue2D()) { mask = null; } int size = (int) sizeDouble; int endY = position.getBlockY() + size; int startPerformY = Math.max(0, position.getBlockY() - size); int startCheckY = fullHeight ? 0 : startPerformY; for (int x = position.getBlockX() + size; x > position.getBlockX() - size; --x) { for (int z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) { int freeSpot = startCheckY; for (int y = startCheckY; y <= endY; y++) { BlockStateHolder block = editSession.getLazyBlock(x, y, z); <<<<<<< ======= BlockVector3 pt = BlockVector3.at(x, y, z); Collections.reverse(blockTypes); for (int i = 0; i < blockTypes.size();) { if (editSession.getBlock(pt).getBlockType().getMaterial().isAir()) { editSession.setBlock(pt, blockTypes.get(i++)); } pt = pt.add(0, 1, 0); } >>>>>>>
<<<<<<< import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.request.Request; ======= >>>>>>> import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; <<<<<<< private VisualMode visualMode = VisualMode.NONE; private TargetMode targetMode = TargetMode.TARGET_BLOCK_RANGE; private Mask traceMask = null; private int targetOffset; private transient BrushSettings primary = new BrushSettings(); private transient BrushSettings secondary = new BrushSettings(); private transient BrushSettings context = primary; private transient PersistentChunkSendProcessor visualExtent; private transient Lock lock = new ReentrantLock(); private transient BaseItem holder; ======= private Mask mask = null; private Mask traceMask = null; private Brush brush = new SphereBrush(); @Nullable private Pattern material; private double size = 1; private String permission; >>>>>>> private VisualMode visualMode = VisualMode.NONE; private TargetMode targetMode = TargetMode.TARGET_BLOCK_RANGE; private Mask traceMask = null; private int targetOffset; private transient BrushSettings primary = new BrushSettings(); private transient BrushSettings secondary = new BrushSettings(); private transient BrushSettings context = primary; private transient PersistentChunkSendProcessor visualExtent; private transient Lock lock = new ReentrantLock(); private transient BaseItem holder; <<<<<<< return act(BrushAction.PRIMARY, player, session); } ======= Location target = player.getBlockTrace(getRange(), true, traceMask); >>>>>>> return act(BrushAction.PRIMARY, player, session); }
<<<<<<< import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.noise.NoiseGenerator; ======= >>>>>>>
<<<<<<< BBC.COMMAND_CUT_SLOW.send(actor, region.getArea()); if (!actor.hasPermission("fawe.tips")) { BBC.TIP_LAZYCUT.send(actor); } } @Command( name = "download", desc = "Downloads your clipboard through the configured web interface" ) @Deprecated @CommandPermissions({"worldedit.clipboard.download"}) public void download(final Player player, final LocalSession session, @Arg(name = "format", desc = "String", def = "schem") final String formatName) throws WorldEditException { final ClipboardFormat format = ClipboardFormats.findByAlias(formatName); if (format == null) { BBC.CLIPBOARD_INVALID_FORMAT.send(player, formatName); return; } BBC.GENERATING_LINK.send(player, formatName); ClipboardHolder holder = session.getClipboard(); URL url; if (holder instanceof MultiClipboardHolder) { MultiClipboardHolder multi = (MultiClipboardHolder) holder; Set<File> files = new HashSet<>(); Set<URI> invalid = new HashSet<>(); for (ClipboardHolder cur : multi.getHolders()) { if (cur instanceof URIClipboardHolder) { URIClipboardHolder uriHolder = (URIClipboardHolder) cur; URI uri = uriHolder.getUri(); File file = new File(uri.getPath()); if (file.exists() && file.isFile()) { files.add(file.getAbsoluteFile()); } else if (!uri.getPath().isEmpty()) { invalid.add(uri); } } } final LocalConfiguration config = WorldEdit.getInstance().getConfiguration(); final File working = WorldEdit.getInstance().getWorkingDirectoryFile(config.saveDir).getAbsoluteFile(); url = MainUtil.upload(null, null, "zip", new RunnableVal<OutputStream>() { @Override public void run(OutputStream out) { try (ZipOutputStream zos = new ZipOutputStream(out)) { for (File file : files) { String fileName = file.getName(); if (MainUtil.isInSubDirectory(working, file)) { fileName = working.toURI().relativize(file.toURI()).getPath(); } ZipEntry ze = new ZipEntry(fileName); zos.putNextEntry(ze); Files.copy(file.toPath(), zos); zos.closeEntry(); } } catch (IOException e) { throw new RuntimeException(e); } } }); } else { Clipboard clipboard = holder.getClipboard(); final Transform transform = holder.getTransform(); final Clipboard target; // If we have a transform, bake it into the copy if (!transform.isIdentity()) { final FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform); target = new BlockArrayClipboard(result.getTransformedRegion(), player.getUniqueId()); target.setOrigin(clipboard.getOrigin()); Operations.completeLegacy(result.copyTo(target)); } else { target = clipboard; } if (format == BuiltInClipboardFormat.PNG) { try { FastByteArrayOutputStream baos = new FastByteArrayOutputStream(Short.MAX_VALUE); ClipboardWriter writer = format.getWriter(baos); writer.write(target); baos.flush(); url = ImgurUtility.uploadImage(baos.toByteArray()); } catch (IOException e) { e.printStackTrace(); url = null; } } else { if (Settings.IMP.WEB.URL.isEmpty()) { BBC.SETTING_DISABLE.send(player, "web.url"); return; } url = FaweAPI.upload(target, format); } } if (url == null) { player.printError(BBC.GENERATING_LINK_FAILED.s()); } else { String urlText = url.toString(); if (Settings.IMP.WEB.SHORTEN_URLS) { try { urlText = MainUtil.getText("https://empcraft.com/s/?" + URLEncoder.encode(url.toString(), "UTF-8")); } catch (IOException e) { e.printStackTrace(); } } BBC.DOWNLOAD_LINK.send(player, urlText); } } @Command( name = "asset", desc = "Saves your clipboard to the asset web interface" ) @CommandPermissions({"worldedit.clipboard.asset"}) public void asset(final Player player, final LocalSession session, String category) throws WorldEditException { final ClipboardFormat format = BuiltInClipboardFormat.MCEDIT_SCHEMATIC; ClipboardHolder holder = session.getClipboard(); Clipboard clipboard = holder.getClipboard(); final Transform transform = holder.getTransform(); final Clipboard target; // If we have a transform, bake it into the copy if (!transform.isIdentity()) { final FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform); target = new BlockArrayClipboard(result.getTransformedRegion(), player.getUniqueId()); target.setOrigin(clipboard.getOrigin()); Operations.completeLegacy(result.copyTo(target)); } else { target = clipboard; } BBC.GENERATING_LINK.send(player, format.getName()); if (Settings.IMP.WEB.ASSETS.isEmpty()) { BBC.SETTING_DISABLE.send(player, "web.assets"); return; } URL url = format.uploadPublic(target, category.replaceAll("[/|\\\\]", "."), player.getName()); if (url == null) { player.printError(BBC.GENERATING_LINK_FAILED.s()); } else { BBC.DOWNLOAD_LINK.send(player, Settings.IMP.WEB.ASSETS); } ======= copy.getStatusMessages().forEach(actor::print); >>>>>>> if (!actor.hasPermission("fawe.tips")) { BBC.TIP_LAZYCUT.send(actor); } copy.getStatusMessages().forEach(actor::print); } @Command( name = "download", desc = "Downloads your clipboard through the configured web interface" ) @Deprecated @CommandPermissions({"worldedit.clipboard.download"}) public void download(final Player player, final LocalSession session, @Arg(name = "format", desc = "String", def = "schem") final String formatName) throws WorldEditException { final ClipboardFormat format = ClipboardFormats.findByAlias(formatName); if (format == null) { BBC.CLIPBOARD_INVALID_FORMAT.send(player, formatName); return; } BBC.GENERATING_LINK.send(player, formatName); ClipboardHolder holder = session.getClipboard(); URL url; if (holder instanceof MultiClipboardHolder) { MultiClipboardHolder multi = (MultiClipboardHolder) holder; Set<File> files = new HashSet<>(); Set<URI> invalid = new HashSet<>(); for (ClipboardHolder cur : multi.getHolders()) { if (cur instanceof URIClipboardHolder) { URIClipboardHolder uriHolder = (URIClipboardHolder) cur; URI uri = uriHolder.getUri(); File file = new File(uri.getPath()); if (file.exists() && file.isFile()) { files.add(file.getAbsoluteFile()); } else if (!uri.getPath().isEmpty()) { invalid.add(uri); } } } final LocalConfiguration config = WorldEdit.getInstance().getConfiguration(); final File working = WorldEdit.getInstance().getWorkingDirectoryFile(config.saveDir).getAbsoluteFile(); url = MainUtil.upload(null, null, "zip", new RunnableVal<OutputStream>() { @Override public void run(OutputStream out) { try (ZipOutputStream zos = new ZipOutputStream(out)) { for (File file : files) { String fileName = file.getName(); if (MainUtil.isInSubDirectory(working, file)) { fileName = working.toURI().relativize(file.toURI()).getPath(); } ZipEntry ze = new ZipEntry(fileName); zos.putNextEntry(ze); Files.copy(file.toPath(), zos); zos.closeEntry(); } } catch (IOException e) { throw new RuntimeException(e); } } }); } else { Clipboard clipboard = holder.getClipboard(); final Transform transform = holder.getTransform(); final Clipboard target; // If we have a transform, bake it into the copy if (!transform.isIdentity()) { final FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform); target = new BlockArrayClipboard(result.getTransformedRegion(), player.getUniqueId()); target.setOrigin(clipboard.getOrigin()); Operations.completeLegacy(result.copyTo(target)); } else { target = clipboard; } if (format == BuiltInClipboardFormat.PNG) { try { FastByteArrayOutputStream baos = new FastByteArrayOutputStream(Short.MAX_VALUE); ClipboardWriter writer = format.getWriter(baos); writer.write(target); baos.flush(); url = ImgurUtility.uploadImage(baos.toByteArray()); } catch (IOException e) { e.printStackTrace(); url = null; } } else { if (Settings.IMP.WEB.URL.isEmpty()) { BBC.SETTING_DISABLE.send(player, "web.url"); return; } url = FaweAPI.upload(target, format); } } if (url == null) { player.printError(BBC.GENERATING_LINK_FAILED.s()); } else { String urlText = url.toString(); if (Settings.IMP.WEB.SHORTEN_URLS) { try { urlText = MainUtil.getText("https://empcraft.com/s/?" + URLEncoder.encode(url.toString(), "UTF-8")); } catch (IOException e) { e.printStackTrace(); } } BBC.DOWNLOAD_LINK.send(player, urlText); } } @Command( name = "asset", desc = "Saves your clipboard to the asset web interface" ) @CommandPermissions({"worldedit.clipboard.asset"}) public void asset(final Player player, final LocalSession session, String category) throws WorldEditException { final ClipboardFormat format = BuiltInClipboardFormat.MCEDIT_SCHEMATIC; ClipboardHolder holder = session.getClipboard(); Clipboard clipboard = holder.getClipboard(); final Transform transform = holder.getTransform(); final Clipboard target; // If we have a transform, bake it into the copy if (!transform.isIdentity()) { final FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform); target = new BlockArrayClipboard(result.getTransformedRegion(), player.getUniqueId()); target.setOrigin(clipboard.getOrigin()); Operations.completeLegacy(result.copyTo(target)); } else { target = clipboard; } BBC.GENERATING_LINK.send(player, format.getName()); if (Settings.IMP.WEB.ASSETS.isEmpty()) { BBC.SETTING_DISABLE.send(player, "web.assets"); return; } URL url = format.uploadPublic(target, category.replaceAll("[/|\\\\]", "."), player.getName()); if (url == null) { player.printError(BBC.GENERATING_LINK_FAILED.s()); } else { BBC.DOWNLOAD_LINK.send(player, Settings.IMP.WEB.ASSETS); } <<<<<<< ======= messages.addAll(Lists.newArrayList(operation.getStatusMessages())); >>>>>>> messages.addAll(Lists.newArrayList(operation.getStatusMessages())); <<<<<<< ======= if (Math.abs(yRotate % 90) > 0.001 || Math.abs(xRotate % 90) > 0.001 || Math.abs(zRotate % 90) > 0.001) { actor.printDebug(TranslatableComponent.of("worldedit.rotate.no-interpolation")); } >>>>>>> <<<<<<< actor.print(BBC.COMMAND_ROTATE.s()); if (!actor.hasPermission("fawe.tips")) { BBC.TIP_FLIP.or(BBC.TIP_DEFORM, BBC.TIP_TRANSFORM).send(actor); } ======= actor.printInfo(TranslatableComponent.of("worldedit.rotate.rotated")); >>>>>>> actor.printInfo(TranslatableComponent.of("worldedit.rotate.rotated")); if (!actor.hasPermission("fawe.tips")) { BBC.TIP_FLIP.or(BBC.TIP_DEFORM, BBC.TIP_TRANSFORM).send(actor); }
<<<<<<< import com.boydti.fawe.object.collection.SoftHashMap; ======= import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; >>>>>>> import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; <<<<<<< import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nullable; ======= import java.util.concurrent.Callable; import static com.google.common.base.Preconditions.checkNotNull; >>>>>>> import java.util.concurrent.Callable; <<<<<<< } catch (Throwable e) { log.log(Level.WARNING, "Failed to load saved session", e); ======= } catch (IOException e) { log.warn("Failed to load saved session", e); >>>>>>> } catch (IOException e) { log.warn("Failed to load saved session", e); <<<<<<< sessions.put(getKey(owner), new SessionHolder(sessionKey, session)); ======= // Remember the session regardless of if it's currently active or not. // And have the SessionTracker FLUSH inactive sessions. sessions.put(getKey(owner), new SessionHolder(sessionKey, session)); >>>>>>> // Remember the session regardless of if it's currently active or not. // And have the SessionTracker FLUSH inactive sessions. sessions.put(getKey(owner), new SessionHolder(sessionKey, session)); <<<<<<< private void save(SessionHolder holder) { SessionKey key = holder.key; holder.session.setClipboard(null); if (key.isPersistent()) { try { if (holder.session.compareAndResetDirty()) { if (holder.session.save()) { store.save(getKey(key), holder.session); } else if (path != null) { File file = new File(path, getKey(key) + ".json"); if (file.exists()) { if (!file.delete()) { file.deleteOnExit(); } } ======= private boolean shouldBoundLimit(SessionOwner owner, String permission, int currentLimit, int maxLimit) { if (maxLimit > -1) { // if max is finite return (currentLimit < 0 || currentLimit > maxLimit) // make sure current is finite and less than max && !owner.hasPermission(permission); // unless user has unlimited permission } return false; } /** * Save a map of sessions to disk. * * @param sessions a map of sessions to save * @return a future that completes on save or error */ private ListenableFuture<?> commit(final Map<SessionKey, LocalSession> sessions) { checkNotNull(sessions); if (sessions.isEmpty()) { return Futures.immediateFuture(sessions); } return executorService.submit((Callable<Object>) () -> { Exception exception = null; for (Map.Entry<SessionKey, LocalSession> entry : sessions.entrySet()) { SessionKey key = entry.getKey(); if (key.isPersistent()) { try { store.save(getKey(key), entry.getValue()); } catch (IOException e) { log.warn("Failed to write session for UUID " + getKey(key), e); exception = e; >>>>>>> private boolean shouldBoundLimit(SessionOwner owner, String permission, int currentLimit, int maxLimit) { if (maxLimit > -1) { // if max is finite return (currentLimit < 0 || currentLimit > maxLimit) // make sure current is finite and less than max && !owner.hasPermission(permission); // unless user has unlimited permission } return false; } /** * Save a map of sessions to disk. * * @param sessions a map of sessions to save * @return a future that completes on save or error */ private ListenableFuture<?> commit(final Map<SessionKey, LocalSession> sessions) { checkNotNull(sessions); if (sessions.isEmpty()) { return Futures.immediateFuture(sessions); } return executorService.submit((Callable<Object>) () -> { Exception exception = null; for (Map.Entry<SessionKey, LocalSession> entry : sessions.entrySet()) { SessionKey key = entry.getKey(); if (key.isPersistent()) { try { store.save(getKey(key), entry.getValue()); } catch (IOException e) { log.warn("Failed to write session for UUID " + getKey(key), e); exception = e;
<<<<<<< PaginationBox paginationBox = PaginationBox.fromStrings("Selected Chunks", "/listchunks -p %page%", chunks.stream().map(BlockVector2::toString).collect(Collectors.toList())); actor.print(paginationBox.create(page)); ======= PaginationBox paginationBox = PaginationBox.fromStrings("Selected Chunks", "/listchunks -p %page%", chunks); player.print(paginationBox.create(page)); >>>>>>> PaginationBox paginationBox = PaginationBox.fromStrings("Selected Chunks", "/listchunks -p %page%", chunks); actor.print(paginationBox.create(page));
<<<<<<< import com.sk89q.worldedit.world.biome.BaseBiome; ======= import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.block.BaseBlock; >>>>>>> import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.block.BaseBlock; <<<<<<< //<<<<<<< HEAD public BlockState getLazyBlock(BlockVector3 position) { return getBlock(position); } @Override public BaseBlock getFullBlock(BlockVector3 position) { ======= public BaseBlock getFullBlock(BlockVector3 position) { >>>>>>> public BlockState getLazyBlock(BlockVector3 position) { return getBlock(position); } @Override public BaseBlock getFullBlock(BlockVector3 position) {
<<<<<<< ======= name = "none", aliases = "unbind", desc = "Unbind a bound tool from your current item" ) public void none(Player player, LocalSession session) throws WorldEditException { setToolNone(player, session, false); } @Command( >>>>>>> <<<<<<< session.setTool(itemType, SelectionWand.INSTANCE); player.print("Selection wand bound to " + itemType.getName() + "."); ======= session.setTool(itemType, new SelectionWand()); player.printInfo(TranslatableComponent.of("worldedit.tool.selwand.equip", TextComponent.of(itemType.getName()))); >>>>>>> session.setTool(itemType, SelectionWand.INSTANCE); player.printInfo(TranslatableComponent.of("worldedit.tool.selwand.equip", TextComponent.of(itemType.getName()))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, NavigationWand.INSTANCE); player.print("Navigation wand bound to " + itemStack.getType().getName() + "."); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new NavigationWand()); player.printInfo(TranslatableComponent.of("worldedit.tool.navWand.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, NavigationWand.INSTANCE); player.printInfo(TranslatableComponent.of("worldedit.tool.navWand.equip", TextComponent.of(itemType.getName()))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new QueryTool()); BBC.TOOL_INFO.send(player, itemStack.getType().getName()); } @Command( name = "inspect", desc = "Inspect edits within a radius" ) @CommandPermissions("worldedit.tool.inspect") public void inspectBrush(Player player, LocalSession session) throws WorldEditException { BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new InspectBrush()); BBC.TOOL_INSPECT.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new QueryTool()); player.printInfo(TranslatableComponent.of("worldedit.tool.info.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new QueryTool()); player.printInfo(TranslatableComponent.of("worldedit.tool.info.equip", TextComponent.of(itemType.getName()))); } @Command( name = "inspect", desc = "Inspect edits within a radius" ) @CommandPermissions("worldedit.tool.inspect") public void inspectBrush(Player player, LocalSession session) throws WorldEditException { BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new InspectBrush()); BBC.TOOL_INSPECT.send(player, itemStack.getType().getName()); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new TreePlanter(type)); BBC.TOOL_TREE.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new TreePlanter(type)); player.printInfo(TranslatableComponent.of("worldedit.tool.tree.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new TreePlanter(type)); player.printInfo(TranslatableComponent.of("worldedit.tool.tree.equip", TextComponent.of(itemType.getName()))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new BlockReplacer(pattern)); BBC.TOOL_REPL.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new BlockReplacer(pattern)); player.printInfo(TranslatableComponent.of("worldedit.tool.repl.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new BlockReplacer(pattern)); player.printInfo(TranslatableComponent.of("worldedit.tool.repl.equip", TextComponent.of(itemType.getName()))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new BlockDataCyler()); BBC.TOOL_CYCLER.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new BlockDataCyler()); player.printInfo(TranslatableComponent.of("worldedit.tool.data-cycler.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new BlockDataCyler()); player.printInfo(TranslatableComponent.of("worldedit.tool.data-cycler.equip", TextComponent.of(itemType.getName()))); <<<<<<< BBC.TOOL_RANGE_ERROR.send(player, config.maxSuperPickaxeSize); ======= player.printError(TranslatableComponent.of("worldedit.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); >>>>>>> player.printError(TranslatableComponent.of("worldedit.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new FloodFillTool(range, pattern)); BBC.TOOL_FLOOD_FILL.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new FloodFillTool(range, pattern)); player.printInfo(TranslatableComponent.of("worldedit.tool.floodfill.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new FloodFillTool(range, pattern)); player.printInfo(TranslatableComponent.of("worldedit.tool.floodfill.equip", TextComponent.of(itemType.getName()))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new FloatingTreeRemover()); BBC.TOOL_DELTREE.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new FloatingTreeRemover()); player.printInfo(TranslatableComponent.of("worldedit.tool.deltree.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new FloatingTreeRemover()); player.printInfo(TranslatableComponent.of("worldedit.tool.deltree.equip", TextComponent.of(itemType.getName()))); <<<<<<< BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new DistanceWand()); BBC.TOOL_FARWAND.send(player, itemStack.getType().getName()); ======= final ItemType itemType = player.getItemInHand(HandSide.MAIN_HAND).getType(); session.setTool(itemType, new DistanceWand()); player.printInfo(TranslatableComponent.of("worldedit.tool.farwand.equip", TextComponent.of(itemType.getName()))); >>>>>>> BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(player, new DistanceWand()); player.printInfo(TranslatableComponent.of("worldedit.tool.farwand.equip", TextComponent.of(itemType.getName())));
<<<<<<< import com.google.gerrit.entities.Project; import com.google.gerrit.entities.RefNames; ======= import com.google.gerrit.common.Nullable; >>>>>>> import com.google.gerrit.common.Nullable; import com.google.gerrit.entities.Project; import com.google.gerrit.entities.RefNames;
<<<<<<< import com.boydti.fawe.config.BBC; import com.boydti.fawe.object.collection.BlockVectorSet; import com.google.common.collect.Sets; ======= import com.google.common.collect.Lists; >>>>>>> import com.google.common.collect.Lists; import com.boydti.fawe.config.BBC; import com.boydti.fawe.object.collection.BlockVectorSet; import com.google.common.collect.Sets; <<<<<<< ======= import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import java.util.ArrayDeque; >>>>>>> import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; <<<<<<< BlockVector3 blockVector = position; if (!visited.contains(blockVector)) { isVisitable(position, position); // Ignore this, just to initialize mask on this point queue.add(blockVector); visited.add(blockVector); ======= if (!visited.contains(position)) { queue.add(position); visited.add(position); >>>>>>> if (!visited.contains(position)) { queue.add(position); visited.add(position); <<<<<<< public void addStatusMessages(List<String> messages) { messages.add(BBC.VISITOR_BLOCK.format(getAffected())); ======= public Iterable<Component> getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( "worldedit.operation.affected.block", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE)); >>>>>>> public Iterable<Component> getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( "worldedit.operation.affected.block", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE));
<<<<<<< block = getLazyBlock(x, y1, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { ======= block = getBlock(x, y1, z); if (!block.getBlockType().getMaterial().isMovementBlocker() != state) { >>>>>>> block = getBlock(x, y1, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { <<<<<<< block = getLazyBlock(x, y2, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { ======= block = getBlock(x, y2, z); if (!block.getBlockType().getMaterial().isMovementBlocker() != state) { >>>>>>> block = getBlock(x, y2, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { <<<<<<< block = getLazyBlock(x, layer, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { return layer + offset << 4; ======= block = getBlock(x, layer, z); if (!block.getBlockType().getMaterial().isMovementBlocker() != state) { int data = (state ? PropertyGroup.LEVEL.get(block) : data1); return ((layer + offset) << 4) + 0; >>>>>>> block = getBlock(x, layer, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { return ((layer + offset) << 4) + 0; <<<<<<< block = getLazyBlock(x, layer, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) { ======= block = getBlock(x, layer, z); if (!block.getBlockType().getMaterial().isMovementBlocker() != state) { >>>>>>> block = getBlock(x, layer, z); if (block.getBlockType().getMaterial().isMovementBlocker() == state) {
<<<<<<< import com.boydti.fawe.Fawe; import com.boydti.fawe.bukkit.FaweBukkit; import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; import com.boydti.fawe.util.MainUtil; ======= >>>>>>> import com.bekvon.bukkit.residence.commands.message; import com.bekvon.bukkit.residence.containers.cmd; import com.boydti.fawe.Fawe; import com.boydti.fawe.bukkit.FaweBukkit; import com.boydti.fawe.bukkit.adapter.v1_13_1.Spigot_v1_13_R2; import com.boydti.fawe.util.MainUtil; <<<<<<< import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bukkit.Bukkit; import org.bukkit.Material; ======= import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockCategory; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.FuzzyBlockState; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.item.ItemCategory; import com.sk89q.worldedit.world.item.ItemType; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Tag; import org.bukkit.block.Biome; >>>>>>> import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockCategory; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.FuzzyBlockState; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.item.ItemCategory; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Tag; import org.bukkit.block.Biome; <<<<<<< import java.util.Locale; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; ======= import java.util.Map; >>>>>>> import java.util.Locale; import java.util.Map; <<<<<<< private static final Logger log = Logger.getLogger("FastAsyncWorldEdit"); ======= private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class); >>>>>>> private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class); <<<<<<< fail(() -> PermissionsResolverManager.initialize(INSTANCE), "Failed to initialize permissions resolver"); ======= } /** * Called on plugin enable. */ @Override public void onEnable() { setupTags(); // these have to be done post-world since they rely on MC registries. the other ones just use Bukkit enums PermissionsResolverManager.initialize(this); // Setup permission resolver >>>>>>> fail(() -> PermissionsResolverManager.initialize(INSTANCE), "Failed to initialize permissions resolver"); } /** * Called on plugin enable. */ @Override public void onEnable() { setupTags(); // these have to be done post-world since they rely on MC registries. the other ones just use Bukkit enums PermissionsResolverManager.initialize(this); // Setup permission resolver <<<<<<< try { Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING); if (platform instanceof BukkitServerInterface) { log.log(Level.WARNING, e.getMessage()); return; } else { log.log(Level.INFO, "WorldEdit could not find a Bukkit adapter for this MC version, " + "but it seems that you have another implementation of WorldEdit installed (" + platform.getPlatformName() + ") " + "that handles the world editing."); } } catch (NoCapablePlatformException ignore) {} log.log(Level.INFO, "WorldEdit could not find a Bukkit adapter for this MC version"); ======= Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING); if (platform instanceof BukkitServerInterface) { log.warn(e.getMessage()); } else { log.info("WorldEdit could not find a Bukkit adapter for this MC version, " + "but it seems that you have another implementation of WorldEdit installed (" + platform.getPlatformName() + ") " + "that handles the world editing."); } >>>>>>> try { Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING); if (platform instanceof BukkitServerInterface) { log.warn(e.getMessage()); return; } else { log.info("WorldEdit could not find a Bukkit adapter for this MC version, " + "but it seems that you have another implementation of WorldEdit installed (" + platform.getPlatformName() + ") " + "that handles the world editing."); } } catch (NoCapablePlatformException ignore) {} log.info("WorldEdit could not find a Bukkit adapter for this MC version"); <<<<<<< } } private void copyDefaultConfig(InputStream input, File actual, String name) { try (FileOutputStream output = new FileOutputStream(actual)) { byte[] buf = new byte[8192]; int length; while ((length = input.read(buf)) > 0) { output.write(buf, 0, length); ======= } } private void copyDefaultConfig(InputStream input, File actual, String name) { try (FileOutputStream output = new FileOutputStream(actual)) { byte[] buf = new byte[8192]; int length; while ((length = input.read(buf)) > 0) { output.write(buf, 0, length); >>>>>>> } } private void copyDefaultConfig(InputStream input, File actual, String name) { try (FileOutputStream output = new FileOutputStream(actual)) { byte[] buf = new byte[8192]; int length; while ((length = input.read(buf)) > 0) { output.write(buf, 0, length);
<<<<<<< import com.sk89q.worldedit.blocks.BaseBlock; ======= import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; >>>>>>> import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.World; <<<<<<< import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; ======= import com.sk89q.worldedit.world.block.BlockStateHolder; >>>>>>> import com.sk89q.worldedit.world.block.BlockStateHolder; <<<<<<< public BlockState getBlock(Vector position) throws DataException { if(position.getBlockY() >= 128) return BlockTypes.VOID_AIR.getDefaultState(); ======= public BlockStateHolder getBlock(Vector position) throws DataException { if(position.getBlockY() >= 128) BlockTypes.VOID_AIR.getDefaultState().toBaseBlock(); >>>>>>> public BlockStateHolder getBlock(Vector position) throws DataException { if(position.getBlockY() >= 128) return BlockTypes.VOID_AIR.getDefaultState(); <<<<<<< if (state.getBlockType().getMaterial().hasContainer()) { CompoundTag tileEntity = getBlockTileEntity(position); if (tileEntity != null) return new BaseBlock(state, tileEntity); } return state; ======= if (state == null) { WorldEdit.logger.warning("Unknown legacy block " + id + ":" + dataVal + " found when loading legacy anvil chunk."); return BlockTypes.AIR.getDefaultState(); } CompoundTag tileEntity = getBlockTileEntity(position); if (tileEntity != null) { return state.toBaseBlock(tileEntity); } return state; >>>>>>> if (state == null) { WorldEdit.logger.warning("Unknown legacy block " + id + ":" + dataVal + " found when loading legacy anvil chunk."); return BlockTypes.AIR.getDefaultState(); } if (state.getBlockType().getMaterial().hasContainer()) { CompoundTag tileEntity = getBlockTileEntity(position); if (tileEntity != null) return new BaseBlock(state, tileEntity); } return state;
<<<<<<< import com.boydti.fawe.Fawe; import com.boydti.fawe.config.Settings; import com.boydti.fawe.jnbt.NBTStreamer; import com.boydti.fawe.object.FaweInputStream; import com.boydti.fawe.object.FaweOutputStream; import com.boydti.fawe.object.clipboard.CPUOptimizedClipboard; import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard; import com.boydti.fawe.object.clipboard.FaweClipboard; import com.boydti.fawe.object.clipboard.MemoryOptimizedClipboard; import com.boydti.fawe.object.io.FastByteArrayOutputStream; import com.boydti.fawe.object.io.FastByteArraysInputStream; import com.boydti.fawe.util.IOUtil; ======= >>>>>>> import com.boydti.fawe.Fawe; import com.boydti.fawe.config.Settings; import com.boydti.fawe.jnbt.NBTStreamer; import com.boydti.fawe.object.FaweInputStream; import com.boydti.fawe.object.FaweOutputStream; import com.boydti.fawe.object.clipboard.CPUOptimizedClipboard; import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard; import com.boydti.fawe.object.clipboard.FaweClipboard; import com.boydti.fawe.object.clipboard.MemoryOptimizedClipboard; import com.boydti.fawe.object.io.FastByteArrayOutputStream; import com.boydti.fawe.object.io.FastByteArraysInputStream; import com.boydti.fawe.util.IOUtil; <<<<<<< import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; ======= import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; <<<<<<< import java.util.UUID; import java.util.function.BiConsumer; import java.util.logging.Logger; ======= >>>>>>> import java.util.UUID; import java.util.function.BiConsumer; import java.util.logging.Logger; <<<<<<< }); streamer.readFully(); if (fc == null) setupClipboard(length * width * height, uuid); fc.setDimensions(BlockVector3.at(width, height, length)); BlockVector3 origin = min; CuboidRegion region; if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) { origin = origin.subtract(BlockVector3.at(offsetX, offsetY, offsetZ)); } region = new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE)); if (blocksOut.getSize() != 0) { try (FaweInputStream fis = new FaweInputStream(new LZ4BlockInputStream(new FastByteArraysInputStream(blocksOut.toByteArrays())))) { int volume = width * height * length; if (palette.length < 128) { for (int index = 0; index < volume; index++) { BlockState state = BlockTypes.states[palette[fis.read()]]; fc.setBlock(index, state); ======= // index = (y * length + z) * width + x int y = index / (width * length); int z = (index % (width * length)) / width; int x = (index % (width * length)) % width; BlockState state = palette.get(value); BlockVector3 pt = BlockVector3.at(x, y, z); try { if (tileEntitiesMap.containsKey(pt)) { Map<String, Tag> values = Maps.newHashMap(tileEntitiesMap.get(pt)); for (NBTCompatibilityHandler handler : COMPATIBILITY_HANDLERS) { if (handler.isAffectedBlock(state)) { handler.updateNBT(state, values); } >>>>>>> }); streamer.readFully(); if (fc == null) setupClipboard(length * width * height, uuid); fc.setDimensions(BlockVector3.at(width, height, length)); BlockVector3 origin = min; CuboidRegion region; if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) { origin = origin.subtract(BlockVector3.at(offsetX, offsetY, offsetZ)); } region = new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE)); if (blocksOut.getSize() != 0) { try (FaweInputStream fis = new FaweInputStream(new LZ4BlockInputStream(new FastByteArraysInputStream(blocksOut.toByteArrays())))) { int volume = width * height * length; if (palette.length < 128) { for (int index = 0; index < volume; index++) { BlockState state = BlockTypes.states[palette[fis.read()]]; fc.setBlock(index, state);
<<<<<<< ======= import java.util.Locale; import java.util.Optional; import static com.google.common.base.Preconditions.checkNotNull; import static com.sk89q.worldedit.util.formatting.WorldEditText.reduceToText; >>>>>>>
<<<<<<< @Override ======= @NotNull @Override public AsyncBlockState getState(boolean useSnapshot) { return getState(); } @NotNull @Override >>>>>>> @Override @NotNull public AsyncBlockState getState(boolean useSnapshot) { return getState(); } @NotNull @Override
<<<<<<< public void display(Change chg, Boolean starred, Boolean canEditCommitMessage, PatchSetInfo info, AccountInfoCache acc, SubmitTypeRecord submitTypeRecord, CommentLinkProcessor commentLinkProcessor) { ======= public void display(ChangeDetail chg, Boolean starred, Boolean canEditCommitMessage, PatchSetInfo info, final AccountInfoCache acc, SubmitTypeRecord submitTypeRecord) { >>>>>>> public void display(ChangeDetail chg, Boolean starred, Boolean canEditCommitMessage, PatchSetInfo info, AccountInfoCache acc, SubmitTypeRecord submitTypeRecord, CommentLinkProcessor commentLinkProcessor) { <<<<<<< messageBlock.display(chg.currentPatchSetId(), starred, canEditCommitMessage, info.getMessage(), commentLinkProcessor); ======= messageBlock.display(chg.getChange().currentPatchSetId(), starred, canEditCommitMessage, info.getMessage()); >>>>>>> messageBlock.display(chg.getChange().currentPatchSetId(), starred, canEditCommitMessage, info.getMessage(), commentLinkProcessor);
<<<<<<< import static com.google.common.base.Preconditions.checkNotNull; import com.boydti.fawe.Fawe; import com.boydti.fawe.config.BBC; import com.boydti.fawe.object.extent.ResettableExtent; import com.boydti.fawe.util.CachedTextureUtil; import com.boydti.fawe.util.CleanTextureUtil; import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.RandomTextureUtil; import com.boydti.fawe.util.StringMan; import com.boydti.fawe.util.TextureUtil; ======= >>>>>>> import com.boydti.fawe.Fawe; import com.boydti.fawe.config.BBC; import com.boydti.fawe.object.extent.ResettableExtent; import com.boydti.fawe.util.CachedTextureUtil; import com.boydti.fawe.util.CleanTextureUtil; import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.RandomTextureUtil; import com.boydti.fawe.util.StringMan; import com.boydti.fawe.util.TextureUtil; <<<<<<< import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extension.platform.Capability; ======= import com.sk89q.worldedit.extension.platform.Capability; >>>>>>> import java.util.ArrayList; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extension.platform.Capability; <<<<<<< import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TreeMap; import java.util.concurrent.Callable; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; ======= import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TreeMap; import java.util.concurrent.Callable; import static com.google.common.base.Preconditions.checkNotNull; >>>>>>> import java.io.FileNotFoundException; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TreeMap; import java.util.concurrent.Callable; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; import static com.google.common.base.Preconditions.checkNotNull; <<<<<<< name = "/fast", desc = "Toggle fast mode" ======= name = "/fast", desc = "Toggle fast mode" >>>>>>> name = "/fast", desc = "Toggle fast mode" <<<<<<< public void fast(Actor actor, LocalSession session, @Arg(desc = "The new fast mode state", def = "") Boolean fastMode) { boolean hasFastMode = session.hasFastMode(); if (fastMode != null && fastMode == hasFastMode) { actor.printError("Fast mode already " + (fastMode ? "enabled" : "disabled") + "."); return; } if (hasFastMode) { ======= public void fast(Actor actor, LocalSession session, @Arg(desc = "The new fast mode state", def = "") Boolean fastMode) { boolean hasFastMode = session.hasFastMode(); if (fastMode != null && fastMode == hasFastMode) { actor.printError("Fast mode already " + (fastMode ? "enabled" : "disabled") + "."); return; } if (hasFastMode) { >>>>>>> public void fast(Actor actor, LocalSession session, @Arg(desc = "The new fast mode state", def = "") Boolean fastMode) { boolean hasFastMode = session.hasFastMode(); if (fastMode != null && fastMode == hasFastMode) { actor.printError("Fast mode already " + (fastMode ? "enabled" : "disabled") + "."); return; } if (hasFastMode) { <<<<<<< actor.print(BBC.FAST_DISABLED.s()); ======= actor.print("Fast mode disabled."); >>>>>>> actor.print("Fast mode disabled."); <<<<<<< actor.print(BBC.FAST_ENABLED.s()); ======= actor.print("Fast mode enabled. Lighting in the affected chunks may be wrong and/or you may need to rejoin to see changes."); >>>>>>> actor.print("Fast mode enabled. Lighting in the affected chunks may be wrong and/or you may need to rejoin to see changes.");
<<<<<<< import com.sk89q.worldedit.entity.Player; ======= import com.sk89q.worldedit.entity.Entity; >>>>>>> import com.sk89q.worldedit.entity.Entity; <<<<<<< public void register(Platform platform) { log.log(Level.FINE, "Registering commands with " + platform.getClass().getCanonicalName()); this.platform = null; try { new CommandScriptLoader().load(); } catch (Throwable e) { e.printStackTrace(); } ======= void register(Platform platform) { log.info("Registering commands with " + platform.getClass().getCanonicalName()); >>>>>>> public void register(Platform platform) { log.info("Registering commands with " + platform.getClass().getCanonicalName()); this.platform = null; try { new CommandScriptLoader().load(); } catch (Throwable e) { e.printStackTrace(); } <<<<<<< if (!actor.isPlayer()) { actor = FakePlayer.wrap(actor.getName(), actor.getUniqueId(), actor); } final LocalSession session = worldEdit.getSessionManager().get(actor); ======= LocalSession session = worldEdit.getSessionManager().get(actor); Request.request().setSession(session); if (actor instanceof Entity) { Extent extent = ((Entity) actor).getExtent(); if (extent instanceof World) { Request.request().setWorld(((World) extent)); } } >>>>>>> if (!actor.isPlayer()) { actor = FakePlayer.wrap(actor.getName(), actor.getUniqueId(), actor); } final LocalSession session = worldEdit.getSessionManager().get(actor); Request.request().setSession(session); if (actor instanceof Entity) { Extent extent = ((Entity) actor).getExtent(); if (extent instanceof World) { Request.request().setWorld(((World) extent)); } } <<<<<<< ======= } catch (WrappedCommandException e) { Throwable t = e.getCause(); actor.printError("Please report this error: [See console]"); actor.printRaw(t.getClass().getName() + ": " + t.getMessage()); log.error("An unexpected error while handling a WorldEdit command", t); >>>>>>> <<<<<<< actor.printError(BBC.getPrefix() + "An unknown FAWE error has occurred! Please see console."); log.log(Level.SEVERE, "An unknown FAWE error occurred", e); } } catch (Throwable e) { Exception faweException = FaweException.get(e); String message = e.getMessage(); if (faweException != null) { BBC.WORLDEDIT_CANCEL_REASON.send(actor, faweException.getMessage()); } else { actor.printError(BBC.getPrefix() + "There was an error handling a FAWE command: [See console]"); actor.printRaw(e.getClass().getName() + ": " + e.getMessage()); log.log(Level.SEVERE, "An unexpected error occurred while handling a FAWE command", e); ======= actor.printError("An unknown error has occurred! Please see console."); log.error("An unknown error occurred", e); >>>>>>> actor.printError(BBC.getPrefix() + "An unknown FAWE error has occurred! Please see console."); log.log(Level.SEVERE, "An unknown FAWE error occurred", e); } } catch (Throwable e) { Exception faweException = FaweException.get(e); String message = e.getMessage(); if (faweException != null) { BBC.WORLDEDIT_CANCEL_REASON.send(actor, faweException.getMessage()); } else { actor.printError(BBC.getPrefix() + "There was an error handling a FAWE command: [See console]"); actor.printRaw(e.getClass().getName() + ": " + e.getMessage()); log.log(Level.SEVERE, "An unexpected error occurred while handling a FAWE command", e);
<<<<<<< import com.google.gerrit.server.account.WatchConfig.NotifyType; ======= import com.google.gerrit.common.TimeUtil; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.server.account.WatchConfig; import com.google.gerrit.server.account.WatchConfig.ProjectWatchKey; >>>>>>> import com.google.gerrit.server.account.WatchConfig; import com.google.gerrit.server.account.WatchConfig.NotifyType; import com.google.gerrit.server.account.WatchConfig.ProjectWatchKey; <<<<<<< import java.util.EnumSet; import java.util.List; ======= import com.google.inject.Inject; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; >>>>>>> import com.google.inject.Inject; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; <<<<<<< ======= import java.util.ArrayList; >>>>>>>
<<<<<<< ======= private final Vector3 position; >>>>>>> <<<<<<< public Location(Extent extent, Vector3 position, float yaw, float pitch) { super(position); ======= public Location(Extent extent, Vector3 position, float yaw, float pitch) { >>>>>>> public Location(Extent extent, Vector3 position, float yaw, float pitch) { super(position); <<<<<<< public Vector3 getDirection() { ======= public Vector3 getDirection() { if (Float.isNaN(getYaw()) && Float.isNaN(getPitch())) { return Vector3.ZERO; } >>>>>>> public Vector3 getDirection() { if (Float.isNaN(getYaw()) && Float.isNaN(getPitch())) { return Vector3.ZERO; } <<<<<<< public Location setDirection(Vector3 direction) { return new Location(extent, this, (float) direction.toYaw(), (float) direction.toPitch()); ======= public Location setDirection(Vector3 direction) { return new Location(extent, position, (float) direction.toYaw(), (float) direction.toPitch()); >>>>>>> public Location setDirection(Vector3 direction) { return new Location(extent, this, (float) direction.toYaw(), (float) direction.toPitch()); <<<<<<< public Vector3 toVector() { return this; ======= public Vector3 toVector() { return position; } /** * Get the X component of the position vector. * * @return the X component */ public double getX() { return position.getX(); } /** * Get the rounded X component of the position vector. * * @return the rounded X component */ public int getBlockX() { return (int) Math.floor(position.getX()); >>>>>>> public Vector3 toVector() { return this; <<<<<<< return new Location(extent, this.withX(x), yaw, pitch); } ======= return new Location(extent, position.withX(x), yaw, pitch); } /** * Get the Y component of the position vector. * * @return the Y component */ public double getY() { return position.getY(); } /** * Get the rounded Y component of the position vector. * * @return the rounded Y component */ public int getBlockY() { return (int) Math.floor(position.getY()); } >>>>>>> return new Location(extent, this.withX(x), yaw, pitch); } <<<<<<< return new Location(extent, this.withY(y), yaw, pitch); ======= return new Location(extent, position.withY(y), yaw, pitch); } /** * Get the Z component of the position vector. * * @return the Z component */ public double getZ() { return position.getZ(); } /** * Get the rounded Z component of the position vector. * * @return the rounded Z component */ public int getBlockZ() { return (int) Math.floor(position.getZ()); >>>>>>> return new Location(extent, this.withY(y), yaw, pitch); <<<<<<< return new Location(extent, this.withZ(z), yaw, pitch); ======= return new Location(extent, position.withZ(z), yaw, pitch); >>>>>>> return new Location(extent, this.withZ(z), yaw, pitch);
<<<<<<< import java.util.List; import java.util.UUID; import javax.annotation.Nullable; ======= >>>>>>> import java.util.List; import java.util.UUID; import javax.annotation.Nullable;
<<<<<<< import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; ======= import com.sk89q.worldedit.WorldEdit; >>>>>>> import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseBlock; <<<<<<< import com.sk89q.worldedit.world.block.BlockStateHolder; ======= import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; >>>>>>> import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes;
<<<<<<< import com.sk89q.worldedit.internal.anvil.ChunkDeleter; import com.sk89q.worldedit.internal.command.CommandUtil; ======= import com.sk89q.worldedit.internal.command.CommandUtil; import com.sk89q.worldedit.internal.anvil.ChunkDeleter; import com.sk89q.worldedit.registry.state.Property; >>>>>>> import com.sk89q.worldedit.internal.anvil.ChunkDeleter; import com.sk89q.worldedit.internal.command.CommandUtil; <<<<<<< import com.sk89q.worldedit.world.weather.WeatherTypes; import io.papermc.lib.PaperLib; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarFile; import java.util.logging.Level; import java.util.zip.ZipEntry; import javax.annotation.Nullable; ======= import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.weather.WeatherTypes; import io.papermc.lib.PaperLib; >>>>>>> import com.sk89q.worldedit.world.weather.WeatherTypes; import io.papermc.lib.PaperLib; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarFile; import java.util.logging.Level; import java.util.zip.ZipEntry; import javax.annotation.Nullable; <<<<<<< import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginManager; ======= import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; >>>>>>> import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginManager; <<<<<<< ======= import javax.annotation.Nullable; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; import java.util.jar.JarFile; import java.util.logging.Level; import java.util.zip.ZipEntry; import static com.google.common.base.Preconditions.checkNotNull; import static com.sk89q.worldedit.internal.anvil.ChunkDeleter.DELCHUNKS_FILE_NAME; >>>>>>> <<<<<<< Path delChunks = Paths.get(getDataFolder().getPath(), DELCHUNKS_FILE_NAME); if (Files.exists(delChunks)) { ChunkDeleter.runFromFile(delChunks, true); } fail(() -> PermissionsResolverManager.initialize(INSTANCE), "Failed to initialize permissions resolver"); ======= Path delChunks = Paths.get(getDataFolder().getPath(), DELCHUNKS_FILE_NAME); if (Files.exists(delChunks)) { ChunkDeleter.runFromFile(delChunks, true); } >>>>>>> Path delChunks = Paths.get(getDataFolder().getPath(), DELCHUNKS_FILE_NAME); if (Files.exists(delChunks)) { ChunkDeleter.runFromFile(delChunks, true); } fail(() -> PermissionsResolverManager.initialize(INSTANCE), "Failed to initialize permissions resolver"); <<<<<<< if (INSTANCE != null) return; onLoad(); ======= >>>>>>> if (INSTANCE != null) return; onLoad(); <<<<<<< split[0] = commandLabel; ======= split[0] = "/" + commandLabel; >>>>>>> split[0] = commandLabel;
<<<<<<< import com.boydti.fawe.object.mask.IdMask; ======= >>>>>>> import com.boydti.fawe.object.mask.IdMask; <<<<<<< ======= import com.sk89q.worldedit.MaxChangedBlocksException; >>>>>>> <<<<<<< import com.sk89q.worldedit.function.block.BlockReplace; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.visitor.RecursiveVisitor; import com.sk89q.worldedit.math.BlockVector3; ======= import com.sk89q.worldedit.math.BlockVector3; >>>>>>> import com.sk89q.worldedit.function.block.BlockReplace; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.visitor.RecursiveVisitor; import com.sk89q.worldedit.math.BlockVector3; <<<<<<< EditSession editSession = session.createEditSession(player); BlockVector3 origin = clicked.toBlockPoint(); BlockType initialType = world.getBlock(origin).getBlockType(); ======= BlockVector3 origin = clicked.toVector().toBlockPoint(); BlockType initialType = world.getBlock(origin).getBlockType(); >>>>>>> EditSession editSession = session.createEditSession(player); BlockVector3 origin = clicked.toBlockPoint(); BlockType initialType = world.getBlock(origin).getBlockType(); <<<<<<< editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop); //<<<<<<< HEAD final int radius = (int) range; final BlockReplace replace = new BlockReplace(editSession, (editSession.nullBlock)); editSession.setMask((Mask) null); RecursiveVisitor visitor = new RecursiveVisitor(new IdMask(editSession), replace, radius, editSession); visitor.visit(pos); Operations.completeBlindly(visitor); editSession.flushQueue(); session.remember(editSession); //======= // try { // recurse(server, editSession, world, clicked.toBlockPoint(), // clicked.toBlockPoint(), range, initialType, new HashSet<>()); // } catch (MaxChangedBlocksException e) { // player.printError("Max blocks change limit reached."); // } finally { // session.remember(editSession); // } // } //>>>>>>> 399e0ad5... Refactor vector system to be cleaner ======= try (EditSession editSession = session.createEditSession(player)) { editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop); try { recurse(server, editSession, world, clicked.toVector().toBlockPoint(), clicked.toVector().toBlockPoint(), range, initialType, new HashSet<>()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { session.remember(editSession); } } >>>>>>> editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop); final int radius = (int) range; final BlockReplace replace = new BlockReplace(editSession, (editSession.nullBlock)); editSession.setMask((Mask) null); RecursiveVisitor visitor = new RecursiveVisitor(new IdMask(editSession), replace, radius, editSession); visitor.visit(pos); Operations.completeBlindly(visitor); editSession.flushQueue(); session.remember(editSession);
<<<<<<< import static com.google.common.base.Preconditions.checkNotNull; ======= import com.boydti.fawe.beta.FilterBlock; >>>>>>> import static com.google.common.base.Preconditions.checkNotNull; <<<<<<< private BlockState blockState; @Nullable protected CompoundTag nbtData; ======= private final BlockState blockState; private final CompoundTag nbtData; >>>>>>> private final BlockState blockState; private final CompoundTag nbtData; <<<<<<< /** * Gets a map of state to statevalue * * @return The state map */ @Override public Map<Property<?>, Object> getStates() { return toImmutableState().getStates(); } @Override public BlockType getBlockType() { return this.blockState.getBlockType(); } @Override public <V> BaseBlock with(Property<V> property, V value) { return toImmutableState().with(property, value).toBaseBlock(getNbtData()); } /** * Gets the State for this Block. * * @param property The state to get the value for * @return The state value */ @Override public <V> V getState(Property<V> property) { return toImmutableState().getState(property); } @Override public boolean hasNbtData() { return getNbtData() != null; } @Override public String getNbtId() { CompoundTag nbtData = getNbtData(); if (nbtData == null) { return ""; } Tag idTag = nbtData.getValue().get("id"); if (idTag instanceof StringTag) { return ((StringTag) idTag).getValue(); } else { return ""; } } ======= >>>>>>> /** * Gets a map of state to statevalue * * @return The state map */ @Override public Map<Property<?>, Object> getStates() { return toImmutableState().getStates(); } @Override public BlockType getBlockType() { return this.blockState.getBlockType(); } @Override public <V> BaseBlock with(Property<V> property, V value) { return toImmutableState().with(property, value).toBaseBlock(getNbtData()); } /** * Gets the State for this Block. * * @param property The state to get the value for * @return The state value */ @Override public <V> V getState(Property<V> property) { return toImmutableState().getState(property); } @Override public boolean hasNbtData() { return getNbtData() != null; } @Override public String getNbtId() { CompoundTag nbtData = getNbtData(); if (nbtData == null) { return ""; } Tag idTag = nbtData.getValue().get("id"); if (idTag instanceof StringTag) { return ((StringTag) idTag).getValue(); } else { return ""; } } <<<<<<< public BlockState toImmutableState() { return this.blockState; ======= public final int getOrdinal() { return blockState.getOrdinal(); >>>>>>> public BlockState toImmutableState() { return this.blockState; <<<<<<< @Override ======= @Override public boolean hasNbtData() { return this.nbtData != null; } @Override >>>>>>> @Override
<<<<<<< @SuppressWarnings("deprecation") public int makeCuboidFaces(final Region region, final BaseBlock block) { return this.makeCuboidFaces(region, (Pattern) (block)); ======= public int makeCuboidFaces(Region region, BlockStateHolder block) throws MaxChangedBlocksException { return makeCuboidFaces(region, new BlockPattern(block)); >>>>>>> @SuppressWarnings("deprecation") public int makeCuboidFaces(final Region region, final BlockStateHolder block) { return this.makeCuboidFaces(region, (Pattern) (block)); <<<<<<< @SuppressWarnings("deprecation") public int makeCuboidWalls(final Region region, final BaseBlock block) { return this.makeCuboidWalls(region, (Pattern) (block)); ======= public int makeCuboidWalls(Region region, BlockStateHolder block) throws MaxChangedBlocksException { return makeCuboidWalls(region, new BlockPattern(block)); >>>>>>> @SuppressWarnings("deprecation") public int makeCuboidWalls(final Region region, final BlockStateHolder block) { return this.makeCuboidWalls(region, (Pattern) (block)); <<<<<<< @SuppressWarnings("deprecation") public int overlayCuboidBlocks(final Region region, final BaseBlock block) { ======= public int overlayCuboidBlocks(Region region, BlockStateHolder block) throws MaxChangedBlocksException { >>>>>>> public int overlayCuboidBlocks(Region region, BlockStateHolder block) throws MaxChangedBlocksException { <<<<<<< public int moveCuboidRegion(final Region region, final Vector dir, final int distance, final boolean copyAir, final BaseBlock replacement) { return this.moveRegion(region, dir, distance, copyAir, replacement); ======= public int moveCuboidRegion(Region region, Vector dir, int distance, boolean copyAir, BlockStateHolder replacement) throws MaxChangedBlocksException { return moveRegion(region, dir, distance, copyAir, replacement); >>>>>>> public int moveCuboidRegion(final Region region, final Vector dir, final int distance, final boolean copyAir, final BlockStateHolder replacement) { return this.moveRegion(region, dir, distance, copyAir, replacement);
<<<<<<< import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; import com.boydti.fawe.config.BBC; ======= >>>>>>> import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; import com.boydti.fawe.config.BBC; <<<<<<< import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; import com.sk89q.worldedit.command.util.Logging; ======= import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; import com.sk89q.worldedit.command.util.Logging; import com.sk89q.worldedit.command.util.WorldEditAsyncCommandBuilder; >>>>>>> import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.WorldEditAsyncCommandBuilder; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; import com.sk89q.worldedit.command.util.Logging; <<<<<<< ======= import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; >>>>>>> <<<<<<< import java.util.stream.Collectors; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; ======= import java.util.stream.Collectors; import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; >>>>>>> import java.util.stream.Collectors; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; <<<<<<< public void biomeList(Actor actor, @ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) { BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); PaginationBox paginationBox = PaginationBox.fromStrings("Available Biomes", "/biomelist -p %page%", BiomeType.REGISTRY.values().stream() .map(biomeType -> { String id = biomeType.getId(); final BiomeData data = biomeRegistry.getData(biomeType); if (data != null) { String name = data.getName(); return id + " (" + name + ")"; } else { return id; } }) .collect(Collectors.toList())); actor.print(paginationBox.create(page)); ======= public void biomeList(Actor actor, @ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) { WorldEditAsyncCommandBuilder.createAndSendMessage(actor, () -> { BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); PaginationBox paginationBox = PaginationBox.fromStrings("Available Biomes", "/biomelist -p %page%", BiomeType.REGISTRY.values().stream() .map(biomeType -> { String id = biomeType.getId(); final BiomeData data = biomeRegistry.getData(biomeType); if (data != null) { String name = data.getName(); return id + " (" + name + ")"; } else { return id; } }) .collect(Collectors.toList())); return paginationBox.create(page); }, null); >>>>>>> public void biomeList(Actor actor, @ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) { WorldEditAsyncCommandBuilder.createAndSendMessage(actor, () -> { BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); PaginationBox paginationBox = PaginationBox.fromStrings("Available Biomes", "/biomelist -p %page%", BiomeType.REGISTRY.values().stream() .map(biomeType -> { String id = biomeType.getId(); final BiomeData data = biomeRegistry.getData(biomeType); if (data != null) { String name = data.getName(); return id + " (" + name + ")"; } else { return id; } }) .collect(Collectors.toList())); return paginationBox.create(page); }, null); <<<<<<< } else if (usePosition) { BiomeType biome = player.getWorld().getBiome(player.getLocation().toBlockPoint().toBlockVector2()); ======= } else if (usePosition) { BiomeType biome = player.getWorld().getBiome(player.getLocation().toVector().toBlockPoint().toBlockVector2()); >>>>>>> } else if (usePosition) { BiomeType biome = player.getWorld().getBiome(player.getLocation().toBlockPoint().toBlockVector2());
<<<<<<< import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector3; ======= import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.Vector; >>>>>>> import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.Vector; <<<<<<< import static com.google.common.base.Preconditions.checkNotNull; public class RegionIterator implements Iterator<BlockVector3> { ======= public class RegionIterator implements Iterator<BlockVector> { >>>>>>> public class RegionIterator implements Iterator<BlockVector3> {
<<<<<<< import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_EVENT; ======= import org.joda.time.Period; >>>>>>> <<<<<<< Set<TimelineEvent> addArtifactEvents(BlackboardArtifact artifact) throws TskCoreException { Set<TimelineEvent> newEvents = new HashSet<>(); ======= Set<SingleEvent> addEventsFromArtifact(BlackboardArtifact artifact) throws TskCoreException { Set<SingleEvent> newEvents = new HashSet<>(); >>>>>>> Set<TimelineEvent> addEventsFromArtifact(BlackboardArtifact artifact) throws TskCoreException { Set<TimelineEvent> newEvents = new HashSet<>(); <<<<<<< private Optional<TimelineEvent> addArtifactEvent(ArtifactEventType eventType, BlackboardArtifact artifact) throws TskCoreException { ArtifactEventType.AttributeEventDescription eventDescription = eventType.buildEventDescription(artifact); ======= private Optional<SingleEvent> addArtifactEvent(ArtifactEventType eventType, BlackboardArtifact artifact) throws TskCoreException { return addArtifactEvent(eventType::buildEventPayload, eventType, artifact); } /** * Add an event of the given type from the given artifact. This version of * addArtifactEvent allows a non standard description for the given event * type. * * @param payloadExtractor A Function that will create the decsription based * on the artifact. This allows the description to * be built based on an event type (usually OTHER) * different to the event type of the event. * @param eventType The event type to create. * @param artifact The artifact to create the event from. * * @return The created event, wrapped in an Optional, or an empty Optional * if no event was created. * * @throws TskCoreException */ private Optional<SingleEvent> addArtifactEvent(CheckedFunction<BlackboardArtifact, ArtifactEventType.EventPayload> payloadExtractor, EventType eventType, BlackboardArtifact artifact) throws TskCoreException { ArtifactEventType.EventPayload eventDescription = payloadExtractor.apply(artifact); >>>>>>> private Optional<TimelineEvent> addArtifactEvent(ArtifactEventType eventType, BlackboardArtifact artifact) throws TskCoreException { return addArtifactEvent(eventType::buildEventPayload, eventType, artifact); } /** * Add an event of the given type from the given artifact. This version of * addArtifactEvent allows a non standard description for the given event * type. * * @param payloadExtractor A Function that will create the decsription based * on the artifact. This allows the description to * be built based on an event type (usually OTHER) * different to the event type of the event. * @param eventType The event type to create. * @param artifact The artifact to create the event from. * * @return The created event, wrapped in an Optional, or an empty Optional * if no event was created. * * @throws TskCoreException */ private Optional<TimelineEvent> addArtifactEvent(CheckedFunction<BlackboardArtifact, ArtifactEventType.EventPayload> payloadExtractor, EventType eventType, BlackboardArtifact artifact) throws TskCoreException { ArtifactEventType.EventPayload eventDescription = payloadExtractor.apply(artifact);
<<<<<<< /** * This method allows developers to run arbitrary SQL queries, including * INSERT and UPDATE. The CaseDbQuery object will take care of acquiring the * necessary database lock and when used in a try-with-resources block will * automatically take care of releasing the lock. If you do not use a * try-with-resources block you must call CaseDbQuery.close() once you are * done processing the files of the query. * * Also note that if you use it within a transaction to insert something * into the database, and then within that same transaction query the * inserted item from the database, you will likely not see your inserted * item, as the method uses new connections for each execution. With this * method, you must close your transaction before successfully querying for * newly-inserted items. * * @param query The query string to execute. * * @return A CaseDbQuery instance. * * @throws TskCoreException */ public CaseDbQuery executeInsertOrUpdate(String query) throws TskCoreException { return new CaseDbQuery(query, true); } ======= /** * Get a case database connection. * * @return The case database connection. * * @throws TskCoreException */ CaseDbConnection getConnection() throws TskCoreException { return connections.getConnection(); } >>>>>>> /** * This method allows developers to run arbitrary SQL queries, including * INSERT and UPDATE. The CaseDbQuery object will take care of acquiring the * necessary database lock and when used in a try-with-resources block will * automatically take care of releasing the lock. If you do not use a * try-with-resources block you must call CaseDbQuery.close() once you are * done processing the files of the query. * * Also note that if you use it within a transaction to insert something * into the database, and then within that same transaction query the * inserted item from the database, you will likely not see your inserted * item, as the method uses new connections for each execution. With this * method, you must close your transaction before successfully querying for * newly-inserted items. * * @param query The query string to execute. * * @return A CaseDbQuery instance. * * @throws TskCoreException */ public CaseDbQuery executeInsertOrUpdate(String query) throws TskCoreException { return new CaseDbQuery(query, true); } /** * Get a case database connection. * * @return The case database connection. * * @throws TskCoreException */ CaseDbConnection getConnection() throws TskCoreException { return connections.getConnection(); }
<<<<<<< private OsAccountManager osAccountManager; ======= private HostManager hostManager; >>>>>>> private HostManager hostManager; private OsAccountManager osAccountManager; <<<<<<< osAccountManager = new OsAccountManager(this); ======= hostManager = new HostManager(this); >>>>>>> hostManager = new HostManager(this); osAccountManager = new OsAccountManager(this); <<<<<<< * Gets the OS account manager for this case. * * @return The per case OsAccountManager object. * * @throws TskCoreException */ public OsAccountManager getOsAccountManager() throws TskCoreException { return osAccountManager; } /** ======= * Gets the host manager for this case. * * @return The per case HostManager object. * * @throws org.sleuthkit.datamodel.TskCoreException */ public HostManager getHostManager() throws TskCoreException { return hostManager; } /** >>>>>>> * Gets the host manager for this case. * * @return The per case HostManager object. * * @throws org.sleuthkit.datamodel.TskCoreException */ public HostManager getHostManager() throws TskCoreException { return hostManager; } /** * Gets the OS account manager for this case. * * @return The per case OsAccountManager object. * * @throws TskCoreException */ public OsAccountManager getOsAccountManager() throws TskCoreException { return osAccountManager; } /**
<<<<<<< * Initialize the next artifact id. If there are entries in the * blackboard_artifacts table we will use max(artifact_id) + 1 otherwise we * will initialize the value to 0x8000000000000000 (the maximum negative * signed long). * ======= * Initialize the next artifact id. If there are entries in the * blackboard_artifacts table we will use max(artifact_id) + 1 * otherwise we will initialize the value to 0x8000000000000000 * (the maximum negative signed long). >>>>>>> * Initialize the next artifact id. If there are entries in the * blackboard_artifacts table we will use max(artifact_id) + 1 * otherwise we will initialize the value to 0x8000000000000000 * (the maximum negative signed long). * <<<<<<< connection.close(); } ======= } >>>>>>> connection.close(); } <<<<<<< /** * A class for the connection pool. This class will hand out connections of * the appropriate type based on the subclass that is calling * getPooledConnection(); */ abstract private static class ConnectionPool { private PooledDataSource pooledDataSource; ======= private final class ConnectionPerThreadDispenser extends ThreadLocal<CaseDbConnection> { private final HashSet<CaseDbConnection> databaseConnections = new HashSet<CaseDbConnection>(); private boolean isClosed = false; >>>>>>> /** * A class for the connection pool. This class will hand out connections of * the appropriate type based on the subclass that is calling * getPooledConnection(); */ abstract private static class ConnectionPool { private PooledDataSource pooledDataSource; <<<<<<< try { return getPooledConnection(); } catch (SQLException exp) { throw new TskCoreException(exp.getMessage()); ======= CaseDbConnection connection = get(); if (!connection.isOpen()) { throw new TskCoreException("Case database connection for current thread is not open"); >>>>>>> try { return getPooledConnection(); } catch (SQLException exp) { throw new TskCoreException(exp.getMessage()); <<<<<<< CaseDbConnection(Connection connection) { this.connection = connection; preparedStatements = new EnumMap<PREPARED_STATEMENT, PreparedStatement>(PREPARED_STATEMENT.class); ======= CaseDbConnection(String dbPath) { this.preparedStatements = new EnumMap<PREPARED_STATEMENT, PreparedStatement>(PREPARED_STATEMENT.class); Statement statement = null; try { SQLiteConfig config = new SQLiteConfig(); // Reduce I/O operations, we have no OS crash recovery anyway. config.setSynchronous(SQLiteConfig.SynchronousMode.OFF); // The original comment for "read_uncommited" indicating that it // was being set to "allow query while in transaction". I don't fully // understand why this is needed since all it does it expose dirty writes // within one transaction to other queries. There was also the suggestion // that it may have helped to increase performance. config.setReadUncommited(true); // Enforce foreign key constraints. config.enforceForeignKeys(true); this.connection = DriverManager.getConnection("jdbc:sqlite:" + dbPath, config.toProperties()); //NON-NLS } catch (SQLException ex) { // The exception is caught and logged here because this // constructor will be called by an override of // ThreadLocal<T>.initialValue() which cannot throw. Calls to // ConnectionPerThreadDispenser.getConnection() will detect // the error state via isOpen() and throw an appropriate // exception. SleuthkitCase.logger.log(Level.SEVERE, "Error setting up case database connection for thread", ex); //NON-NLS if (this.connection != null) { try { this.connection.close(); } catch (SQLException e) { SleuthkitCase.logger.log(Level.SEVERE, "Failed to close connection", e); } this.connection = null; } } >>>>>>> CaseDbConnection(Connection connection) { this.connection = connection; preparedStatements = new EnumMap<PREPARED_STATEMENT, PreparedStatement>(PREPARED_STATEMENT.class); <<<<<<< * The CaseDbQuery supports the use case where developers have a need for * data that is not exposed through the SleuthkitCase API. A CaseDbQuery * instance gets created through the SleuthkitCase executeDbQuery() method. * It wraps the ResultSet and takes care of acquiring and releasing the * appropriate database lock. It implements AutoCloseable so that it can be * used in a try-with -resources block freeing developers from having to * remember to close the result set and releasing the lock. * ======= * The CaseDbQuery supports the use case where developers have a * need for data that is not exposed through the SleuthkitCase API. * A CaseDbQuery instance gets created through the SleuthkitCase * executeDbQuery() method. It wraps the ResultSet and takes care * of acquiring and releasing the appropriate database lock. * It implements AutoCloseable so that it can be used in a try-with * -resources block freeing developers from having to remember to * close the result set and releasing the lock. * >>>>>>> * The CaseDbQuery supports the use case where developers have a need for * data that is not exposed through the SleuthkitCase API. A CaseDbQuery * instance gets created through the SleuthkitCase executeDbQuery() method. * It wraps the ResultSet and takes care of acquiring and releasing the * appropriate database lock. It implements AutoCloseable so that it can be * used in a try-with -resources block freeing developers from having to * remember to close the result set and releasing the lock. <<<<<<< private CaseDbConnection connection; ======= >>>>>>> private CaseDbConnection connection; <<<<<<< ======= CaseDbConnection connection; >>>>>>> <<<<<<< connection.close(); } catch (SQLException ex) { ======= SleuthkitCase.this.releaseSharedLock(); } catch (SQLException ex) { >>>>>>> connection.close(); } catch (SQLException ex) {
<<<<<<< ======= private void initStatements() throws SQLException { getBlackboardAttributesSt = con.prepareStatement( "SELECT artifact_id, source, context, attribute_type_id, value_type, " + "value_byte, value_text, value_int32, value_int64, value_double " + "FROM blackboard_attributes WHERE artifact_id = ?"); getBlackboardArtifactSt = con.prepareStatement( "SELECT obj_id, artifact_type_id FROM blackboard_artifacts WHERE artifact_id = ?"); getBlackboardArtifactsSt = con.prepareStatement( "SELECT artifact_id, obj_id FROM blackboard_artifacts " + "WHERE artifact_type_id = ?"); getBlackboardArtifactsTypeCountSt = con.prepareStatement( "SELECT COUNT(*) FROM blackboard_artifacts WHERE artifact_type_id = ?"); getBlackboardArtifactsContentCountSt = con.prepareStatement( "SELECT COUNT(*) FROM blackboard_artifacts WHERE obj_id = ?"); getArtifactsHelper1St = con.prepareStatement( "SELECT artifact_id FROM blackboard_artifacts WHERE obj_id = ? AND artifact_type_id = ?"); getArtifactsHelper2St = con.prepareStatement( "SELECT artifact_id, obj_id FROM blackboard_artifacts WHERE artifact_type_id = ?"); getArtifactsCountHelperSt = con.prepareStatement( "SELECT COUNT(*) FROM blackboard_artifacts WHERE obj_id = ? AND artifact_type_id = ?"); getAbstractFileChildren = con.prepareStatement( "SELECT tsk_files.* FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id WHERE (tsk_objects.par_obj_id = ? ) ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); getAbstractFileChildrenByType = con.prepareStatement( "SELECT tsk_files.* " + "FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id " + "WHERE (tsk_objects.par_obj_id = ? " + "AND tsk_files.type = ? ) ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); getAbstractFileChildrenIds = con.prepareStatement( "SELECT tsk_files.obj_id FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id WHERE (tsk_objects.par_obj_id = ?)"); getAbstractFileChildrenIdsByType = con.prepareStatement( "SELECT tsk_files.obj_id " + "FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id " + "WHERE (tsk_objects.par_obj_id = ? " + "AND tsk_files.type = ? )"); getAbstractFileById = con.prepareStatement("SELECT * FROM tsk_files WHERE obj_id = ? LIMIT 1"); addArtifactSt1 = con.prepareStatement( "INSERT INTO blackboard_artifacts (artifact_id, obj_id, artifact_type_id) " + "VALUES (NULL, ?, ?)"); getLastArtifactId = con.prepareStatement( "SELECT MAX(artifact_id) from blackboard_artifacts " + "WHERE obj_id = ? AND + artifact_type_id = ?"); addBlackboardAttributeStringSt = con.prepareStatement( "INSERT INTO blackboard_attributes (artifact_id, artifact_type_id, source, context, attribute_type_id, value_type, value_text) " + "VALUES (?,?,?,?,?,?,?)"); addBlackboardAttributeByteSt = con.prepareStatement( "INSERT INTO blackboard_attributes (artifact_id, artifact_type_id, source, context, attribute_type_id, value_type, value_byte) " + "VALUES (?,?,?,?,?,?,?)"); addBlackboardAttributeIntegerSt = con.prepareStatement( "INSERT INTO blackboard_attributes (artifact_id, artifact_type_id, source, context, attribute_type_id, value_type, value_int32) " + "VALUES (?,?,?,?,?,?,?)"); addBlackboardAttributeLongSt = con.prepareStatement( "INSERT INTO blackboard_attributes (artifact_id, artifact_type_id, source, context, attribute_type_id, value_type, value_int64) " + "VALUES (?,?,?,?,?,?,?)"); addBlackboardAttributeDoubleSt = con.prepareStatement( "INSERT INTO blackboard_attributes (artifact_id, artifact_type_id, source, context, attribute_type_id, value_type, value_double) " + "VALUES (?,?,?,?,?,?,?)"); getFileSt = con.prepareStatement("SELECT * FROM tsk_files WHERE LOWER(name) LIKE ? and LOWER(name) NOT LIKE '%journal%' AND fs_obj_id = ?"); getFileWithParentSt = con.prepareStatement("SELECT * FROM tsk_files WHERE LOWER(name) LIKE ? AND LOWER(name) NOT LIKE '%journal%' AND LOWER(parent_path) LIKE ? AND fs_obj_id = ?"); updateMd5St = con.prepareStatement("UPDATE tsk_files SET md5 = ? WHERE obj_id = ?"); getPathSt = con.prepareStatement("SELECT path FROM tsk_files_path WHERE obj_id = ?"); getFileParentPathSt = con.prepareStatement("SELECT parent_path FROM tsk_files WHERE obj_id = ?"); getFileNameSt = con.prepareStatement("SELECT name FROM tsk_files WHERE obj_id = ?"); getDerivedInfoSt = con.prepareStatement("SELECT derived_id, rederive FROM tsk_files_derived WHERE obj_id = ?"); getDerivedMethodSt = con.prepareStatement("SELECT tool_name, tool_version, other FROM tsk_files_derived_method WHERE derived_id = ?"); getLastContentIdSt = con.prepareStatement( "SELECT MAX(obj_id) from tsk_objects"); addObjectSt = con.prepareStatement( "INSERT INTO tsk_objects (obj_id, par_obj_id, type) VALUES (?, ?, ?)"); addFileSt = con.prepareStatement( "INSERT INTO tsk_files (obj_id, fs_obj_id, name, type, has_path, dir_type, meta_type, dir_flags, meta_flags, size, ctime, crtime, atime, mtime, parent_path) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); addLayoutFileSt = con.prepareStatement( "INSERT INTO tsk_file_layout (obj_id, byte_start, byte_len, sequence) " + "VALUES (?, ?, ?, ?)"); addPathSt = con.prepareStatement( "INSERT INTO tsk_files_path (obj_id, path) VALUES (?, ?)"); countChildrenSt = con.prepareStatement( "SELECT COUNT(obj_id) FROM tsk_objects WHERE par_obj_id = ?"); getFsIdForFileIdSt = con.prepareStatement( "SELECT fs_obj_id from tsk_files WHERE obj_id=?"); selectAllFromTagNames = con.prepareStatement("SELECT * FROM tag_names"); selectFromTagNamesWhereInUse = con.prepareStatement("SELECT * FROM tag_names WHERE tag_name_id IN (SELECT tag_name_id from content_tags UNION SELECT tag_name_id FROM blackboard_artifact_tags)"); insertIntoTagNames = con.prepareStatement("INSERT INTO tag_names (display_name, description, color) VALUES (?, ?, ?)"); selectMaxIdFromTagNames = con.prepareStatement("SELECT MAX(tag_name_id) FROM tag_names"); insertIntoContentTags = con.prepareStatement("INSERT INTO content_tags (obj_id, tag_name_id, comment, begin_byte_offset, end_byte_offset) VALUES (?, ?, ?, ?, ?)"); selectMaxIdFromContentTags = con.prepareStatement("SELECT MAX(tag_id) FROM content_tags"); deleteFromContentTags = con.prepareStatement("DELETE FROM content_tags WHERE tag_id = ?"); selectContentTagsCountByTagName = con.prepareStatement("SELECT COUNT(*) FROM content_tags WHERE tag_name_id = ?"); selectAllContentTags = con.prepareStatement("SELECT * FROM content_tags INNER JOIN tag_names ON content_tags.tag_name_id = tag_names.tag_name_id"); selectContentTagsByTagName = con.prepareStatement("SELECT * FROM content_tags WHERE tag_name_id = ?"); selectContentTagsByContent = con.prepareStatement("SELECT * FROM content_tags INNER JOIN tag_names ON content_tags.tag_name_id = tag_names.tag_name_id WHERE content_tags.obj_id = ?"); insertIntoBlackboardArtifactTags = con.prepareStatement("INSERT INTO blackboard_artifact_tags (artifact_id, tag_name_id, comment) VALUES (?, ?, ?)"); selectMaxIdFromBlackboardArtifactTags = con.prepareStatement("SELECT MAX(tag_id) FROM blackboard_artifact_tags"); deleteFromBlackboardArtifactTags = con.prepareStatement("DELETE FROM blackboard_artifact_tags WHERE tag_id = ?"); selectAllBlackboardArtifactTags = con.prepareStatement("SELECT * FROM blackboard_artifact_tags INNER JOIN tag_names ON blackboard_artifact_tags.tag_name_id = tag_names.tag_name_id"); selectBlackboardArtifactTagsByTagName = con.prepareStatement("SELECT * FROM blackboard_artifact_tags WHERE tag_name_id = ?"); selectBlackboardArtifactTagsByArtifact = con.prepareStatement("SELECT * FROM blackboard_artifact_tags INNER JOIN tag_names ON blackboard_artifact_tags.tag_name_id = tag_names.tag_name_id WHERE blackboard_artifact_tags.artifact_id = ?"); selectBlackboardArtifactTagsCountByTagName = con.prepareStatement("SELECT COUNT(*) FROM blackboard_artifact_tags WHERE tag_name_id = ?");; selectAllFromReports = con.prepareStatement("SELECT * FROM reports"); selectMaxIdFromReports = con.prepareStatement("SELECT MAX(report_id) FROM reports"); insertIntoReports = con.prepareStatement("INSERT INTO reports (path, crtime, src_module_name, report_name) VALUES (?, ?, ?, ?)"); } private void closeStatements() { closeStatement(getBlackboardAttributesSt); closeStatement(getBlackboardArtifactSt); closeStatement(getBlackboardArtifactsSt); closeStatement(getBlackboardArtifactsTypeCountSt); closeStatement(getBlackboardArtifactsContentCountSt); closeStatement(getArtifactsHelper1St); closeStatement(getArtifactsHelper2St); closeStatement(getArtifactsCountHelperSt); closeStatement(getAbstractFileChildren); closeStatement(getAbstractFileChildrenByType); closeStatement(getAbstractFileChildrenIds); closeStatement(getAbstractFileChildrenIdsByType); closeStatement(getAbstractFileById); closeStatement(addArtifactSt1); closeStatement(getLastArtifactId); closeStatement(addBlackboardAttributeStringSt); closeStatement(addBlackboardAttributeByteSt); closeStatement(addBlackboardAttributeIntegerSt); closeStatement(addBlackboardAttributeLongSt); closeStatement(addBlackboardAttributeDoubleSt); closeStatement(getFileSt); closeStatement(getFileWithParentSt); closeStatement(getPathSt); closeStatement(getFileNameSt); closeStatement(updateMd5St); closeStatement(getLastContentIdSt); closeStatement(getFileParentPathSt); closeStatement(getDerivedInfoSt); closeStatement(getDerivedMethodSt); closeStatement(addObjectSt); closeStatement(addFileSt); closeStatement(addLayoutFileSt); closeStatement(addPathSt); closeStatement(countChildrenSt); closeStatement(getFsIdForFileIdSt); closeStatement(selectAllFromTagNames); closeStatement(selectFromTagNamesWhereInUse); closeStatement(insertIntoTagNames); closeStatement(selectMaxIdFromTagNames); closeStatement(insertIntoContentTags); closeStatement(selectMaxIdFromContentTags); closeStatement(deleteFromContentTags); closeStatement(selectContentTagsCountByTagName); closeStatement(selectAllContentTags); closeStatement(selectContentTagsByTagName); closeStatement(selectContentTagsByContent); closeStatement(insertIntoBlackboardArtifactTags); closeStatement(selectMaxIdFromBlackboardArtifactTags); closeStatement(deleteFromBlackboardArtifactTags); closeStatement(selectAllBlackboardArtifactTags); closeStatement(selectBlackboardArtifactTagsCountByTagName); closeStatement(selectBlackboardArtifactTagsByTagName); closeStatement(selectBlackboardArtifactTagsByArtifact); closeStatement(selectAllFromReports); closeStatement(selectMaxIdFromReports); closeStatement(insertIntoReports); } private void closeStatement(PreparedStatement statement) { try { if (statement != null) { statement.close(); statement = null; } } catch (SQLException ex) { logger.log(Level.WARNING, "Error closing prepared statement", ex); } } >>>>>>> <<<<<<< releaseExclusiveLock(); } } private void addBlackBoardAttribute(BlackboardAttribute attr, CaseDbConnection connection) throws SQLException, TskCoreException { PreparedStatement statement; switch (attr.getValueType()) { case STRING: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_STRING_ATTRIBUTE); statement.clearParameters(); statement.setString(6, escapeForBlackboard(attr.getValueString())); break; case BYTE: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_BYTE_ATTRIBUTE); statement.clearParameters(); statement.setBytes(6, attr.getValueBytes()); break; case INTEGER: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_INT_ATTRIBUTE); statement.clearParameters(); statement.setInt(6, attr.getValueInt()); break; case LONG: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_LONG_ATTRIBUTE); statement.clearParameters(); statement.setLong(6, attr.getValueLong()); break; case DOUBLE: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_DOUBLE_ATTRIBUTE); statement.clearParameters(); statement.setDouble(6, attr.getValueDouble()); break; default: throw new TskCoreException("Unrecognized attribute vaslue type."); } statement.setLong(1, attr.getArtifactID()); statement.setString(2, attr.getModuleName()); statement.setString(3, attr.getContext()); statement.setInt(4, attr.getAttributeTypeID()); statement.setLong(5, attr.getValueType().getType()); connection.executeUpdate(statement); ======= try { con.setAutoCommit(true); } catch (SQLException ex) { throw new TskCoreException("Error setting autocommit and closing the transaction", ex); } finally { dbWriteUnlock(); } } >>>>>>> releaseExclusiveLock(); } } private void addBlackBoardAttribute(BlackboardAttribute attr, int artifactTypeId, CaseDbConnection connection) throws SQLException, TskCoreException { PreparedStatement statement; switch (attr.getValueType()) { case STRING: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_STRING_ATTRIBUTE); statement.clearParameters(); statement.setString(7, escapeForBlackboard(attr.getValueString())); break; case BYTE: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_BYTE_ATTRIBUTE); statement.clearParameters(); statement.setBytes(7, attr.getValueBytes()); break; case INTEGER: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_INT_ATTRIBUTE); statement.clearParameters(); statement.setInt(7, attr.getValueInt()); break; case LONG: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_LONG_ATTRIBUTE); statement.clearParameters(); statement.setLong(7, attr.getValueLong()); break; case DOUBLE: statement = connection.getPreparedStatement(CaseDbConnection.PREPARED_STATEMENT.INSERT_DOUBLE_ATTRIBUTE); statement.clearParameters(); statement.setDouble(7, attr.getValueDouble()); break; default: throw new TskCoreException("Unrecognized attribute vaslue type."); } statement.setLong(1, attr.getArtifactID()); statement.setInt(2, artifactTypeId); statement.setString(3, attr.getModuleName()); statement.setString(4, attr.getContext()); statement.setInt(5, attr.getAttributeTypeID()); statement.setLong(6, attr.getValueType().getType()); connection.executeUpdate(statement);
<<<<<<< statement.execute("ALTER TABLE tsk_image_info ADD COLUMN size INTEGER;"); //NON-NLS statement.execute("ALTER TABLE tsk_image_info ADD COLUMN md5 TEXT;"); //NON-NLS statement.execute("ALTER TABLE tsk_image_info ADD COLUMN description TEXT;"); //NON-NLS statement.execute("ALTER TABLE tsk_fs_info ADD COLUMN display_name TEXT;"); //NON-NLS ======= statement.execute("ALTER TABLE tsk_image_info ADD COLUMN size INTEGER;"); statement.execute("ALTER TABLE tsk_image_info ADD COLUMN md5 TEXT;"); statement.execute("ALTER TABLE tsk_image_info ADD COLUMN display_name TEXT;"); statement.execute("ALTER TABLE tsk_fs_info ADD COLUMN display_name TEXT;"); statement.execute("ALTER TABLE tsk_files ADD COLUMN meta_seq INTEGER;"); >>>>>>> statement.execute("ALTER TABLE tsk_image_info ADD COLUMN size INTEGER;"); //NON-NLS statement.execute("ALTER TABLE tsk_image_info ADD COLUMN md5 TEXT;"); //NON-NLS statement.execute("ALTER TABLE tsk_image_info ADD COLUMN display_name TEXT;"); //NON-NLS statement.execute("ALTER TABLE tsk_fs_info ADD COLUMN display_name TEXT;"); //NON-NLS statement.execute("ALTER TABLE tsk_files ADD COLUMN meta_seq INTEGER;"); //NON-NLS <<<<<<< "SELECT tsk_files.* " //NON-NLS + "FROM tsk_objects JOIN tsk_files " //NON-NLS + "ON tsk_objects.obj_id=tsk_files.obj_id " //NON-NLS + "WHERE (tsk_objects.par_obj_id = ? " //NON-NLS + "AND tsk_files.type = ? )"); //NON-NLS ======= "SELECT tsk_files.* FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id WHERE (tsk_objects.par_obj_id = ? ) ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); getAbstractFileChildrenByType = con.prepareStatement( "SELECT tsk_files.* " + "FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id " + "WHERE (tsk_objects.par_obj_id = ? " + "AND tsk_files.type = ? ) ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); >>>>>>> "SELECT tsk_files.* FROM tsk_objects INNER JOIN tsk_files " //NON-NLS + "ON tsk_objects.obj_id=tsk_files.obj_id WHERE (tsk_objects.par_obj_id = ? ) ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); //NON-NLS getAbstractFileChildrenByType = con.prepareStatement( "SELECT tsk_files.* " //NON-NLS + "FROM tsk_objects INNER JOIN tsk_files " //NON-NLS + "ON tsk_objects.obj_id=tsk_files.obj_id " //NON-NLS + "WHERE (tsk_objects.par_obj_id = ? " //NON-NLS + "AND tsk_files.type = ? ) ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); //NON-NLS <<<<<<< "SELECT tsk_files.obj_id " //NON-NLS + "FROM tsk_objects JOIN tsk_files " //NON-NLS + "ON tsk_objects.obj_id=tsk_files.obj_id " //NON-NLS + "WHERE (tsk_objects.par_obj_id = ? " //NON-NLS + "AND tsk_files.type = ? )"); //NON-NLS ======= "SELECT tsk_files.obj_id FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id WHERE (tsk_objects.par_obj_id = ?)"); getAbstractFileChildrenIdsByType = con.prepareStatement( "SELECT tsk_files.obj_id " + "FROM tsk_objects INNER JOIN tsk_files " + "ON tsk_objects.obj_id=tsk_files.obj_id " + "WHERE (tsk_objects.par_obj_id = ? " + "AND tsk_files.type = ? )"); >>>>>>> "SELECT tsk_files.obj_id FROM tsk_objects INNER JOIN tsk_files " //NON-NLS + "ON tsk_objects.obj_id=tsk_files.obj_id WHERE (tsk_objects.par_obj_id = ?)"); //NON-NLS getAbstractFileChildrenIdsByType = con.prepareStatement( "SELECT tsk_files.obj_id " //NON-NLS + "FROM tsk_objects INNER JOIN tsk_files " //NON-NLS + "ON tsk_objects.obj_id=tsk_files.obj_id " //NON-NLS + "WHERE (tsk_objects.par_obj_id = ? " //NON-NLS + "AND tsk_files.type = ? )"); //NON-NLS <<<<<<< hasChildrenSt = con.prepareStatement( "SELECT COUNT(obj_id) FROM tsk_objects WHERE par_obj_id = ?"); //NON-NLS ======= countChildrenSt = con.prepareStatement( "SELECT COUNT(obj_id) FROM tsk_objects WHERE par_obj_id = ?"); >>>>>>> countChildrenSt = con.prepareStatement( "SELECT COUNT(obj_id) FROM tsk_objects WHERE par_obj_id = ?"); //NON-NLS <<<<<<< selectBlackboardArtifactTagsCountByTagName = con.prepareStatement("SELECT COUNT(*) FROM blackboard_artifact_tags WHERE tag_name_id = ?"); //NON-NLS ======= selectBlackboardArtifactTagsCountByTagName = con.prepareStatement("SELECT COUNT(*) FROM blackboard_artifact_tags WHERE tag_name_id = ?");; selectAllFromReports = con.prepareStatement("SELECT * FROM reports"); selectMaxIdFromReports = con.prepareStatement("SELECT MAX(report_id) FROM reports"); insertIntoReports = con.prepareStatement("INSERT INTO reports (path, crtime, src_module_name, report_name) VALUES (?, ?, ?, ?)"); >>>>>>> selectBlackboardArtifactTagsCountByTagName = con.prepareStatement("SELECT COUNT(*) FROM blackboard_artifact_tags WHERE tag_name_id = ?"); //NON-NLS selectAllFromReports = con.prepareStatement("SELECT * FROM reports"); //NON-NLS selectMaxIdFromReports = con.prepareStatement("SELECT MAX(report_id) FROM reports"); //NON-NLS insertIntoReports = con.prepareStatement("INSERT INTO reports (path, crtime, src_module_name, report_name) VALUES (?, ?, ?, ?)"); //NON-NLS <<<<<<< Statement s = con.createStatement(); ResultSet rs; rs = s.executeQuery("SELECT attribute_type_id FROM blackboard_attribute_types WHERE type_name = '" + attrTypeString + "'"); //NON-NLS if (rs.next()) { int type = rs.getInt(1); rs.close(); s.close(); return type; } else { rs.close(); s.close(); throw new TskCoreException("No id with that name"); ======= int typeId = -1; statement = con.createStatement(); resultSet = statement.executeQuery("SELECT attribute_type_id FROM blackboard_attribute_types WHERE type_name = '" + attrTypeName + "'"); if (resultSet.next()) { typeId = resultSet.getInt(1); >>>>>>> int typeId = -1; statement = con.createStatement(); resultSet = statement.executeQuery("SELECT attribute_type_id FROM blackboard_attribute_types WHERE type_name = '" + attrTypeName + "'"); //NON-NLS if (resultSet.next()) { typeId = resultSet.getInt(1); <<<<<<< Statement s = con.createStatement(); ResultSet rs; rs = s.executeQuery("SELECT artifact_type_id FROM blackboard_artifact_types WHERE type_name = '" + artifactTypeString + "'"); //NON-NLS if (rs.next()) { int type = rs.getInt(1); rs.close(); s.close(); return type; } else { rs.close(); s.close(); throw new TskCoreException("No artifact with that name exists"); ======= int typeId = -1; statement = con.createStatement(); resultSet = statement.executeQuery("SELECT artifact_type_id FROM blackboard_artifact_types WHERE type_name = '" + artifactTypeName + "'"); if (resultSet.next()) { typeId = resultSet.getInt(1); >>>>>>> int typeId = -1; statement = con.createStatement(); resultSet = statement.executeQuery("SELECT artifact_type_id FROM blackboard_artifact_types WHERE type_name = '" + artifactTypeName + "'"); //NON-NLS if (resultSet.next()) { typeId = resultSet.getInt(1); <<<<<<< while (rs.next()) { if (type == TSK_DB_FILES_TYPE_ENUM.FS) { FsContent result; if (rs.getShort("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()) { //NON-NLS result = rsHelper.directory(rs, null); } else { result = rsHelper.file(rs, null); } children.add(result); } else if (type == TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR) { VirtualDirectory virtDir = rsHelper.virtualDirectory(rs); children.add(virtDir); } else if (type == TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS || type == TSK_DB_FILES_TYPE_ENUM.CARVED) { String parentPath = rs.getString("parent_path"); //NON-NLS if (parentPath == null) { parentPath = ""; } final LayoutFile lf = new LayoutFile(this, rs.getLong("obj_id"), rs.getString("name"), //NON-NLS type, TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), //NON-NLS TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), //NON-NLS TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), //NON-NLS rs.getShort("meta_flags"), //NON-NLS rs.getLong("size"), //NON-NLS rs.getString("md5"), FileKnown.valueOf(rs.getByte("known")), parentPath); //NON-NLS children.add(lf); } else if (type == TSK_DB_FILES_TYPE_ENUM.DERIVED) { final DerivedFile df = rsHelper.derivedFile(rs, parentId); children.add(df); } else if (type == TSK_DB_FILES_TYPE_ENUM.LOCAL) { final LocalFile lf = rsHelper.localFile(rs, parentId); children.add(lf); } } ======= children = rsHelper.fileChildren(rs, parentId); >>>>>>> children = rsHelper.fileChildren(rs, parentId); <<<<<<< ResultSet rs = s.executeQuery("SELECT parent.obj_id, parent.type " //NON-NLS + "FROM tsk_objects AS parent JOIN tsk_objects AS child " //NON-NLS + "ON child.par_obj_id = parent.obj_id " //NON-NLS + "WHERE child.obj_id = " + c.getId()); //NON-NLS ======= ResultSet rs = s.executeQuery("SELECT parent.obj_id, parent.type " + "FROM tsk_objects AS parent INNER JOIN tsk_objects AS child " + "ON child.par_obj_id = parent.obj_id " + "WHERE child.obj_id = " + c.getId()); >>>>>>> ResultSet rs = s.executeQuery("SELECT parent.obj_id, parent.type " //NON-NLS + "FROM tsk_objects AS parent INNER JOIN tsk_objects AS child " //NON-NLS + "ON child.par_obj_id = parent.obj_id " //NON-NLS + "WHERE child.obj_id = " + c.getId()); //NON-NLS <<<<<<< ResultSet rs = s.executeQuery("SELECT parent.obj_id, parent.type " //NON-NLS + "FROM tsk_objects AS parent JOIN tsk_objects AS child " //NON-NLS + "ON child.par_obj_id = parent.obj_id " //NON-NLS + "WHERE child.obj_id = " + contentId); //NON-NLS ======= ResultSet rs = s.executeQuery("SELECT parent.obj_id, parent.type " + "FROM tsk_objects AS parent INNER JOIN tsk_objects AS child " + "ON child.par_obj_id = parent.obj_id " + "WHERE child.obj_id = " + contentId); >>>>>>> ResultSet rs = s.executeQuery("SELECT parent.obj_id, parent.type " //NON-NLS + "FROM tsk_objects AS parent INNER JOIN tsk_objects AS child " //NON-NLS + "ON child.par_obj_id = parent.obj_id " //NON-NLS + "WHERE child.obj_id = " + contentId); //NON-NLS <<<<<<< rs = statement.executeQuery("SELECT tsk_files.* FROM tsk_objects, tsk_files WHERE " //NON-NLS + "tsk_objects.par_obj_id IS NULL AND " //NON-NLS + "tsk_objects.type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + " AND " //NON-NLS + "tsk_objects.obj_id = tsk_files.obj_id AND " //NON-NLS + "tsk_files.type = " + TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR.getFileType()); //NON-NLS ======= rs = statement.executeQuery("SELECT tsk_files.* FROM tsk_objects, tsk_files WHERE " + "tsk_objects.par_obj_id IS NULL AND " + "tsk_objects.type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + " AND " + "tsk_objects.obj_id = tsk_files.obj_id AND " + "tsk_files.type = " + TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR.getFileType() + " ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); >>>>>>> rs = statement.executeQuery("SELECT tsk_files.* FROM tsk_objects, tsk_files WHERE " //NON-NLS + "tsk_objects.par_obj_id IS NULL AND " //NON-NLS + "tsk_objects.type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + " AND " //NON-NLS + "tsk_objects.obj_id = tsk_files.obj_id AND " //NON-NLS + "tsk_files.type = " + TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR.getFileType() //NON-NLS + " ORDER BY tsk_files.dir_type, tsk_files.name COLLATE NOCASE"); //NON-NLS <<<<<<< ResultSet rs1 = s1.executeQuery("select * from tsk_image_info"); //NON-NLS ======= ResultSet rs1 = s1.executeQuery("select obj_id from tsk_image_info"); >>>>>>> ResultSet rs1 = s1.executeQuery("select obj_id from tsk_image_info"); //NON-NLS <<<<<<< ResultSet rs = con.createStatement().executeQuery("select * from tsk_image_info"); //NON-NLS ======= ResultSet rs = con.createStatement().executeQuery("select obj_id from tsk_image_info"); >>>>>>> ResultSet rs = con.createStatement().executeQuery("select obj_id from tsk_image_info"); //NON-NLS
<<<<<<< /** * Adds a virtual directory to the database and returns a VirtualDirectory * object representing it. For use with the JNI callbacks associated with * the add image process. * * @param parentId the ID of the parent, or 0 if NULL * @param directoryName the name of the virtual directory to create * @param transaction the transaction in the scope of which the operation * is to be performed, managed by the caller * * @return The object ID of the new virtual directory * * @throws TskCoreException */ long addVirtualDirectoryJNI(long parentId, String directoryName, CaseDbTransaction transaction) throws TskCoreException { acquireSingleUserCaseWriteLock(); ResultSet resultSet = null; try { // Get the parent path. CaseDbConnection connection = transaction.getConnection(); String parentPath; Content parent = this.getAbstractFileById(parentId, connection); if (parent instanceof AbstractFile) { if (isRootDirectory((AbstractFile) parent, transaction)) { parentPath = "/"; } else { parentPath = ((AbstractFile) parent).getParentPath() + parent.getName() + "/"; //NON-NLS } } else { // The parent was either null or not an abstract file parentPath = "/"; } // Insert a row for the virtual directory into the tsk_objects table. long newObjId = addObject(parentId, TskData.ObjectType.ABSTRACTFILE.getObjectType(), connection); // Insert a row for the virtual directory into the tsk_files table. // INSERT INTO tsk_files (obj_id, fs_obj_id, name, type, has_path, dir_type, meta_type, // dir_flags, meta_flags, size, ctime, crtime, atime, mtime, md5, known, mime_type, parent_path, data_source_obj_id,extension) // VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?) PreparedStatement statement = connection.getPreparedStatement(PREPARED_STATEMENT.INSERT_FILE); statement.clearParameters(); statement.setLong(1, newObjId); // If the parent is part of a file system, grab its file system ID if (0 != parentId) { long parentFs = this.getFileSystemId(parentId, connection); if (parentFs != -1) { statement.setLong(2, parentFs); } else { statement.setNull(2, java.sql.Types.BIGINT); } } else { statement.setNull(2, java.sql.Types.BIGINT); } // name statement.setString(3, directoryName); //type statement.setShort(4, TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR.getFileType()); statement.setShort(5, (short) 1); //flags final TSK_FS_NAME_TYPE_ENUM dirType = TSK_FS_NAME_TYPE_ENUM.DIR; statement.setShort(6, dirType.getValue()); final TSK_FS_META_TYPE_ENUM metaType = TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR; statement.setShort(7, metaType.getValue()); //allocated final TSK_FS_NAME_FLAG_ENUM dirFlag = TSK_FS_NAME_FLAG_ENUM.ALLOC; statement.setShort(8, dirFlag.getValue()); final short metaFlags = (short) (TSK_FS_META_FLAG_ENUM.ALLOC.getValue() | TSK_FS_META_FLAG_ENUM.USED.getValue()); statement.setShort(9, metaFlags); //size statement.setLong(10, 0); // nulls for params 11-14 statement.setNull(11, java.sql.Types.BIGINT); statement.setNull(12, java.sql.Types.BIGINT); statement.setNull(13, java.sql.Types.BIGINT); statement.setNull(14, java.sql.Types.BIGINT); statement.setNull(15, java.sql.Types.VARCHAR); // MD5 statement.setByte(16, FileKnown.UNKNOWN.getFileKnownValue()); // Known statement.setNull(17, java.sql.Types.VARCHAR); // MIME type // parent path statement.setString(18, parentPath); // data source object id (same as object id if this is a data source) long dataSourceObjectId; if (0 == parentId) { dataSourceObjectId = newObjId; } else { dataSourceObjectId = getDataSourceObjectId(connection, parentId); } statement.setLong(19, dataSourceObjectId); //extension, since this is not really file we just set it to null statement.setString(20, null); connection.executeUpdate(statement); return newObjId; } catch (SQLException e) { throw new TskCoreException("Error creating virtual directory '" + directoryName + "'", e); } finally { closeResultSet(resultSet); releaseSingleUserCaseWriteLock(); } } ======= >>>>>>> <<<<<<< INSERT_FS_INFO("INSERT INTO tsk_fs_info (obj_id, img_offset, fs_type, block_size, block_count, root_inum, first_inum, last_inum, display_name)" + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"), SELECT_OBJ_ID_BY_META_ADDR_AND_PATH("SELECT obj_id FROM tsk_files WHERE meta_addr = ? AND fs_obj_id = ? AND parent_path = ? AND name = ?"), SELECT_TAG_NAME_BY_ID("SELECT * FROM tag_names where tag_name_id = ?"); ======= INSERT_FS_INFO("INSERT INTO tsk_fs_info (obj_id, data_source_obj_id, img_offset, fs_type, block_size, block_count, root_inum, first_inum, last_inum, display_name)" + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"), SELECT_OBJ_ID_BY_META_ADDR_AND_PATH("SELECT obj_id FROM tsk_files WHERE meta_addr = ? AND fs_obj_id = ? AND parent_path = ? AND name = ?"); >>>>>>> INSERT_FS_INFO("INSERT INTO tsk_fs_info (obj_id, data_source_obj_id, img_offset, fs_type, block_size, block_count, root_inum, first_inum, last_inum, display_name)" + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"), SELECT_OBJ_ID_BY_META_ADDR_AND_PATH("SELECT obj_id FROM tsk_files WHERE meta_addr = ? AND fs_obj_id = ? AND parent_path = ? AND name = ?"), SELECT_TAG_NAME_BY_ID("SELECT * FROM tag_names where tag_name_id = ?");
<<<<<<< @Deprecated // Use executeQuery() instead. ======= @Deprecated >>>>>>> @Deprecated <<<<<<< @Deprecated // Use executeQuery() instead. ======= @Deprecated >>>>>>> @Deprecated <<<<<<< ======= @Deprecated >>>>>>> <<<<<<< public static void addErrorObserver(ErrorObserver observer) { sleuthkitCaseErrorObservers.add(observer); ======= @Deprecated public void addErrorObserver(ErrorObserver observer) { errorObservers.add(observer); >>>>>>> public static void addErrorObserver(ErrorObserver observer) { sleuthkitCaseErrorObservers.add(observer); <<<<<<< */ public static void removeErrorObserver(ErrorObserver observer) { int i = sleuthkitCaseErrorObservers.indexOf(observer); ======= * @deprecated */ @Deprecated public void removerErrorObserver(ErrorObserver observer) { int i = errorObservers.indexOf(observer); >>>>>>> */ public static void removeErrorObserver(ErrorObserver observer) { int i = sleuthkitCaseErrorObservers.indexOf(observer); <<<<<<< * @param typeOfError The error type. Different clients may handle different * types of errors. ======= * @param context The context in which the error occurred. >>>>>>> * @param typeOfError The error type. Different clients may handle different * types of errors. <<<<<<< private static void notifyError(Exception ex) { for (ErrorObserver observer : sleuthkitCaseErrorObservers) { if (observer != null) { try { observer.receiveError(ex); } catch (Exception exp) { logger.log(Level.WARNING, "Observer client unable to receive message", ex); } } ======= @Deprecated public void submitError(String context, String errorMessage) { for (ErrorObserver observer : errorObservers) { observer.receiveError(context, errorMessage); >>>>>>> private static void notifyError(Exception ex) { for (ErrorObserver observer : sleuthkitCaseErrorObservers) { if (observer != null) { try { observer.receiveError(ex); } catch (Exception exp) { logger.log(Level.WARNING, "Observer client unable to receive message", ex); } }
<<<<<<< this.initReviewStatuses(connection); ======= this.initEncodingTypes(connection); >>>>>>> this.initReviewStatuses(connection); this.initEncodingTypes(connection); <<<<<<< this.initReviewStatuses(connection); ======= this.initEncodingTypes(connection); >>>>>>> this.initReviewStatuses(connection); this.initEncodingTypes(connection); <<<<<<< return getArtifactsHelper(" blackboard_artifacts.artifact_type_id = " + artifactTypeID); ======= CaseDbConnection connection = connections.getConnection(); acquireSharedLock(); ResultSet rs = null; try { Statement s = connection.createStatement(); rs = connection.executeQuery(s, "SELECT arts.artifact_id AS artifact_id, arts.obj_id AS obj_id, " + "types.type_name AS type_name, types.display_name AS display_name " + "FROM blackboard_artifacts AS arts " + "INNER JOIN blackboard_artifact_types AS types " + "ON arts.artifact_type_id = types.artifact_type_id " + "AND arts.artifact_type_id = " + artifactTypeID); ArrayList<BlackboardArtifact> artifacts = new ArrayList<BlackboardArtifact>(); while (rs.next()) { artifacts.add(new BlackboardArtifact(this, rs.getLong("artifact_id"), rs.getLong("obj_id"), artifactTypeID, rs.getString("type_name"), rs.getString("display_name"))); } return artifacts; } catch (SQLException ex) { throw new TskCoreException("Error getting or creating a blackboard artifact", ex); } finally { closeResultSet(rs); connection.close(); releaseSharedLock(); } >>>>>>> CaseDbConnection connection = connections.getConnection(); acquireSharedLock(); ResultSet rs = null; try { Statement s = connection.createStatement(); rs = connection.executeQuery(s, "SELECT arts.artifact_id AS artifact_id, arts.obj_id AS obj_id, " + "types.type_name AS type_name, types.display_name AS display_name " + " arts.review_status_id AS review_status_id " + "FROM blackboard_artifacts AS arts " + "INNER JOIN blackboard_artifact_types AS types " + "ON arts.artifact_type_id = types.artifact_type_id " + "AND arts.artifact_type_id = " + artifactTypeID); ArrayList<BlackboardArtifact> artifacts = new ArrayList<BlackboardArtifact>(); while (rs.next()) { artifacts.add(new BlackboardArtifact(this, rs.getLong("artifact_id"), rs.getLong("obj_id"), artifactTypeID, rs.getString("type_name"), rs.getString("display_name"), BlackboardArtifact.ReviewStatus.withID(rs.getInt("review_status_id")))); } return artifacts; } catch (SQLException ex) { throw new TskCoreException("Error getting or creating a blackboard artifact", ex); } finally { closeResultSet(rs); connection.close(); releaseSharedLock(); } <<<<<<< String query = "SELECT blackboard_artifacts.artifact_id, " + "blackboard_artifacts.obj_id, " + "blackboard_artifact_types.artifact_type_id, " + "blackboard_artifact_types.type_name, " + "blackboard_artifact_types.display_name," + "blackboard_artifacts.review_status_id " ======= String query = "SELECT blackboard_artifacts.artifact_id AS artifact_id, " + "blackboard_artifacts.obj_id AS obj_id, blackboard_artifact_types.artifact_type_id AS artifact_type_id, " + "blackboard_artifact_types.type_name AS type_name, blackboard_artifact_types.display_name AS display_name " >>>>>>> String query = "SELECT blackboard_artifacts.artifact_id AS artifact_id, " + "blackboard_artifacts.obj_id AS obj_id, blackboard_artifact_types.artifact_type_id AS artifact_type_id, " + "blackboard_artifact_types.type_name AS type_name, blackboard_artifact_types.display_name AS display_name, " + "blackboard_artifacts.review_status_id AS review_status_id" <<<<<<< artifacts.add(new BlackboardArtifact(this, rs.getLong(1), rs.getLong(2), rs.getInt(3), rs.getString(4), rs.getString(5), BlackboardArtifact.ReviewStatus.withID(rs.getInt("review_status_id")))); ======= artifacts.add(new BlackboardArtifact(this, rs.getLong("artifact_id"), rs.getLong("obj_id"), rs.getInt("artifact_type_id"), rs.getString("type_name"), rs.getString("display_name"))); >>>>>>> artifacts.add(new BlackboardArtifact(this, rs.getLong("artifact_id"), rs.getLong("obj_id"), rs.getInt("artifact_type_id"), rs.getString("type_name"), rs.getString("display_name"), BlackboardArtifact.ReviewStatus.withID(rs.getInt("review_status_id")))); <<<<<<< rs = connection.executeQuery(s, "SELECT blackboard_artifacts.artifact_id, " + "blackboard_artifacts.obj_id, " + "blackboard_artifacts.artifact_type_id," + "blackboard_artifacts.review_status_id AS review_status_id " + "FROM blackboard_artifacts " + whereClause); //NON-NLS ======= rs = connection.executeQuery(s, "SELECT blackboard_artifacts.artifact_id AS artifact_id, " + "blackboard_artifacts.obj_id AS obj_id, blackboard_artifacts.artifact_type_id AS artifact_type_id " + "FROM blackboard_artifacts " + whereClause); //NON-NLS >>>>>>> rs = connection.executeQuery(s, "SELECT blackboard_artifacts.artifact_id AS artifact_id, " + "blackboard_artifacts.obj_id AS obj_id, blackboard_artifacts.artifact_type_id AS artifact_type_id, " + "blackboard_artifacts.review_status_id AS review_status_id " + "FROM blackboard_artifacts " + whereClause); //NON-NLS <<<<<<< type = this.getArtifactType(rs.getInt(3)); BlackboardArtifact artifact = new BlackboardArtifact(this, rs.getLong(1), rs.getLong(2), type.getTypeID(), type.getTypeName(), type.getDisplayName(), BlackboardArtifact.ReviewStatus.withID(rs.getInt("review_status_id"))); ======= type = this.getArtifactType(rs.getInt("artifact_type_id")); BlackboardArtifact artifact = new BlackboardArtifact(this, rs.getLong("artifact_id"), rs.getLong("obj_id"), type.getTypeID(), type.getTypeName(), type.getDisplayName()); >>>>>>> type = this.getArtifactType(rs.getInt("artifact_type_id")); BlackboardArtifact artifact = new BlackboardArtifact(this, rs.getLong("artifact_id"), rs.getLong("obj_id"), type.getTypeID(), type.getTypeName(), type.getDisplayName(), BlackboardArtifact.ReviewStatus.withID(rs.getInt("review_status_id"))); <<<<<<< return new BlackboardArtifact(this, rs.getLong(1), obj_id, artifact_type_id, artifactTypeName, artifactDisplayName, BlackboardArtifact.ReviewStatus.UNDECIDED, true); ======= return new BlackboardArtifact(this, rs.getLong(1), //last_insert_rowid() obj_id, artifact_type_id, artifactTypeName, artifactDisplayName, true); >>>>>>> return new BlackboardArtifact(this, rs.getLong(1), //last_insert_rowid() obj_id, artifact_type_id, artifactTypeName, artifactDisplayName, BlackboardArtifact.ReviewStatus.UNDECIDED, true); <<<<<<< COUNT_ARTIFACTS_OF_TYPE("SELECT COUNT(*) FROM blackboard_artifacts WHERE artifact_type_id = ? AND review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID()), //NON-NLS COUNT_ARTIFACTS_FROM_SOURCE("SELECT COUNT(*) FROM blackboard_artifacts WHERE obj_id = ? AND review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID()), //NON-NLS COUNT_ARTIFACTS_BY_SOURCE_AND_TYPE("SELECT COUNT(*) FROM blackboard_artifacts WHERE obj_id = ? AND artifact_type_id = ? AND review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID()), //NON-NLS ======= COUNT_ARTIFACTS_OF_TYPE("SELECT COUNT(*) AS count FROM blackboard_artifacts WHERE artifact_type_id = ?"), //NON-NLS COUNT_ARTIFACTS_FROM_SOURCE("SELECT COUNT(*) AS count FROM blackboard_artifacts WHERE obj_id = ?"), //NON-NLS COUNT_ARTIFACTS_BY_SOURCE_AND_TYPE("SELECT COUNT(*) AS count FROM blackboard_artifacts WHERE obj_id = ? AND artifact_type_id = ?"), //NON-NLS >>>>>>> COUNT_ARTIFACTS_OF_TYPE("SELECT COUNT(*) AS count FROM blackboard_artifacts WHERE artifact_type_id = ? AND review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID()), //NON-NLS COUNT_ARTIFACTS_FROM_SOURCE("SELECT COUNT(*) AS count FROM blackboard_artifacts WHERE obj_id = ? AND review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID()), //NON-NLS COUNT_ARTIFACTS_BY_SOURCE_AND_TYPE("SELECT COUNT(*) AS count FROM blackboard_artifacts WHERE obj_id = ? AND artifact_type_id = ? AND review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID()), //NON-NLS
<<<<<<< throw new TskCoreException(String.format("Error creating OsAccount with sid = %s, loginName = %s, realm = %s, referring host = %d", (sid != null) ? sid : "Null", (loginName != null) ? loginName : "Null", (realmName != null) ? realmName : "Null", referringHost), ex); ======= throw new TskCoreException(String.format("Error creating OsAccount with sid = %s, loginName = %s, realm = %s, referring host = %d", (sid != null) ? sid : "Null", (loginName != null) ? loginName : "Null", (realmName != null) ? realmName : "Null", referringHost), ex); >>>>>>> throw new TskCoreException(String.format("Error creating OsAccount with sid = %s, loginName = %s, realm = %s, referring host = %d", (sid != null) ? sid : "Null", (loginName != null) ? loginName : "Null", (realmName != null) ? realmName : "Null", referringHost), ex); <<<<<<< account = new OsAccount(db, osAccountObjId, realm, loginName, uniqueId, signature, accountStatus); } finally { ======= account = new OsAccount(db, osAccountObjId, realm, loginName, uniqueId, signature, accountStatus, OsAccount.OsAccountDbStatus.ACTIVE); } finally { >>>>>>> account = new OsAccount(db, osAccountObjId, realm, loginName, uniqueId, signature, accountStatus, OsAccount.OsAccountDbStatus.ACTIVE); } finally { <<<<<<< + " accounts.realm_id, accounts.unique_id, accounts.signature, " + " accounts.type, accounts.status, accounts.admin, accounts.created_date, " + " realms.realm_name as realm_name, realms.realm_addr as realm_addr, realms.realm_signature, realms.scope_host_id, realms.scope_confidence " + " FROM tsk_os_accounts as accounts" + " LEFT JOIN tsk_os_account_realms as realms" + " ON accounts.realm_id = realms.id" + " WHERE " + whereHostClause + " AND LOWER(accounts.unique_id) = LOWER('" + uniqueId + "')"; ======= + " accounts.realm_id, accounts.unique_id, accounts.signature, " + " accounts.type, accounts.status, accounts.admin, accounts.created_date, accounts.db_status, " + " realms.realm_name as realm_name, realms.realm_addr as realm_addr, realms.realm_signature, realms.scope_host_id, realms.scope_confidence, realms.db_status as realm_db_status " + " FROM tsk_os_accounts as accounts" + " LEFT JOIN tsk_os_account_realms as realms" + " ON accounts.realm_id = realms.id" + " WHERE " + whereHostClause + " AND accounts.db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() + " AND LOWER(accounts.unique_id) = LOWER('" + uniqueId + "')"; >>>>>>> + " accounts.realm_id, accounts.unique_id, accounts.signature, " + " accounts.type, accounts.status, accounts.admin, accounts.created_date, accounts.db_status, " + " realms.realm_name as realm_name, realms.realm_addr as realm_addr, realms.realm_signature, realms.scope_host_id, realms.scope_confidence, realms.db_status as realm_db_status " + " FROM tsk_os_accounts as accounts" + " LEFT JOIN tsk_os_account_realms as realms" + " ON accounts.realm_id = realms.id" + " WHERE " + whereHostClause + " AND accounts.db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() + " AND LOWER(accounts.unique_id) = LOWER('" + uniqueId + "')"; <<<<<<< host, OsAccountRealm.ScopeConfidence.fromID(rs.getInt("scope_confidence"))); ======= host, OsAccountRealm.ScopeConfidence.fromID(rs.getInt("scope_confidence")), OsAccountRealm.RealmDbStatus.fromID(rs.getInt("realm_db_status"))); >>>>>>> host, OsAccountRealm.ScopeConfidence.fromID(rs.getInt("scope_confidence")), OsAccountRealm.RealmDbStatus.fromID(rs.getInt("realm_db_status"))); <<<<<<< + " WHERE LOWER(unique_id) = LOWER('" + uniqueId + "')" ======= + " WHERE LOWER(unique_id) = LOWER('" + uniqueId + "')" + " AND db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() >>>>>>> + " WHERE LOWER(unique_id) = LOWER('" + uniqueId + "')" + " AND db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() <<<<<<< + " WHERE LOWER(login_name) = LOWER('" + loginName + "')" ======= + " WHERE LOWER(login_name) = LOWER('" + loginName + "')" + " AND db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() >>>>>>> + " WHERE LOWER(login_name) = LOWER('" + loginName + "')" + " AND db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() <<<<<<< + " WHERE instances.host_id = " + host.getId(); ======= + " WHERE instances.host_id = " + host.getId() + " AND accounts.db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId(); >>>>>>> + " WHERE instances.host_id = " + host.getId() + " AND accounts.db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId(); <<<<<<< try (CaseDbConnection connection = db.getConnection()) { ======= try (CaseDbConnection connection = db.getConnection()) { return updateAccount(osAccount, connection); } finally { db.releaseSingleUserCaseWriteLock(); } } /** * Updates the database for the given OsAccount. * * @param osAccount OsAccount that needs to be updated in the database. * * @return OsAccount Updated account. * * @throws TskCoreException */ OsAccount updateAccount(OsAccount osAccount, CaseDbConnection connection) throws TskCoreException { // do nothing if the account is not dirty. if (!osAccount.isDirty()) { return osAccount; } try { >>>>>>> try (CaseDbConnection connection = db.getConnection()) { return updateAccount(osAccount, connection); } finally { db.releaseSingleUserCaseWriteLock(); } } /** * Updates the database for the given OsAccount. * * @param osAccount OsAccount that needs to be updated in the database. * * @return OsAccount Updated account. * * @throws TskCoreException */ OsAccount updateAccount(OsAccount osAccount, CaseDbConnection connection) throws TskCoreException { // do nothing if the account is not dirty. if (!osAccount.isDirty()) { return osAccount; } try { <<<<<<< + " login_name = ?, " // 1 + " unique_id = ?, " // 2 + " signature = ?, " // 3 + " full_name = ?, " // 4 + " status = ?, " // 5 + " type = ?, " // 6 + " created_date = ? " // 7 + " WHERE os_account_obj_id = ?"; // 8 ======= + " login_name = ?, " // 1 + " unique_id = ?, " // 2 + " signature = " // 3 + " CASE WHEN db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() + " THEN ? ELSE signature END , " + " full_name = ?, " // 4 + " status = ?, " // 5 + " type = ?, " // 6 + " created_date = ? " // 7 + " WHERE os_account_obj_id = ?"; // 8 >>>>>>> + " login_name = ?, " // 1 + " unique_id = ?, " // 2 + " signature = " // 3 + " CASE WHEN db_status = " + OsAccount.OsAccountDbStatus.ACTIVE.getId() + " THEN ? ELSE signature END , " + " full_name = ?, " // 4 + " status = ?, " // 5 + " type = ?, " // 6 + " created_date = ? " // 7 + " WHERE os_account_obj_id = ?"; // 8 <<<<<<< ======= // If the account is merged or deleted this will not be set. >>>>>>> // If the account is merged or deleted this will not be set. <<<<<<< } finally { db.releaseSingleUserCaseWriteLock(); ======= >>>>>>> <<<<<<< OsAccount osAccount = new OsAccount(db, rs.getLong("os_account_obj_id"), realm, rs.getString("login_name"), rs.getString("unique_id"), rs.getString("signature"), OsAccount.OsAccountStatus.fromID(rs.getInt("status"))); ======= OsAccount osAccount = new OsAccount(db, rs.getLong("os_account_obj_id"), realm, rs.getString("login_name"), rs.getString("unique_id"), rs.getString("signature"), OsAccount.OsAccountStatus.fromID(rs.getInt("status")), OsAccount.OsAccountDbStatus.fromID(rs.getInt("db_status"))); >>>>>>> OsAccount osAccount = new OsAccount(db, rs.getLong("os_account_obj_id"), realm, rs.getString("login_name"), rs.getString("unique_id"), rs.getString("signature"), OsAccount.OsAccountStatus.fromID(rs.getInt("status")), OsAccount.OsAccountDbStatus.fromID(rs.getInt("db_status")));
<<<<<<< private long artifactId; // ArtifactID of the underlying TSK_ACCOUNT artifact private final Account.Type accountType; private final String accountID; private final SleuthkitCase sleuthkitCase; private BlackboardArtifact artifact = null; public static final class Type implements Serializable { private static final long serialVersionUID = 1L; public static final Account.Type CREDIT_CARD = new Type("CREDIT_CARD", "Credit Card"); public static final Account.Type DEVICE = new Type("DEVICE", "Device"); public static final Account.Type PHONE = new Type("PHONE", "Phone"); public static final Account.Type EMAIL = new Type("EMAIL", "Email"); public static final Account.Type FACEBOOK = new Type("FACEBOOK", "Facebook"); public static final Account.Type TWITTER = new Type("TWITTER", "Twitter"); public static final Account.Type INSTAGRAM = new Type("INSTAGRAM", "Instagram"); public static final Account.Type WHATSAPP = new Type("WHATSAPP", "Facebook"); public static final Account.Type MESSAGING_APP = new Type("MESSAGING_APP", "MessagingApp"); public static final Account.Type WEBSITE = new Type("WEBSITE", "Website"); public static final List<Account.Type> PREDEFINED_ACCOUNT_TYPES = new ArrayList<Account.Type>(); static { PREDEFINED_ACCOUNT_TYPES.add(CREDIT_CARD); PREDEFINED_ACCOUNT_TYPES.add(DEVICE); PREDEFINED_ACCOUNT_TYPES.add(PHONE); PREDEFINED_ACCOUNT_TYPES.add(EMAIL); PREDEFINED_ACCOUNT_TYPES.add(FACEBOOK); PREDEFINED_ACCOUNT_TYPES.add(TWITTER); PREDEFINED_ACCOUNT_TYPES.add(INSTAGRAM); PREDEFINED_ACCOUNT_TYPES.add(WHATSAPP); PREDEFINED_ACCOUNT_TYPES.add(MESSAGING_APP); PREDEFINED_ACCOUNT_TYPES.add(WEBSITE); } ======= private long artifactId; // ArtifactID of the underlying TSK_ACCOUNT artifact private final Account.Type accountType; private final String accountID; private final BlackboardArtifact artifact; public static final class Type implements Serializable { private static final long serialVersionUID = 1L; public static final Account.Type CREDIT_CARD = new Type("CREDIT_CARD", "Credit Card"); public static final Account.Type DEVICE = new Type("DEVICE", "Device"); public static final Account.Type PHONE = new Type("PHONE", "Phone"); public static final Account.Type EMAIL = new Type("EMAIL", "Email"); public static final Account.Type FACEBOOK = new Type("FACEBOOK", "Facebook"); public static final Account.Type TWITTER = new Type("TWITTER", "Twitter"); public static final Account.Type INSTAGRAM = new Type("INSTAGRAM", "Instagram"); public static final Account.Type WHATSAPP = new Type("WHATSAPP", "Facebook"); public static final Account.Type MESSAGING_APP = new Type("MESSAGING_APP", "MessagingApp"); public static final Account.Type WEBSITE = new Type("WEBSITE", "Website"); public static final List<Account.Type> PREDEFINED_ACCOUNT_TYPES = new ArrayList<Account.Type>(); static { PREDEFINED_ACCOUNT_TYPES.add(CREDIT_CARD); PREDEFINED_ACCOUNT_TYPES.add(DEVICE); PREDEFINED_ACCOUNT_TYPES.add(PHONE); PREDEFINED_ACCOUNT_TYPES.add(EMAIL); PREDEFINED_ACCOUNT_TYPES.add(FACEBOOK); PREDEFINED_ACCOUNT_TYPES.add(TWITTER); PREDEFINED_ACCOUNT_TYPES.add(INSTAGRAM); PREDEFINED_ACCOUNT_TYPES.add(WHATSAPP); PREDEFINED_ACCOUNT_TYPES.add(MESSAGING_APP); PREDEFINED_ACCOUNT_TYPES.add(WEBSITE); } >>>>>>> private long artifactId; // ArtifactID of the underlying TSK_ACCOUNT artifact private final Account.Type accountType; private final String accountID; private final BlackboardArtifact artifact; public static final class Type implements Serializable { private static final long serialVersionUID = 1L; public static final Account.Type CREDIT_CARD = new Type("CREDIT_CARD", "Credit Card"); public static final Account.Type DEVICE = new Type("DEVICE", "Device"); public static final Account.Type PHONE = new Type("PHONE", "Phone"); public static final Account.Type EMAIL = new Type("EMAIL", "Email"); public static final Account.Type FACEBOOK = new Type("FACEBOOK", "Facebook"); public static final Account.Type TWITTER = new Type("TWITTER", "Twitter"); public static final Account.Type INSTAGRAM = new Type("INSTAGRAM", "Instagram"); public static final Account.Type WHATSAPP = new Type("WHATSAPP", "Facebook"); public static final Account.Type MESSAGING_APP = new Type("MESSAGING_APP", "MessagingApp"); public static final Account.Type WEBSITE = new Type("WEBSITE", "Website"); public static final List<Account.Type> PREDEFINED_ACCOUNT_TYPES = new ArrayList<Account.Type>(); static { PREDEFINED_ACCOUNT_TYPES.add(CREDIT_CARD); PREDEFINED_ACCOUNT_TYPES.add(DEVICE); PREDEFINED_ACCOUNT_TYPES.add(PHONE); PREDEFINED_ACCOUNT_TYPES.add(EMAIL); PREDEFINED_ACCOUNT_TYPES.add(FACEBOOK); PREDEFINED_ACCOUNT_TYPES.add(TWITTER); PREDEFINED_ACCOUNT_TYPES.add(INSTAGRAM); PREDEFINED_ACCOUNT_TYPES.add(WHATSAPP); PREDEFINED_ACCOUNT_TYPES.add(MESSAGING_APP); PREDEFINED_ACCOUNT_TYPES.add(WEBSITE); } <<<<<<< public Account(SleuthkitCase sleuthkitCase, long artifactId) throws TskCoreException { this.sleuthkitCase = sleuthkitCase; this.artifactId = artifactId; this.artifact = this.sleuthkitCase.getBlackboardArtifact(artifactId); this.accountType = sleuthkitCase.getAccountType(artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)).getValueString()); this.accountID = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ID)).getValueString(); } public Account(SleuthkitCase sleuthkitCase, BlackboardArtifact artifact) throws TskCoreException { this.sleuthkitCase = sleuthkitCase; this.artifactId = artifact.getArtifactID(); this.artifact = artifact; this.accountType = sleuthkitCase.getAccountType(artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)).getValueString()); this.accountID = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ID)).getValueString(); } public String getAccountID() { return this.accountID; } public Account.Type getAccountType() { return this.accountType; } public BlackboardAttribute getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE attrType) throws TskCoreException { return this.artifact.getAttribute(new BlackboardAttribute.Type(attrType)); } public void addAttribute(BlackboardAttribute bbatr) throws TskCoreException { this.artifact.addAttribute(bbatr); } public long getArtifactId() { return this.artifactId; } ======= public Account(SleuthkitCase sleuthkitCase, long artifactId) throws TskCoreException { this.artifactId = artifactId; this.artifact = sleuthkitCase.getBlackboardArtifact(artifactId); this.accountType = sleuthkitCase.getAccountType(artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)).getValueString()); this.accountID = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ID)).getValueString(); } public String getAccountID() { return this.accountID; } public Account.Type getAccountType() { return this.accountType; } public BlackboardAttribute getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE attrType) throws TskCoreException { return this.artifact.getAttribute(new BlackboardAttribute.Type(attrType)); } public void addAttribute(BlackboardAttribute bbatr) throws TskCoreException { this.artifact.addAttribute(bbatr); } public long getArtifactId() { return this.artifactId; } >>>>>>> public Account(SleuthkitCase sleuthkitCase, long artifactId) throws TskCoreException { this.artifactId = artifactId; this.artifact = sleuthkitCase.getBlackboardArtifact(artifactId); this.accountType = sleuthkitCase.getAccountType(artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)).getValueString()); this.accountID = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ID)).getValueString(); } public Account(SleuthkitCase sleuthkitCase, BlackboardArtifact artifact) throws TskCoreException { this.sleuthkitCase = sleuthkitCase; this.artifactId = artifact.getArtifactID(); this.artifact = artifact; this.accountType = sleuthkitCase.getAccountType(artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE)).getValueString()); this.accountID = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ID)).getValueString(); } public String getAccountID() { return this.accountID; } public Account.Type getAccountType() { return this.accountType; } public BlackboardAttribute getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE attrType) throws TskCoreException { return this.artifact.getAttribute(new BlackboardAttribute.Type(attrType)); } public void addAttribute(BlackboardAttribute bbatr) throws TskCoreException { this.artifact.addAttribute(bbatr); } public long getArtifactId() { return this.artifactId; }
<<<<<<< * Get the absolute unique path across all files in the case parent path string * of this FsContent. The path contains image and volume-system partition ======= * Is this a root of a file system * * @return true if root of a file system, false otherwise */ public abstract boolean isRoot(); /** * Get the absolute unique across all files in the case parent path string * of this FsContent The path contains image and volume-system partition >>>>>>> * Is this a root of a file system * * @return true if root of a file system, false otherwise */ public abstract boolean isRoot(); /** * Get the absolute unique path across all files in the case parent path string * of this FsContent. The path contains image and volume-system partition
<<<<<<< + "created_date " + dbQueryHelper.getBigIntType() + " DEFAULT NULL, " ======= + "created_date " + dbQueryHelper.getBigIntType() + " DEFAULT NULL, " + "person_id INTEGER, " >>>>>>> + "created_date " + dbQueryHelper.getBigIntType() + " DEFAULT NULL, " + "created_date " + dbQueryHelper.getBigIntType() + " DEFAULT NULL, " + "person_id INTEGER, "
<<<<<<< TSK_OBJECT_DETECTED(41, "TSK_OBJECT_DETECTED", //NON-NLS bundle.getString("BlackboardArtifact.tskObjectDetected.text")), /** * A generic (timeline) event. */ TSK_TL_EVENT(42, "TSK_TL_EVENT", //NON-NLS bundle.getString("BlackboardArtifact.tskTLEvent.text")); ; ======= TSK_OBJECT_DETECTED(41, "TSK_OBJECT_DETECTED", //NON-NLS bundle.getString("BlackboardArtifact.tskObjectDetected.text")), /** * A generic (timeline) event. */ TSK_TL_EVENT(42, "TSK_TL_EVENT", bundle.getString("BlackboardArtifact.tskTLEvent.text")); >>>>>>> TSK_OBJECT_DETECTED(41, "TSK_OBJECT_DETECTED", //NON-NLS bundle.getString("BlackboardArtifact.tskObjectDetected.text")), /** * A generic (timeline) event. */ TSK_TL_EVENT(42, "TSK_TL_EVENT", //NON-NLS bundle.getString("BlackboardArtifact.tskTLEvent.text"));