Skip to content

Instantly share code, notes, and snippets.

@EdGruberman
EdGruberman / sentinel.mrc
Created December 10, 2020 16:01
mIRC TFC Server Management Script
on *:START:{ sentinel.load }
on *:EXIT:{ sentinel.unload }
on *:CONNECT:{ if ( $hget(sentinel.general,autoactivate) == 1 && $hget(sentinel.general.status,activated) != 1 ) sentinel.activate }
alias sentinel.load {
;--Load settings from ini file into hash tables
hmake sentinel.irc 5
hload -i sentinel.irc sentinel.ini irc
if ( $hget(sentinel.irc,admin) == $null ) hadd sentinel.irc admin #clan.private password
if ( $hget(sentinel.irc,tv) == $null ) hadd sentinel.irc tv #clan.tv
if ( $hget(sentinel.irc,monitor) == $null ) hadd sentinel.irc monitor #clan
@EdGruberman
EdGruberman / gist:d8ce793a56b33feca1ee
Last active August 29, 2015 14:23
MSG15 game changer
var target = 58008;
function change(leave, join) {
if (leave != 0) {
console.log('-- leaving game ' + leave);
$J.post(
'http://steamcommunity.com/minigame/ajaxleavegame/'
, { 'gameid' : leave, 'sessionid' : g_sessionID }
).done(
@EdGruberman
EdGruberman / gist:5272807
Created March 29, 2013 18:53
BlockPlaceEvent
Fri 11:52:14 AM [ SEVERE] java.lang.RuntimeException
Fri 11:52:14 AM [ SEVERE] at edgruberman.bukkit.simpletest.Main.printStackTrace(Main.java:29)
Fri 11:52:14 AM [ SEVERE] at edgruberman.bukkit.simpletest.Main.onPlace(Main.java:24)
Fri 11:52:14 AM [ SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Fri 11:52:14 AM [ SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Fri 11:52:14 AM [ SEVERE] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Fri 11:52:14 AM [ SEVERE] at java.lang.reflect.Method.invoke(Unknown Source)
Fri 11:52:14 AM [ SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
Fri 11:52:14 AM [ SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
Fri 11:52:14 AM [ SEVERE] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
@EdGruberman
EdGruberman / gist:5272801
Created March 29, 2013 18:53
PlayerInteractEvent from right clicking on AIR
Fri 11:51:43 AM [ SEVERE] java.lang.RuntimeException
Fri 11:51:43 AM [ SEVERE] at edgruberman.bukkit.simpletest.Main.printStackTrace(Main.java:29)
Fri 11:51:43 AM [ SEVERE] at edgruberman.bukkit.simpletest.Main.onInteract(Main.java:19)
Fri 11:51:43 AM [ SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Fri 11:51:43 AM [ SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Fri 11:51:43 AM [ SEVERE] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Fri 11:51:43 AM [ SEVERE] at java.lang.reflect.Method.invoke(Unknown Source)
Fri 11:51:44 AM [ SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
Fri 11:51:44 AM [ SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
Fri 11:51:44 AM [ SEVERE] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
public void a(String s, Object... aobject) {
// CraftBukkit start - This method is left to satisfy the interface in INetworkManager (which is used for MemoryNetworkManager). If this is called, QuitReason.UNKNOWN will be passed to it.
this.a(s, QuitReason.UNKNOWN, aobject);
}
public void a(String s, QuitReason r, Object... aobject) { // inserted QuitReason parameter
if (this.m) this.reason = r;
// CraftBukkit end
if (this.m) {
this.n = true;
// 1: my preference
public Location getBedSpawnLocation() {
World world = getServer().getWorld(getHandle().spawnWorld);
if (world == null) return null;
ChunkCoordinates bed = getHandle().getBed();
if (bed == null) return null;
if (world.getBlockTypeIdAt(bed.x, bed.y, bed.z) != Material.BED.getId()) return null;
return new Location(world, bed.x, bed.y, bed.z);
}
@EdGruberman
EdGruberman / gist:4480548
Created January 8, 2013 02:28
Minecraft Server Wrapper
<#
powershell.exe -noexit ". 'D:\Documents\Personal\Games\Minecraft\Server\MCS.ps1'"
#>
Add-Type -AssemblyName 'System.Messaging'
Add-Type -AssemblyName 'System.Web'
Add-Type -AssemblyName 'System.Web.Extensions'
@EdGruberman
EdGruberman / gist:4477583
Created January 7, 2013 19:15
ANT file copy
<target name="install" description="Copy built Bukkit plugin JAR to local test server">
<copy file="${plugin.jar}" todir="${install.dir}" verbose="true" />
</target>
@EdGruberman
EdGruberman / gist:4477567
Last active December 10, 2015 18:49
Copy the file
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>install</phase>
+ <goals>
+ <goal>copy-resources</goal>
@EdGruberman
EdGruberman / Inventory.java
Created January 5, 2013 02:56
Inventory.java
package edgruberman.bukkit.simpletest;
import org.bukkit.Bukkit;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.plugin.Plugin;