Index: /applications/editors/josm/plugins/geochat/build.xml
===================================================================
--- /applications/editors/josm/plugins/geochat/build.xml	(revision 34511)
+++ /applications/editors/josm/plugins/geochat/build.xml	(revision 34512)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="[josm_geochat] copypaste from keyboard, font size advanced parameters"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="12840"/>
+    <property name="plugin.main.version" value="14153"/>
 
     <property name="plugin.author" value="Ilya Zverev"/>
Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java	(revision 34511)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java	(revision 34512)
@@ -23,6 +23,6 @@
 import javax.swing.text.StyleConstants;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -155,5 +155,5 @@
         chatPane.setEditable(false);
         Font font = chatPane.getFont();
-        float size = Main.pref.getInt("geochat.fontsize", -1);
+        float size = Config.getPref().getInt("geochat.fontsize", -1);
         if (size < 6)
             size += font.getSize2D();
Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java	(revision 34511)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java	(revision 34512)
@@ -19,10 +19,11 @@
 import javax.json.JsonObject;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.coor.conversion.DecimalDegreesCoordinateFormat;
 import org.openstreetmap.josm.data.projection.Projection;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -88,5 +89,5 @@
      */
     public void autoLogin(final String userName) {
-        final int uid = Main.pref.getInt("geochat.lastuid", 0);
+        final int uid = Config.getPref().getInt("geochat.lastuid", 0);
         if (uid <= 0) {
             if (userName != null && userName.length() > 1)
@@ -173,5 +174,5 @@
         this.userId = userId;
         this.userName = userName;
-        Main.pref.putInt("geochat.lastuid", userId);
+        Config.getPref().putInt("geochat.lastuid", userId);
         for (ChatServerConnectionListener listener : listeners) {
             listener.loggedIn(userName);
@@ -182,5 +183,5 @@
         ChatServerConnection.this.userId = 0;
         ChatServerConnection.this.userName = null;
-        Main.pref.put("geochat.lastuid", null);
+        Config.getPref().put("geochat.lastuid", null);
         for (ChatServerConnectionListener listener : listeners) {
             listener.notLoggedIn(null);
@@ -280,5 +281,5 @@
         if (getCurrentZoom() < 10)
             return null;
-        Projection proj = Main.getProjection();
+        Projection proj = ProjectionRegistry.getProjection();
         return proj.eastNorth2latlon(MainApplication.getMap().mapView.getCenter());
     }
@@ -328,6 +329,6 @@
         @Override
         public void run() {
-            //            lastId = Main.pref.getLong("geochat.lastid", 0);
-            int interval = Main.pref.getInt("geochat.interval", 2);
+            //            lastId = Config.getPref().getLong("geochat.lastid", 0);
+            int interval = Config.getPref().getInt("geochat.interval", 2);
             while (!stopping) {
                 process();
@@ -362,5 +363,5 @@
                 // reset messages
                 lastId = 0;
-                //                Main.pref.put("geochat.lastid", null);
+                //                Config.getPref().put("geochat.lastid", null);
                 needReset = true;
             } else
@@ -413,6 +414,6 @@
                 }
             }
-            //                    if (lastId > 0 && Main.pref.getBoolean("geochat.store.lastid", true) )
-            //                        Main.pref.putLong("geochat.lastid", lastId);
+            //                    if (lastId > 0 && Config.getPref().getBoolean("geochat.store.lastid", true) )
+            //                        Config.getPref().putLong("geochat.lastid", lastId);
         }
 
Index: /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java	(revision 34511)
+++ /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java	(revision 34512)
@@ -34,5 +34,4 @@
 import javax.swing.SwingConstants;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.UserIdentityManager;
@@ -44,4 +43,5 @@
 import org.openstreetmap.josm.gui.layer.MapViewPaintable;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Logging;
@@ -96,5 +96,5 @@
         connection = ChatServerConnection.getInstance();
         connection.addListener(this);
-        boolean autoLogin = Main.pref.get("geochat.username", null) == null ? false : Main.pref.getBoolean("geochat.autologin", true);
+        boolean autoLogin = Config.getPref().get("geochat.username", null) == null ? false : Config.getPref().getBoolean("geochat.autologin", true);
         connection.autoLoginWithDelay(autoLogin ? defaultUserName : null);
         updateTitleAlarm();
@@ -102,5 +102,5 @@
 
     private String constructUserName() {
-        String userName = Main.pref.get("geochat.username", null); // so the default is null
+        String userName = Config.getPref().get("geochat.username", null); // so the default is null
         if (userName == null)
             userName = UserIdentityManager.getInstance().getUserName();
@@ -131,9 +131,9 @@
         nameField.setPreferredSize(new Dimension(nameField.getPreferredSize().width, loginButton.getPreferredSize().height));
 
-        final JCheckBox autoLoginBox = new JCheckBox(tr("Enable autologin"), Main.pref.getBoolean("geochat.autologin", true));
+        final JCheckBox autoLoginBox = new JCheckBox(tr("Enable autologin"), Config.getPref().getBoolean("geochat.autologin", true));
         autoLoginBox.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
-                Main.pref.putBoolean("geochat.autologin", autoLoginBox.isSelected());
+                Config.getPref().putBoolean("geochat.autologin", autoLoginBox.isSelected());
             }
         });
@@ -153,5 +153,5 @@
     public void destroy() {
         try {
-            if (Main.pref.getBoolean("geochat.logout.on.close", true)) {
+            if (Config.getPref().getBoolean("geochat.logout.on.close", true)) {
                 connection.removeListener(this);
                 connection.bruteLogout();
@@ -257,5 +257,5 @@
     @Override
     public void loggedIn(String userName) {
-        Main.pref.put("geochat.username", userName);
+        Config.getPref().put("geochat.username", userName);
         if (gcPanel.getComponentCount() == 1) {
             GuiHelper.runInEDTAndWait(new Runnable() {
Index: /applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java	(revision 34511)
+++ /applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java	(revision 34512)
@@ -13,6 +13,6 @@
 import javax.json.JsonObject;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -32,5 +32,5 @@
     public static JsonObject query(String query) throws IOException {
         try {
-            String serverURL = Main.pref.get("geochat.server", "https://zverik.dev.openstreetmap.org/osmochat.php?action=");
+            String serverURL = Config.getPref().get("geochat.server", "https://zverik.dev.openstreetmap.org/osmochat.php?action=");
             URL url = new URL(serverURL + query);
             HttpURLConnection connection = (HttpURLConnection) url.openConnection();
