File tree Expand file tree Collapse file tree
src/main/java/gjum/minecraft/civ/synapse Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name =Synapse
22description =Civ player utilities
33projectGroup =gjum.minecraft.civ.synapse
4- version =2.0.0-beta10
4+ version =2.0.0-beta11
55mcVersion =1.12.2
66mcMappings =snapshot_20180101
77forgeGradleVersion =2.3-SNAPSHOT
Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ private void onModDeactivated() {
225225 player .setGlowing (false );
226226 }
227227 }
228+ if (waypointManager != null ) waypointManager .updateAllWaypoints ();
228229 comms .disconnect ();
229230 }
230231
Original file line number Diff line number Diff line change @@ -139,10 +139,12 @@ public void updateMapWaypoints() {
139139 final EntityPlayer player = getMc ().world .getPlayerEntityByName (account );
140140 hiddenForNearby = player != null ;
141141
142+ final boolean modActive = LiteModSynapse .instance .isModActive ();
143+
142144 final GlobalConfig globalConfig = LiteModSynapse .instance .config ;
143145 try {
144146 if (isJourneyMapLoaded ()) {
145- if (globalConfig .isUseJourneyMap ()) {
147+ if (modActive && globalConfig .isUseJourneyMap ()) {
146148 JourneyMapHelper .updateWaypoint (this );
147149 } else {
148150 JourneyMapHelper .deleteWaypoint (this );
@@ -154,7 +156,7 @@ public void updateMapWaypoints() {
154156
155157 try {
156158 if (isVoxelMapActive ()) {
157- if (globalConfig .isUseVoxelMap ()) {
159+ if (modActive && globalConfig .isUseVoxelMap ()) {
158160 VoxelMapHelper .updateWaypoint (this );
159161 } else {
160162 VoxelMapHelper .deleteWaypoint (this );
Original file line number Diff line number Diff line change @@ -143,6 +143,18 @@ public void updateAllWaypoints() {
143143 }
144144 }
145145
146+ /**
147+ * e.g. when mod is disabled
148+ */
149+ public void deleteAllWaypoints () {
150+ for (MultiWaypoint point : managedAccountWaypoints .values ()) {
151+ point .deleteMapWaypoints ();
152+ }
153+ for (MultiWaypoint point : managedPearlWaypoints .values ()) {
154+ point .deleteMapWaypoints ();
155+ }
156+ }
157+
146158 @ Override
147159 public void handlePersonChange (@ Nullable Person personOld , @ Nullable Person personNew ) {
148160 if (personOld != null ) {
You can’t perform that action at this time.
0 commit comments