Skip to content

Commit e2c2694

Browse files
committed
Fixed issue with duplicates not inheriting parent data
1 parent d73493d commit e2c2694

5 files changed

Lines changed: 73 additions & 3 deletions

File tree

API/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.dev.lrxh</groupId>
88
<artifactId>API</artifactId>
9-
<version>2.4</version>
9+
<version>2.5</version>
1010
<packaging>jar</packaging>
1111

1212
<name>API</name>

Plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.dev.lrxh</groupId>
88
<artifactId>Plugin</artifactId>
9-
<version>2.4</version>
9+
<version>2.5</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Plugin</name>
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>me.dev.lrxh</groupId>
7171
<artifactId>API</artifactId>
72-
<version>2.4</version>
72+
<version>2.5</version>
7373
</dependency>
7474
<dependency>
7575
<groupId>io.papermc.paper</groupId>

Plugin/src/main/java/dev/lrxh/neptune/game/arena/Arena.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,40 @@ public Arena(String name, long time) {
8585
this.whitelistedBlocks = new ArrayList<>();
8686
}
8787

88+
@Override
89+
public double getBuildLimit() {
90+
return owner != null ? owner.getBuildLimit() : buildLimit;
91+
}
92+
93+
@Override
94+
public List<Material> getWhitelistedBlocks() {
95+
return owner != null ? owner.getWhitelistedBlocks() : whitelistedBlocks;
96+
}
97+
98+
@Override
99+
public int getDeathY() {
100+
return owner != null ? owner.getDeathY() : deathY;
101+
}
102+
103+
@Override
104+
public long getTime() {
105+
return owner != null ? owner.getTime() : time;
106+
}
107+
108+
@Override
109+
public boolean isEnabled() {
110+
return owner != null ? owner.isEnabled() : enabled;
111+
}
112+
113+
@Override
114+
public String getDisplayName() {
115+
return owner != null ? owner.getDisplayName() : displayName;
116+
}
117+
118+
public boolean isAllowedInCustomKit() {
119+
return owner != null ? owner.isAllowedInCustomKit() : allowedInCustomKit;
120+
}
121+
88122
public static Arena read(String name, ConfigurationSection s) {
89123
if (!s.contains("displayName")) return null;
90124
List<Material> blocks = new ArrayList<>();

Plugin/src/main/java/dev/lrxh/neptune/game/arena/ArenaService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ public void recopyDuplicates(Arena owner) {
162162
}
163163
Bukkit.getScheduler().runTask(Neptune.get(), () -> {
164164
for (Arena dup : dups) {
165+
dup.setBuildLimit(owner.getBuildLimit());
166+
dup.setWhitelistedBlocks(new ArrayList<>(owner.getWhitelistedBlocks()));
167+
dup.setDeathY(owner.getDeathY());
168+
dup.setTime(owner.getTime());
169+
dup.setEnabled(owner.isEnabled());
170+
dup.setAllowedInCustomKit(owner.isAllowedInCustomKit());
165171
dup.capture();
166172
}
167173
});

Plugin/src/main/java/dev/lrxh/neptune/game/arena/VirtualArena.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,36 @@ public VirtualArena(String name,
5858
this.virtualWorld = virtualWorld;
5959
}
6060

61+
@Override
62+
public double getBuildLimit() {
63+
return owner.getBuildLimit();
64+
}
65+
66+
@Override
67+
public List<Material> getWhitelistedBlocks() {
68+
return owner.getWhitelistedBlocks();
69+
}
70+
71+
@Override
72+
public int getDeathY() {
73+
return owner.getDeathY();
74+
}
75+
76+
@Override
77+
public long getTime() {
78+
return owner.getTime();
79+
}
80+
81+
@Override
82+
public boolean isEnabled() {
83+
return owner.isEnabled();
84+
}
85+
86+
@Override
87+
public String getDisplayName() {
88+
return owner.getDisplayName();
89+
}
90+
6191
@Override
6292
public boolean isSetup() {
6393
return redSpawn != null && blueSpawn != null && min != null && max != null && virtualWorld != null;

0 commit comments

Comments
 (0)