Skip to content

Instantly share code, notes, and snippets.

View ItsDoot's full-sized avatar

Christian Hughes ItsDoot

  • Texas, United States
  • 20:29 (UTC -05:00)
View GitHub Profile
@ItsDoot
ItsDoot / _description.md
Last active January 7, 2024 00:17
Bevy + egui in a text-based, turn-based adventure game.

Bevy + egui in a text-based, turn-based adventure game.

I won't go too far into the nitty details (lol), but this is generally how I've structured my WIP mostly-text-based, turn-based adventure game. I emphasize that because I suspect this approach doesn't work all that well for other styles of games. Specifically, because practically everything in my game happens on-click; there's very little running in the background.

TL;DR?

Nah, I strained my eyes for this.

@ItsDoot
ItsDoot / poc.rs
Created August 10, 2022 19:59
Original PoC for filtering by component value
// Query Filter
pub struct Equals<C: Component, Pred: PartialEq<C> + Default> {
_c: PhantomData<*const C>,
_pred: PhantomData<*const Pred>,
}
unsafe impl<C: Component, Pred: PartialEq<C> + Default> WorldQuery for Equals<C, Pred> {
// All the icky internals that I don't know how to write :(
}
@ItsDoot
ItsDoot / MessageChannel.java
Last active September 4, 2020 07:59
chat plugin channel api
package com.expansemc.chatter.api.channel;
import net.kyori.adventure.audience.Audience;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.util.Nameable;
/**
* A {@link Audience} associated by a {@link ResourceKey} and name.
*/
public interface MessageChannel extends Audience, Nameable {
@ItsDoot
ItsDoot / latest.log
Created August 30, 2020 23:20
sqlmanager
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:315) ~[?:1.8.0_252] {}
at org.spongepowered.common.sql.SpongeSqlManager$ConnectionInfo.fromUrl(SpongeSqlManager.java:255) ~[?:?] {re:classloading}
at org.spongepowered.common.sql.SpongeSqlManager.getDataSource(SpongeSqlManager.java:145) ~[?:?] {re:classloading}
at org.spongepowered.common.sql.SpongeSqlManager.getDataSource(SpongeSqlManager.java:137) ~[?:?] {re:classloading}
at com.expansemc.township.plugin.Township.onConstruct(Township.kt:47) ~[?:?] {re:classloading}
at org.spongepowered.common.event.listener.ConstructPluginEventListener_Township_onConstruct3.handle(Unknown Source) ~[?:?] {re:classloading}
at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[main/:?] {re:classloading}
at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:403) ~[main/:?] {re:classloading}
at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventMa
@ItsDoot
ItsDoot / log.txt
Created August 22, 2020 06:27
wat
[01:26:51.837] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher running: args [nogui, --launchTarget, sponge_server_dev]
[01:26:51.848] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_252 by AdoptOpenJDK
[01:26:52.046] [main/INFO] [Plugin/]: SpongePowered PLUGIN Subsystem Version=0.1.1-SNAPSHOT Service=ModLauncher
[01:26:52.054] [main/INFO] [Plugin/]: Plugin language loader 'java_plain' found.
[01:26:52.169] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.1 Source=file:/C:/Users/Christian/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.1-SNAPSHOT/c18aed9fc9d0aff8186004a5c504da897190ed81/mixin-0.8.1-SNAPSHOT.jar Service=ModLauncher Env=SERVER
[01:26:52.255] [main/INFO] [Plugin/]: Discovered '0' [classpath] plugin resource(s) for 'java_plain'.
[01:26:52.262] [main/INFO] [Plugin/]: Discovered '0' [directory] plugin resource(s) for 'java_plain'.
[01:26:52.565] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [org.spongepow
@ItsDoot
ItsDoot / latest.log
Created August 21, 2020 04:11
tada! sponge
[23:08:38.917] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher running: args [nogui, --launchTarget, sponge_server_dev]
[23:08:38.928] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_252 by AdoptOpenJDK
[23:08:39.128] [main/INFO] [Plugin/]: SpongePowered PLUGIN Subsystem Version=0.1.1-SNAPSHOT Service=ModLauncher
[23:08:39.138] [main/INFO] [Plugin/]: Plugin language loader 'java_plain' found.
[23:08:39.257] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.1 Source=file:/C:/Users/Christian/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.1-SNAPSHOT/c18aed9fc9d0aff8186004a5c504da897190ed81/mixin-0.8.1-SNAPSHOT.jar Service=ModLauncher Env=SERVER
[23:08:39.356] [main/INFO] [Plugin/]: Discovered '0' [classpath] plugin resource(s) for 'java_plain'.
[23:08:39.359] [main/INFO] [Plugin/]: Discovered '0' [directory] plugin resource(s) for 'java_plain'.
[23:08:39.676] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [org.spongepow
@ItsDoot
ItsDoot / latest.log
Created August 21, 2020 03:35
hmmmmmmmmmmmmmmm
[22:33:58.397] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher running: args [nogui, --launchTarget, sponge_server_dev]
[22:33:58.408] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_252 by AdoptOpenJDK
[22:33:58.601] [main/INFO] [Plugin/]: SpongePowered PLUGIN Subsystem Version=0.1.1-SNAPSHOT Service=ModLauncher
[22:33:58.609] [main/INFO] [Plugin/]: Plugin language loader 'java_plain' found.
[22:33:58.727] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.1 Source=file:/C:/Users/Christian/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.1-SNAPSHOT/c18aed9fc9d0aff8186004a5c504da897190ed81/mixin-0.8.1-SNAPSHOT.jar Service=ModLauncher Env=SERVER
[22:33:58.814] [main/INFO] [Plugin/]: Discovered '0' [classpath] plugin resource(s) for 'java_plain'.
[22:33:58.818] [main/INFO] [Plugin/]: Discovered '0' [directory] plugin resource(s) for 'java_plain'.
[22:33:59.134] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [org.spongepow
@ItsDoot
ItsDoot / latest.log
Created August 21, 2020 03:31
hmmmmm
[22:29:44.676] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher running: args [nogui, --launchTarget, sponge_server_dev]
[22:29:44.687] [main/INFO] [Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_252 by AdoptOpenJDK
[22:29:44.886] [main/INFO] [Plugin/]: SpongePowered PLUGIN Subsystem Version=0.1.1-SNAPSHOT Service=ModLauncher
[22:29:44.894] [main/INFO] [Plugin/]: Plugin language loader 'java_plain' found.
[22:29:45.008] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.1 Source=file:/C:/Users/Christian/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.1-SNAPSHOT/c18aed9fc9d0aff8186004a5c504da897190ed81/mixin-0.8.1-SNAPSHOT.jar Service=ModLauncher Env=SERVER
[22:29:45.105] [main/INFO] [Plugin/]: Discovered '0' [classpath] plugin resource(s) for 'java_plain'.
[22:29:45.110] [main/INFO] [Plugin/]: Discovered '0' [directory] plugin resource(s) for 'java_plain'.
[22:29:45.406] [main/INFO] [mixin/]: Successfully loaded Mixin Connector [org.spongepow
public final class MinecraftConversions {
public static PistonMoveReaction fromMojang(final PushReaction reaction) {
switch (reaction) {
case NORMAL:
return PistonMoveReaction.MOVE;
case DESTROY:
return PistonMoveReaction.BREAK;
case BLOCK:
return PistonMoveReaction.BLOCK;
@ItsDoot
ItsDoot / CommandTownHere.kt
Created July 5, 2020 08:03
tasty command api
import com.expansemc.township.api.TownshipAPI
import com.expansemc.township.api.claim.Claim
import com.expansemc.township.plugin.util.Texts
import com.expansemc.township.plugin.util.extension.first
import com.expansemc.township.plugin.util.extension.unwrap
import org.spongepowered.api.command.Command
import org.spongepowered.api.command.CommandExecutor
import org.spongepowered.api.command.CommandResult
import org.spongepowered.api.command.exception.CommandException
import org.spongepowered.api.command.parameter.CommandContext