Skip to content

Instantly share code, notes, and snippets.

View DenWav's full-sized avatar
☂️
Hi

Kyle Wood DenWav

☂️
Hi
View GitHub Profile
CREATE TABLE `stats` (
`namespace_id` int(11) NOT NULL,
`stat_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`world_id` int(11) NOT NULL,
`primary_stat_type_id` int(11) NOT NULL,
`secondary_stat_type_id` int(11) NOT NULL,
`primary_stat_target` varchar(255) NOT NULL,
`secondary_stat_target` varchar(255) NOT NULL,
`value` bigint(20) NOT NULL,
CREATE TABLE `stats` (
`namespace_id` int(11) NOT NULL,
`stat_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`world_id` int(11) NOT NULL,
`primary_stat_type_id` int(11) NOT NULL,
`secondary_stat_type_id` int(11) NOT NULL,
`primary_stat_target` varchar(255) NOT NULL,
`secondary_stat_target` varchar(255) NOT NULL,
`value` bigint(20) NOT NULL,
/*
* StatCraft Bukkit Plugin
*
* Copyright (c) 2016 Kyle Wood (DemonWav)
* https://www.demonwav.com
*
* MIT License
*/
package com.demonwav.statcraft.config
/*
* StatCraft Bukkit Plugin
*
* Copyright (c) 2016 Kyle Wood (DemonWav)
* https://www.demonwav.com
*
* MIT License
*/
package com.demonwav.statcraft.stats;
val result = if (damage == -1) {
query
.from(b)
.where(b.id.eq(id), b.blockid.eq(blockid.toShort()))
.uniqueResult(b.amount.sum())
} else {
query
.from(b)
.where(b.id.eq(id), b.blockid.eq(blockid.toShort()), b.damage.eq(damage.toShort()))
.uniqueResult(b.amount.sum())
From 18a7c61b49b65c2a682a9b8274e0d81e11975cae Mon Sep 17 00:00:00 2001
From: DemonWav <demonwav@gmail.com>
Date: Mon, 29 Feb 2016 19:37:41 -0600
Subject: [PATCH] Add Location support to tab completers (vanilla feature
missing in CraftBukkit)
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 548d570..18c54b3 100644
/home/demonwav/IdeaProjects/StatCraft/src/main/kotlin/com/demonwav/statcraft/StatCraft.kt: (490, 48) org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'use' into
local final fun <anonymous>(player: (Player..Player?)): kotlin.Unit defined in com.demonwav.statcraft.StatCraft.finishPlaytimeAndBed[AnonymousFunctionDescriptor@4ed7c1ce]
{ player ->
val uuid = player.uniqueId
val id = databaseManager.getPlayerId(uuid)
try {
databaseManager.connection.use {
QSeen.seen.runQuery(
{ s, clause -> clause.columns(s.id, s.lastLeaveTime).values(id, currentTime).execute() },
inline fun <T> MutableIterable<T>.iter(func: MutableIterator<T>.(T) -> Unit) {
val iter = iterator()
while (iter.hasNext()) {
val item = iter.next()
iter.func(item)
}
}
fun example() {
inline fun <T> MutableIterable<T>.iter(func: MutableIterator<T>.(T) -> Unit) {
val iter = iterator()
while (iter.hasNext()) {
val item = iter.next()
func(iter, item)
}
}
fun example() {
inline fun <T> MutableIterable<T>.iter(func: MutableIterator<T>.(T) -> Unit) {
val iter = iterator()
while (iter.hasNext()) {
val item = iter.next()
func(iter, item)
}
}
fun example() {