File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
java/de/dosmike/sponge/vshop Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 56
56
import java .util .zip .ZipOutputStream ;
57
57
58
58
@ SuppressWarnings ("UnstableApiUsage" )
59
- @ Plugin (id = "vshop" , name = "VillagerShops" , version = "2.8.2 " )
59
+ @ Plugin (id = "vshop" , name = "VillagerShops" , version = "2.8.3 " )
60
60
public class VillagerShops {
61
61
62
62
public static final Random rng = new Random (System .currentTimeMillis ());
Original file line number Diff line number Diff line change @@ -70,8 +70,14 @@ public Location<World> getLocation() {
70
70
}
71
71
72
72
public void setLocation (Location <World > location ) {
73
+ UUID oldExtent = this .location == null ? null : this .location .getExtent ().getUniqueId ();
74
+ UUID newExtent = location .getExtent ().getUniqueId ();
75
+
73
76
this .location = Utilities .centerOnBlock (location );
74
- VillagerShops .getInstance ().markShopsDirty (this );
77
+
78
+ if (oldExtent != null && !oldExtent .equals (newExtent ))
79
+ VillagerShops .getInstance ().markShopsDirty (oldExtent );
80
+ VillagerShops .getInstance ().markShopsDirty (newExtent );
75
81
}
76
82
77
83
/**
@@ -86,10 +92,16 @@ public void move(Location<World> newLocation) {
86
92
if (!chunk .loadChunk (false ))
87
93
throw new RuntimeException ("Unable to load chunk for shop to remove old entity" );
88
94
}
95
+ UUID oldExtent = location == null ? null : location .getExtent ().getUniqueId ();
96
+ UUID newExtent = newLocation .getExtent ().getUniqueId ();
97
+
89
98
Location <World > targetLocation = Utilities .centerOnBlock (newLocation );
90
99
getEntity ().ifPresent (le -> le .setLocation (targetLocation ));
91
100
location = targetLocation ;
92
- VillagerShops .getInstance ().markShopsDirty (this );
101
+
102
+ if (oldExtent != null && !oldExtent .equals (newExtent ))
103
+ VillagerShops .getInstance ().markShopsDirty (oldExtent );
104
+ VillagerShops .getInstance ().markShopsDirty (newExtent );
93
105
}
94
106
95
107
public Vector3d getRotation () {
Original file line number Diff line number Diff line change 2
2
"modid" : " vshop" ,
3
3
"name" : " VillagerShops" ,
4
4
"description" : " Set up Mobs of any type as admin shop. Shops will use a Inventory-Menu to buy/sell items" ,
5
- "version" : " 2.8.2 " ,
5
+ "version" : " 2.8.3 " ,
6
6
"url" : " https://github.com/DosMike/VillagerShops" ,
7
7
"authorList" : [ " DosMike" ],
8
8
"useDependencyInformation" : " true" ,
You can’t perform that action at this time.
0 commit comments