@@ -33,19 +33,12 @@ private void ForceDivorcewhenmarried(MarriedEvent event) {
33
33
VillagerTracker tracker = plugin .getTracker ();
34
34
INMSConverter converter = plugin .getConverter ();
35
35
36
-
37
-
38
36
MarriagePlayer marriedplayer1 = event .getPlayer1 ();
39
37
MarriagePlayer marriedplayer2 = event .getPlayer2 ();
40
38
41
39
Player player1 = marriedplayer1 .getPlayerOnline ();
42
40
Player player2 = marriedplayer2 .getPlayerOnline ();
43
41
44
-
45
-
46
-
47
-
48
-
49
42
String uuidString1 = player1 .getPersistentDataContainer ().get (plugin .getMarriedWith (), PersistentDataType .STRING );
50
43
if (uuidString1 != null ) partnerUUID1 = UUID .fromString (uuidString1 );
51
44
player1 .getPersistentDataContainer ().remove (plugin .getMarriedWith ());
@@ -54,8 +47,6 @@ private void ForceDivorcewhenmarried(MarriedEvent event) {
54
47
if (uuidString2 != null ) partnerUUID2 = UUID .fromString (uuidString2 );;
55
48
player2 .getPersistentDataContainer ().remove (plugin .getMarriedWith ());
56
49
57
-
58
-
59
50
for (IVillagerNPC offlineVillager : tracker .getOfflineVillagers ()) {
60
51
if (!offlineVillager .getUniqueId ().equals (partnerUUID1 )) continue ;
61
52
@@ -65,7 +56,6 @@ private void ForceDivorcewhenmarried(MarriedEvent event) {
65
56
if (bukkit == null ) continue ;
66
57
}
67
58
68
- // In this case, we don't need to ignore invalid villagers.
69
59
IVillagerNPC npc = converter .getNPC (bukkit ).orElse (null );
70
60
if (npc == null ) continue ;
71
61
@@ -81,15 +71,11 @@ private void ForceDivorcewhenmarried(MarriedEvent event) {
81
71
if (bukkit == null ) continue ;
82
72
}
83
73
84
- // In this case, we don't need to ignore invalid villagers.
85
74
IVillagerNPC npc = converter .getNPC (bukkit ).orElse (null );
86
75
if (npc == null ) continue ;
87
76
88
77
npc .divorceAndDropRing (player1 );
89
78
break ;
90
79
}
91
-
92
- // At this point, either the player or the villager (or both) should be divorced.
93
-
94
80
}
95
81
}
0 commit comments