Skip to content

Instantly share code, notes, and snippets.

View gist:f0e51d2e5c33ef5fd0f84e04e4543267
Creational Patterns:
AbstractFactory ->
Builder -> Used extensively.
FactoryMethod ->
Prototype -> (Archetype, kinda)
Singleton -> (Main plugin instance)
*Multiton -> CatalogTypes
Structural patterns
View gist:62d5eead19d59ec682543de5298faff2
10.01 20:57:12 [Server] Server thread/FATAL Error executing task
10.01 20:57:12 [Server] INFO java.util.concurrent.ExecutionException: java.lang.AbstractMethodError: Method jds/bibliocraft/tileentities/TileEntityTypeMachine.getStackInSlot(I)Lnet/minecraft/item/ItemStack; is abstract
10.01 20:57:12 [Server] INFO at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_151]
10.01 20:57:12 [Server] INFO at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_151]
10.01 20:57:12 [Server] INFO at net.minecraft.util.Util.runTask(SourceFile:47) [h.class:?]
10.01 20:57:12 [Server] INFO at org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:274) [SpongeImplHooks.class:1.12.2-2555-7.1.0-BETA-2825]
10.01 20:57:12 [Server] INFO at net.minecraft.server.MinecraftServer.redirect$onRun$zjg000(MinecraftServer.java:4007) [MinecraftServer.class:?]
10.01 20:57:12 [Server] INFO at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:721) [Minecr
@ryantheleach
ryantheleach / Insane.md
Created Jan 5, 2018
Ryan's insane SpongeAPI Challenge
View Insane.md

Things that are probably impossible to do in SpongeAPI currently, that I see minigames servers and packet interceptors cabable of online.

Most of these I wish I had time to develop plugins for, including API, to create a kick ass server.

  1. Just 'Hide' an entity to a specific set of players.
  2. Exclude a set of players from targeting by AI's, commands, or other players.
  3. Change the appearance of entities/players to other players.
  4. Send "fake" entities that are manually tracked and simulated emulated by a plugin, total control, no performance problems of many copies of entities being tracked in the global entity list, no risk of accidental persistence in saving.
View nightmode.css
@import "theme_variables";
@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
// ######################################
// ### CONFIG
// Annoying purple highlight for pinned topic
$highlighted_topic_id: 2130;
// ######################################
View Home.java
package au.id.rleach.testdata;
import org.spongepowered.api.data.DataContainer;
import org.spongepowered.api.data.DataQuery;
import org.spongepowered.api.data.DataSerializable;
import org.spongepowered.api.data.MemoryDataContainer;
import org.spongepowered.api.data.Queries;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
@ryantheleach
ryantheleach / KeybdHookDebug.ahk
Created Oct 17, 2016
Logitech Gaming Software F13-F24 Keys
View KeybdHookDebug.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#InstallKeybdHook ;https://autohotkey.com/docs/commands/KeyHistory.htm
KeyHistory
;Run script, right click AHK icon in taskbar, Open, View History.
View InteractItemEvent.java
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View gist:ce365dccbced5cf2f7a64efde2d01523
private void spawnTrapHorse(SpawnEntityEvent event) {
event.filterEntities(
entity -> !entity.get(Keys.HORSE_VARIANT)
.filter(HorseVariants.SKELETON_HORSE::equals)
.isPresent()
);
}
View SF Master
[Player776: Set own game mode to Creative Mode]
[07:00:47] [Client thread/INFO]: [CHAT] Your game mode has been updated
[07:00:56] [Server thread/INFO]: <Player776> TNT - Flint and Steel
[07:00:57] [Client thread/INFO]: [CHAT] <Player776> TNT - Flint and Steel
[07:01:03] [Server thread/INFO] [modwiztesting.modwiztesting]: Cause[{Name=Source, Object={BlockSpawnCause{SpawnType=SpongeSpawnType{id=DroppedItem, name=DroppedItem}, BlockSnapshot=SpongeBlockSnapshot{worldUniqueId=0e84b5cb-7357-4bdb-916b-66e911780fd5, position=(263, 66, 271), blockState=minecraft:grass[snowy=false], extendedState=minecraft:grass[snowy=false]}}}}, {Name=Owner, Object={EntityPlayerMP['Player776'/168, l='BedTest', x=262.37, y=75.77, z=269.26]}}]
[07:01:03] [Server thread/INFO] [modwiztesting.modwiztesting]: Cause[{Name=Source, Object={BlockSpawnCause{SpawnType=SpongeSpawnType{id=DroppedItem, name=DroppedItem}, BlockSnapshot=SpongeBlockSnapshot{worldUniqueId=0e84b5cb-7357-4bdb-916b-66e911780fd5, position=(265, 66, 271), blockState=minecra
View Example BlockPredicate DSL.
Types
Traits[]
Data{}
Properties<>
Types
minecraft:leaves //Matches original vanilla leaves.
minecraft:leaves,minecraft:leaves2 //Matches new leaves or old leaves.
minecraft: //matches any vanilla block
buildcraft: // matches any block with buildcraft as the prefix.