Merge branch 'main' into VelocityCore/DeleteMemberOfBauDeletingPlayerData
This commit is contained in:
@@ -135,6 +135,13 @@ public class TraceRecorder implements Listener {
|
||||
Iterator<TNTPrimed> iter = trackedTNT.getOrDefault(region, Collections.emptyList()).iterator();
|
||||
while (iter.hasNext()) {
|
||||
TNTPrimed tnt = iter.next();
|
||||
if (tnt.isDead()) {
|
||||
iter.remove();
|
||||
tntSpawnRegion.remove(tnt);
|
||||
historyMap.remove(tnt);
|
||||
tntSpawnRegion.remove(tnt);
|
||||
continue;
|
||||
}
|
||||
if (tnt.getFuseTicks() == 80) continue;
|
||||
TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList());
|
||||
if (record == null) {
|
||||
|
||||
@@ -237,6 +237,7 @@ class EventFight(id: EntityID<Int>) : IntEntity(id), Comparable<EventFight> {
|
||||
|
||||
override fun delete() =
|
||||
useDb {
|
||||
EventRelation.deleteRelations(this@EventFight)
|
||||
super.delete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,10 +159,13 @@ class EventGroup(id: EntityID<Int>) : IntEntity(id) {
|
||||
}
|
||||
|
||||
override fun delete() =
|
||||
useDb { super.delete() }
|
||||
useDb {
|
||||
EventRelation.deleteRelations(this@EventGroup)
|
||||
super.delete()
|
||||
}
|
||||
|
||||
enum class EventGroupType {
|
||||
GROUP_STAGE,
|
||||
ELIMINATION_STAGE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,10 @@ import org.jetbrains.exposed.v1.core.and
|
||||
import org.jetbrains.exposed.v1.core.dao.id.EntityID
|
||||
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
|
||||
import org.jetbrains.exposed.v1.core.eq
|
||||
import org.jetbrains.exposed.v1.core.or
|
||||
import org.jetbrains.exposed.v1.dao.IntEntity
|
||||
import org.jetbrains.exposed.v1.dao.IntEntityClass
|
||||
import org.jetbrains.exposed.v1.jdbc.deleteWhere
|
||||
import org.jetbrains.exposed.v1.jdbc.select
|
||||
|
||||
object EventRelationTable : IntIdTable("EventRelation") {
|
||||
@@ -59,6 +61,23 @@ class EventRelation(id: EntityID<Int>) : IntEntity(id) {
|
||||
fun getGroupRelations(group: EventGroup) =
|
||||
useDb { find { (EventRelationTable.fromId eq group.id.value) and (EventRelationTable.fromType eq FromType.GROUP) }.toList() }
|
||||
|
||||
@JvmStatic
|
||||
fun deleteRelations(fight: EventFight) =
|
||||
useDb {
|
||||
EventRelationTable.deleteWhere {
|
||||
(EventRelationTable.fightId eq fight.id) or
|
||||
((EventRelationTable.fromId eq fight.id.value) and (EventRelationTable.fromType eq FromType.FIGHT))
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun deleteRelations(group: EventGroup) =
|
||||
useDb {
|
||||
EventRelationTable.deleteWhere {
|
||||
(EventRelationTable.fromId eq group.id.value) and (EventRelationTable.fromType eq FromType.GROUP)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun create(fight: EventFight, fightTeam: FightTeam, fromType: FromType, fromId: Int, fromPlace: Int) =
|
||||
useDb {
|
||||
@@ -159,4 +178,4 @@ class EventRelation(id: EntityID<Int>) : IntEntity(id) {
|
||||
enum class FromType {
|
||||
FIGHT, GROUP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,6 +488,27 @@ public final class GameModeConfig<M, W> {
|
||||
*/
|
||||
public final boolean NoFloor;
|
||||
|
||||
/**
|
||||
* Allows Wind Charges to cross the Middle.
|
||||
*
|
||||
* @implSpec {@code false} by default
|
||||
*/
|
||||
public final boolean WindchargesCanCrossMiddle;
|
||||
|
||||
/**
|
||||
* Allows Wind Charge interaction with Blocks.
|
||||
*
|
||||
* @implSpec {@code true} by default
|
||||
*/
|
||||
public final boolean WindchargesInteractWithBlocks;
|
||||
|
||||
/**
|
||||
* Allows Wind Charge to destroy Water.
|
||||
*
|
||||
* @implSpec {@code false} by default
|
||||
*/
|
||||
public final boolean WindchargesDestroyWater;
|
||||
|
||||
private ArenaConfig(YMLWrapper<M, W> loader, SchematicConfig.SizeConfig Size, List<Integer> EnterStages) {
|
||||
loaded = loader.canLoad();
|
||||
WaterDepth = loader.getInt("WaterDepth", 0);
|
||||
@@ -505,6 +526,9 @@ public final class GameModeConfig<M, W> {
|
||||
Leaveable = loader.getBoolean("Leaveable", false);
|
||||
AllowMissiles = loader.getBoolean("AllowMissiles", !EnterStages.isEmpty());
|
||||
NoFloor = loader.getBoolean("NoFloor", false);
|
||||
WindchargesCanCrossMiddle = loader.getBoolean("WindchargesCanCrossMiddle", false);
|
||||
WindchargesInteractWithBlocks = loader.getBoolean("WindchargesInteractWithBlocks", true);
|
||||
WindchargesDestroyWater = loader.getBoolean("WindchargesDestroyWater", false);
|
||||
}
|
||||
|
||||
@ToString
|
||||
|
||||
@@ -64,6 +64,10 @@ Arena:
|
||||
AllowMissiles: false # defaults to true if EnterStages are present otherwise 'false'
|
||||
# Denotes that there is no floor for this GameMode
|
||||
NoFloor: false # defaults to false if missing
|
||||
# Allows Wind Charges to cross the Middle.
|
||||
WindchargesCanCrossMiddle: false # defaults to false if missing
|
||||
# Allows Wind Charge interaction with Blocks.
|
||||
WindchargesInteractWithBlocks: false # defaults to false if missing
|
||||
|
||||
Schematic:
|
||||
# The size of the schematics
|
||||
|
||||
@@ -72,6 +72,9 @@ public class WaterRemover implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void handleEntityExplode(EntityExplodeEvent event) {
|
||||
if (event.getEntityType() == EntityType.WIND_CHARGE && !Config.GameModeConfig.Arena.WindchargesDestroyWater) {
|
||||
return;
|
||||
}
|
||||
event.setYield(0); //No drops (additionally to world config)
|
||||
|
||||
FightTeam spawn = tnt.remove(event.getEntity().getEntityId());
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2026 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
|
||||
@Linked
|
||||
public class WindchargeInteractionDisabler implements Listener {
|
||||
|
||||
public WindchargeInteractionDisabler() {
|
||||
new StateDependentListener(!Config.GameModeConfig.Arena.WindchargesInteractWithBlocks, FightState.Running, this);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void handleEntityExplode(EntityExplodeEvent event) {
|
||||
if (event.getEntityType() != EntityType.WIND_CHARGE) return;
|
||||
event.blockList().clear();
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -23,14 +23,14 @@ import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentTask;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import net.minecraft.world.entity.projectile.windcharge.WindCharge;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.WindCharge;
|
||||
|
||||
@Linked
|
||||
public class WindchargeStopper {
|
||||
|
||||
public WindchargeStopper() {
|
||||
new StateDependentTask(true, FightState.Running, this::run, 1, 1);
|
||||
new StateDependentTask(!Config.GameModeConfig.Arena.WindchargesCanCrossMiddle, FightState.Running, this::run, 1, 1);
|
||||
}
|
||||
|
||||
private static final int middleLine = Config.SpecSpawn.getBlockZ();
|
||||
@@ -39,13 +39,13 @@ public class WindchargeStopper {
|
||||
|
||||
private void run() {
|
||||
Recording.iterateOverEntities(windChargeClass::isInstance, entity -> {
|
||||
Location nextlocation = entity.getLocation().add(entity.getVelocity());
|
||||
Location location = entity.getLocation();
|
||||
Location prevLocation = location.clone().subtract(entity.getVelocity());
|
||||
|
||||
boolean passedMiddle = location.getBlockZ() > middleLine && prevLocation.getBlockZ() > middleLine ||
|
||||
location.getBlockZ() < middleLine && prevLocation.getBlockZ() < middleLine;
|
||||
boolean passedMiddle = nextlocation.getBlockZ() >= middleLine && location.getBlockZ() <= middleLine ||
|
||||
nextlocation.getBlockZ() <= middleLine && location.getBlockZ() >= middleLine;
|
||||
|
||||
if (!passedMiddle) {
|
||||
if (passedMiddle) {
|
||||
entity.remove();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -73,14 +73,19 @@ public class AutoChecker {
|
||||
continue;
|
||||
}
|
||||
|
||||
result.getBlockCounts().merge(material, 1, Integer::sum);
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
|
||||
if (AutoCheckerItems.impl.getInventoryMaterials().contains(material)) {
|
||||
checkInventory(result, block, material, new BlockPos(x, y, z), type);
|
||||
checkInventory(result, block, material, pos, type);
|
||||
if (result.getDispenserItems().getOrDefault(pos, 0) > 0) {
|
||||
result.getBlockCounts().merge(material, 1, Integer::sum);
|
||||
}
|
||||
} else {
|
||||
result.getBlockCounts().merge(material, 1, Integer::sum);
|
||||
}
|
||||
|
||||
if (x == min.x() || x == max.x() || y == max.y() || z == min.z() || z == max.z()) {
|
||||
result.getDesignBlocks().computeIfAbsent(material, m -> new ArrayList<>()).add(new BlockPos(x, y, z));
|
||||
result.getDesignBlocks().computeIfAbsent(material, m -> new ArrayList<>()).add(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,15 +25,15 @@ open class FightServer : DevServer() {
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
var checkSchemID: Int = 0
|
||||
var checkSchemID: Int? = 0
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
var prepareSchemID: Int = 0
|
||||
var prepareSchemID: Int? = 0
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
var replay: Int = 0
|
||||
var replay: Int? = 0
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
@@ -42,7 +42,7 @@ open class FightServer : DevServer() {
|
||||
// Property: fightID
|
||||
@get:Input
|
||||
@get:Optional
|
||||
var eventKampfID: Int = 0
|
||||
var eventKampfID: Int? = 0
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
|
||||
@@ -24,11 +24,11 @@ open class VelocityServer : DevServer() {
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
var packetDecodeLogging: Boolean = false
|
||||
var packetDecodeLogging: Boolean? = false
|
||||
|
||||
init {
|
||||
doFirst {
|
||||
if (packetDecodeLogging) dParams.put("velocity.packet-decode-logging", "true")
|
||||
if (packetDecodeLogging == true) dParams.put("velocity.packet-decode-logging", "true")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user