Skip to content

Commit 08a7de7

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 5b94a4c + fd9b627 commit 08a7de7

File tree

19 files changed

+71
-30
lines changed

19 files changed

+71
-30
lines changed

build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,15 @@ dependencies {
4444
api(project(":v1_21_2", io.papermc.paperweight.util.constants.REOBF_CONFIG))
4545
api(project(":v1_21_4", io.papermc.paperweight.util.constants.REOBF_CONFIG))
4646
api(project(":v1_21_5", io.papermc.paperweight.util.constants.REOBF_CONFIG))
47-
//api(project(":v1_21_6", io.papermc.paperweight.util.constants.REOBF_CONFIG))
48-
api(project(":v1_21_6"))
47+
api(project(":v1_21_6", "default"))
4948
}
5049

5150
tasks {
5251
shadowJar {
5352
archiveClassifier = ""
5453
minimize()
5554
manifest {
56-
attributes["paperweight-mappings-namespace"] = io.papermc.paperweight.util.constants.DEOBF_NAMESPACE
55+
attributes["paperweight-mappings-namespace"] = io.papermc.paperweight.util.constants.SPIGOT_NAMESPACE
5756
}
5857
}
5958

core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies {
1616

1717
java {
1818
disableAutoTargetJvm()
19-
toolchain.languageVersion = JavaLanguageVersion.of(21)
19+
toolchain.languageVersion = JavaLanguageVersion.of(24)
2020
}
2121

2222
tasks.compileJava {

core/src/main/java/dev/geco/gsit/event/BlockEventHandler.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@ public BlockEventHandler(GSitMain gSitMain) {
4141

4242
private void handleBlockPistonEvent(BlockPistonEvent event, List<Block> blocks) {
4343
Set<GSeat> moveList = new HashSet<>();
44+
Set<IGPose> breakList = new HashSet<>();
4445
for(Block block : blocks) {
45-
for(GSeat seat : gSitMain.getSitService().getSeatsByBlock(block)) {
46-
if(moveList.contains(seat)) continue;
47-
gSitMain.getSitService().moveSeat(seat, event.getDirection());
48-
moveList.add(seat);
49-
}
46+
moveList.addAll(gSitMain.getSitService().getSeatsByBlock(block));
5047
if(!gSitMain.getConfigService().GET_UP_BREAK) continue;
51-
for(IGPose poseSeat : gSitMain.getPoseService().getPosesByBlock(block)) gSitMain.getPoseService().removePose(poseSeat, GStopReason.BLOCK_BREAK);
48+
breakList.addAll(gSitMain.getPoseService().getPosesByBlock(block));
5249
}
50+
for(GSeat seat : moveList) gSitMain.getSitService().moveSeat(seat, event.getDirection());
51+
for(IGPose poseSeat : breakList) gSitMain.getPoseService().removePose(poseSeat, GStopReason.BLOCK_BREAK);
5352
}
5453

5554
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)

core/src/main/java/dev/geco/gsit/link/WorldGuardLink.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.sk89q.worldguard.protection.flags.Flags;
88
import com.sk89q.worldguard.protection.flags.StateFlag;
99
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
10+
import com.sk89q.worldguard.protection.regions.RegionContainer;
1011
import com.sk89q.worldguard.protection.regions.RegionQuery;
1112
import dev.geco.gsit.GSitMain;
1213
import dev.geco.gsit.link.worldguard.RegionFlagHandler;
@@ -48,7 +49,9 @@ public void unregisterFlagHandlers() {
4849

4950
public boolean canUseInLocation(Location location, Player player, String flag) {
5051
try {
51-
RegionQuery regionQuery = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
52+
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
53+
if(container.get(BukkitAdapter.adapt(location.getWorld())) == null) return true;
54+
RegionQuery regionQuery = container.createQuery();
5255
com.sk89q.worldedit.util.Location regionLocation = BukkitAdapter.adapt(location);
5356
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
5457
// If the player can't ride an entity in the region, we can't use sit anyway

core/src/main/java/dev/geco/gsit/service/DataService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public boolean connect() {
4646

4747
public boolean isConnected() {
4848
try {
49-
if(connection != null && !connection.isClosed()) return true;
49+
if(connection != null && !connection.isClosed() && connection.isValid(5)) return true;
5050
} catch(SQLException ignored) { }
5151
return false;
5252
}
@@ -95,6 +95,7 @@ public ResultSet executeAndGet(String query, Object... parameters) throws SQLExc
9595

9696
private void ensureConnection() throws SQLException {
9797
if(isConnected()) return;
98+
if(reconnect()) return;
9899
if(!reconnect()) throw new SQLException("Failed to reconnect to the " + type + " database.");
99100
}
100101

core/src/main/java/dev/geco/gsit/service/SitService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void handleSafeSeatDismount(GSeat seat) {
170170
if(seat.getSeatEntity().isValid()) gSitMain.getEntityUtil().setEntityLocation(seat.getSeatEntity(), returnLocation);
171171
if(gSitMain.supportsFoliaFeature()) gSitMain.getTaskService().runDelayed(() -> {
172172
if(entity.isValid()) gSitMain.getEntityUtil().setEntityLocation(entity, returnLocation);
173-
}, entity, 0);
173+
}, true, Bukkit.isOwnedByCurrentRegion(entity) ? entity : null, 0);
174174
else if(entity.isValid()) gSitMain.getEntityUtil().setEntityLocation(entity, returnLocation);
175175

176176
entityBlocked.remove(entity.getUniqueId());

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=2.3.3
1+
version=2.4.0
22
group=dev.geco.gsit
33
description=Relax with other players on nice seats!
44

jitpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
jdk:
2-
- openjdk21
2+
- openjdk24

mcv/v1_17_1/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ dependencies {
1010
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION
1111

1212
java {
13-
toolchain.languageVersion = JavaLanguageVersion.of(16)
13+
toolchain.languageVersion = JavaLanguageVersion.of(17)
14+
}
15+
16+
tasks.compileJava {
17+
options.release = 16
1418
}
1519

1620
tasks.assemble {

mcv/v1_18/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ dependencies {
1010
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION
1111

1212
java {
13-
toolchain.languageVersion = JavaLanguageVersion.of(17)
13+
toolchain.languageVersion = JavaLanguageVersion.of(18)
14+
}
15+
16+
tasks.compileJava {
17+
options.release = 17
1418
}
1519

1620
tasks.assemble {

0 commit comments

Comments
 (0)