File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
src/main/java/org/hydev/mcpm/client/database Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,40 @@ private void saveJson(ArrayList<PluginTrackerModel> list) {
157
157
* }
158
158
*/
159
159
160
+ /**
161
+ * Returns whether a plugin with the given name is within
162
+ * the lock file
163
+ *
164
+ * @param name Id of the plugin
165
+ * @return Whether the plugin is within the lock file
166
+ */
167
+ public Boolean findIfInLockById (String name ) {
168
+ ArrayList <PluginTrackerModel > list = readJson ();
169
+ for (PluginTrackerModel pluginTrackerModel : list ) {
170
+ if (pluginTrackerModel .getPluginId ().equals (name )) {
171
+ return true ;
172
+ }
173
+ }
174
+ return false ;
175
+ }
176
+
177
+ /**
178
+ * Returns whether a plugin with the given name is within
179
+ * the lock file
180
+ *
181
+ * @param name Name of the plugin
182
+ * @return Whether the plugin is within the lock file
183
+ */
184
+ public Boolean findIfInLockByName (String name ) {
185
+ ArrayList <PluginTrackerModel > list = readJson ();
186
+ for (PluginTrackerModel pluginTrackerModel : list ) {
187
+ if (pluginTrackerModel .getName ().equals (name )) {
188
+ return true ;
189
+ }
190
+ }
191
+ return false ;
192
+ }
193
+
160
194
/**
161
195
* Add a plugin to the JSON file
162
196
*
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ public interface SuperPluginTracker {
24
24
25
25
void removeManuallyInstalled (String name );
26
26
27
+ Boolean findIfInLockById (String id );
28
+
29
+ Boolean findIfInLockByName (String name );
30
+
27
31
List <String > listManuallyInstalled ();
28
32
29
33
List <String > listOrphanPlugins (boolean considerSoftDependencies );
You can’t perform that action at this time.
0 commit comments