Skip to content

Instantly share code, notes, and snippets.

View SupaHam's full-sized avatar

Ali SupaHam

View GitHub Profile
@SupaHam
SupaHam / chat-fixes-2.0.yml
Last active August 29, 2015 14:01
A POC of an implementation of SupaChatAPI's chat fix support (coming soon).
# prefixes will be ordered by lowest prefix-priority
# suffixes will be ordered by lowest prefix-priority
auto-whitespace: true # This will remove the need for '%W%' while keeping one whitespace between each chatfix.
players:
supaham:
prefix-priority: -10000 # prefixes will be ordered by lowest prefix-priority
suffix-priority: 10000 # suffixes will be ordered by lowest prefix-priority
prefix: '[Coolkid]'
suffix: '[YEP]'
groups:
@SupaHam
SupaHam / ArenaCommand
Created August 29, 2014 16:51
This class manages all the commands. WorldEdit's is a tad bit different than this, but this makes it easier to directly register it to bukkit's cmd map.
package com.supaham.powerjuice.commands.arena;
import java.util.Set;
import java.util.stream.Collectors;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.regions.Region;
import com.supaham.powerjuice.PJException;
import com.supaham.powerjuice.PowerJuicePlugin;
import com.supaham.powerjuice.arena.Arena;
@SupaHam
SupaHam / RainbowSky2.java
Last active August 29, 2015 14:11
Create a colourful sky. The SkyColors are best rendered during day. These colors were the best I could find without repeating them. This triggers a rain effect (on the client side), so it would be wise to cover their heads with blocks, especially far above so they don't hear the rain sounds. I'd recommend Barrier blocks at level 256 in adjacent …
package com.supaham.bukkittesting.protolib;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.DARKER_BLUE;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.DARKEST_RED;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.DARK_GOLD;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.LIGHT_SEPIA_BLACK;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.SEPIA_BLACK;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.SEPIA_DARKER_BLACK;
import static com.supaham.bukkittesting.protolib.RainbowSky.SkyColor.SEPIA_DARKEST_BLACK;
@SupaHam
SupaHam / fix-mappings.bat
Last active August 29, 2015 14:17
A script to fix the LVT poop (aka snowmen) symbols being represented as local variables.
SET HASH="73f3c166"
SET JARFILE="work/supa_mapped_%HASH%.jar"
java -jar BuildData/bin/SpecialSource-2.jar map --kill-lvt -i work/minecraft_server.1.8.3.jar -m BuildData/mappings/bukkit-1.8.3-cl.csrg -o %JARFILE%-cl
java -jar BuildData/bin/SpecialSource-2.jar map --kill-lvt -i %JARFILE%-cl -m BuildData/mappings/bukkit-1.8.3-members.csrg -o %JARFILE%-m
java -jar BuildData/bin/SpecialSource.jar --kill-lvt -i %JARFILE%-m --access-transformer BuildData/mappings/bukkit-1.8.3.at -m BuildData/mappings/package.srg -o %JARFILE%
sh mvn install:install-file -Dfile=%JARFILE% -Dpackaging=jar -DgroupId=org.spigotmc -DartifactId=minecraft-server -Dversion=1.8.3-SNAPSHOT
:: This doesn't really help all that much, still need to investigate how to get it to produce
:: the same source to match SpecialSource's jar for IntelliJ IDEA to spot as a source directory
java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -rbr=0 -asc=1 -udv=0 work/decompile-%HASH%/classes work/decompile-%HASH%
@SupaHam
SupaHam / gist:6bc4a0b781e03e7eacd5
Created March 29, 2015 02:30
dmulloy at his finest.
#8 (comment)
Oh gee, thanks mister! I had no idea there was a deprecation annotation, it's not like I've used it before or anything.
PacketWrapper is generated almost completely by a script because honestly I don't have the time or will to create 50+ wrappers. If you do, you're more than welcome to do so.
I reaaally don't appreciate your condescending attitude. This is a FREE tool. I allow anyone to use it free of charge. I don't work for you and I'm under no obligation to make sure your precious old features still work. If you want someone to fix something for you, the absolute worst way to go about it is to be condescending.
Also, thanks for providing examples, it really helps.
@SupaHam
SupaHam / blocks.json
Last active August 29, 2015 14:19
Minecraft Block registry. Indexed mapColors and materials.
{"mapColors":[{"index":0,"color":0},{"index":1,"color":8368696},{"index":2,"color":16247203},{"index":3,"color":10987431},{"index":4,"color":16711680},{"index":5,"color":10526975},{"index":6,"color":10987431},{"index":7,"color":31744},{"index":8,"color":16777215},{"index":9,"color":10791096},{"index":10,"color":12020271},{"index":11,"color":7368816},{"index":12,"color":4210943},{"index":13,"color":6837042},{"index":14,"color":16776437},{"index":15,"color":14188339},{"index":16,"color":11685080},{"index":17,"color":6724056},{"index":18,"color":15066419},{"index":19,"color":8375321},{"index":20,"color":15892389},{"index":21,"color":5000268},{"index":22,"color":10066329},{"index":23,"color":5013401},{"index":24,"color":8339378},{"index":25,"color":3361970},{"index":26,"color":6704179},{"index":27,"color":6717235},{"index":28,"color":10040115},{"index":29,"color":1644825},{"index":30,"color":16445005},{"index":31,"color":6085589},{"index":32,"color":4882687},{"index":33,"color":55610},{"index":34,"color":1381407}
@SupaHam
SupaHam / blocks.json
Last active August 29, 2015 14:19
Minecraft Block registry. Indexed mapColors and materials. (not minified)
{
"mapColors": [
{
"index": 0,
"color": 0
},
{
"index": 1,
"color": 8368696
},
@SupaHam
SupaHam / deploy.py
Last active August 29, 2015 14:20
Server instance deploying script.
#!/usr/bin/python
import os, sys, yaml, shutil
homeDir = "/home/minecraft/"
serversDir = "/home/minecraft/"
dataDir = homeDir + ".deploy/"
srvTemplate = dataDir + "template"
# FILES
mcProps = "server.properties"
@SupaHam
SupaHam / FireworkLauchEvent.java
Last active December 21, 2015 23:59
Listen for firework launch
package com.supaham.fireworkevent;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Called when a firework is launched.
package com.chasechocolate.example;
import java.lang.reflect.Field;
import java.util.HashMap;
import net.minecraft.server.v1_6_R2.DataWatcher;
import net.minecraft.server.v1_6_R2.EntityPlayer;
import net.minecraft.server.v1_6_R2.Packet;
import net.minecraft.server.v1_6_R2.Packet205ClientCommand;
import net.minecraft.server.v1_6_R2.Packet24MobSpawn;