Compare commits
10 Commits
d9f905d957
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 361c698323 | |||
| db4ea2d69d | |||
| 3cecc58bce | |||
| ce3d50fcb7 | |||
| 61bd28150b | |||
| bb9caa28a3 | |||
| 4b2970d243 | |||
|
834767edbe
|
|||
|
4bea077d36
|
|||
|
74d6ccc24f
|
@@ -116,7 +116,7 @@ class SchematicNode(id: EntityID<Int>) : IntEntity(id) {
|
||||
|
||||
@JvmStatic
|
||||
fun schematicAccessibleForUser(user: SteamwarUser, schematicId: Int?) = fromSql(
|
||||
"WITH RECURSIVE Nodes AS (SELECT NodeId, ParentId as ParentNode FROM NodeMember WHERE UserId = ? UNION SELECT NodeId, ParentNode FROM SchematicNode WHERE NodeOwner = ?), RSN AS ( SELECT NodeId, ParentNode FROM Nodes UNION SELECT SN.NodeId, SN.ParentNode FROM SchematicNode SN, RSN WHERE SN.ParentNode = RSN.NodeId ) SELECT SN.*, ? AS EffectiveOwner FROM RSN INNER JOIN SchematicNode SN ON RSN.NodeId = SN.NodeId WHERE NodeId = ?",
|
||||
"WITH RECURSIVE Nodes AS (SELECT NodeId, ParentId as ParentNode FROM NodeMember WHERE UserId = ? UNION SELECT NodeId, ParentNode FROM SchematicNode WHERE NodeOwner = ?), RSN AS ( SELECT NodeId, ParentNode FROM Nodes UNION SELECT SN.NodeId, SN.ParentNode FROM SchematicNode SN, RSN WHERE SN.ParentNode = RSN.NodeId ) SELECT SN.*, ? AS EffectiveOwner FROM RSN INNER JOIN SchematicNode SN ON RSN.NodeId = SN.NodeId WHERE SN.NodeId = ?",
|
||||
listOf(
|
||||
IntegerColumnType() to user.getId(),
|
||||
IntegerColumnType() to user.getId(),
|
||||
|
||||
@@ -47,9 +47,7 @@ public class ReflectionWrapper21 implements ReflectionWrapper {
|
||||
|
||||
@Override
|
||||
public boolean hasItems(ItemStack stack) {
|
||||
return stack.getDataTypes().stream().filter(FORBIDDEN_TYPES::contains).allMatch(dataComponentType -> {
|
||||
System.out.println(dataComponentType);
|
||||
return true;
|
||||
});
|
||||
FORBIDDEN_TYPES.forEach(stack::resetData);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.dv8tion.jda.api.events.interaction.component.GenericComponentInteract
|
||||
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
|
||||
import net.dv8tion.jda.api.utils.messages.MessageEditData;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
@@ -62,10 +63,17 @@ public class StaticMessageChannel extends DiscordChannel {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if(getChannel().getLatestMessageIdLong() != 0)
|
||||
message = getChannel().getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null);
|
||||
|
||||
VelocityCore.schedule(this::update);
|
||||
if (getChannel().getLatestMessageIdLong() != 0) {
|
||||
message = getChannel().getIterableHistory()
|
||||
.onErrorMap(throwable -> Collections.emptyList())
|
||||
.deadline(System.currentTimeMillis() + 5000)
|
||||
.complete()
|
||||
.stream()
|
||||
.filter(m -> m.getAuthor().isBot())
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
VelocityCore.schedule(this::update).schedule();
|
||||
}
|
||||
|
||||
public void update() {
|
||||
|
||||
Reference in New Issue
Block a user