Skip to content

Commit b139df2

Browse files
Merge pull request #73 from ParallelMC/staging
Staging
2 parents a0c9fe4 + 0a235de commit b139df2

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

api/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
group = 'org.parallelmc'
99

10-
version = '4.2.1'
10+
version = '4.2.2'
1111
description = 'A set of utilities and features for use on the Parallel Minecraft server'
1212

1313
java {
@@ -471,5 +471,9 @@ bukkit {
471471
description = 'Gives access to ChestShop debug commands'
472472
setDefault('FALSE')
473473
}
474+
'parallelutils.resources.unenforced' {
475+
description = 'Prevents being kicked from not accepting the resource pack'
476+
setDefault('FALSE')
477+
}
474478
}
475479
}

api/src/main/java/parallelmc/parallelutils/Constants.java

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

33
public class Constants {
44

5-
public static final Version VERSION = new Version(4, 2, 1);
5+
public static final Version VERSION = new Version(4, 2, 2);
66
public static final String PLUGIN_NAME = "ParallelUtils";
77
public static final String DEFAULT_WORLD = "world2";
88
}

modules/src/main/java/parallelmc/parallelutils/modules/parallelresources/ParallelResources.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private List<File> squashFiles(@NotNull List<File> inFiles, @NotNull File resour
362362
out = new File(outDir, f.getName());
363363
Files.copy(f.toPath(), out.toPath());
364364
}
365-
squashed.add(f);
365+
squashed.add(out);
366366
}
367367

368368
purgeDirectory(tempDir.toFile());

modules/src/main/java/parallelmc/parallelutils/modules/parallelresources/ResourceServer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public void configure(HttpsParameters params) {
7171
}
7272
});
7373

74+
server = httpsServer;
75+
7476
} else {
7577
server = HttpServer.create(new InetSocketAddress(port), 0);
7678
}

modules/src/main/java/parallelmc/parallelutils/modules/parallelresources/events/ResourcePackHandle.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ public void onResourcePackStatus(PlayerResourcePackStatusEvent event) {
5454

5555
switch (status) {
5656
case DECLINED -> {
57+
if (event.getPlayer().hasPermission("parallelutils.resources.unenforced")) return;
5758
ParallelUtils.log(Level.WARNING, "Event " + status.toString() + " occurred! Declining join");
5859
event.getPlayer().kick(warningMessage);
5960
}
6061
case FAILED_DOWNLOAD -> {
62+
if (event.getPlayer().hasPermission("parallelutils.resources.unenforced")) return;
6163
ParallelUtils.log(Level.WARNING, "Event " + status.toString() + " occurred! Declining join");
6264
event.getPlayer().kick(warningMessage.append(
6365
Component.text("If you believe this was an error, please contact staff on Discord.")));
@@ -80,7 +82,7 @@ public boolean applyPack(@NotNull Player player) {
8082

8183
String resourceUrl = resources.getResourceUrl(worldName);
8284

83-
player.setResourcePack(resourceUrl, hash, warningMessage, true);
85+
player.setResourcePack(resourceUrl, hash, warningMessage, !player.hasPermission("parallelutils.resources.unenforced"));
8486

8587
return true;
8688
}

0 commit comments

Comments
 (0)