Skip to content

Instantly share code, notes, and snippets.

View azenla's full-sized avatar
🏳️‍⚧️
cabbit mode

Alex Zenla azenla

🏳️‍⚧️
cabbit mode
View GitHub Profile
@azenla
azenla / build.gradle
Created July 21, 2013 23:00
Gradle Script for Logan's Sandbox
apply plugin: 'java'
compileJava {
}
jar {
manifest {
attributes('Main-class': '')
}
@azenla
azenla / ThreadDedicatedServer.java
Created July 25, 2013 01:53
ThreadDedicatedServer from MC, notice how it doesn't do what you think.
package net.minecraft.src;
import net.minecraft.server.DedicatedServer;
public final class ThreadDedicatedServer extends Thread {
final DedicatedServer field_96244_a;
public ThreadDedicatedServer(DedicatedServer par1DedicatedServer) {
this.field_96244_a = par1DedicatedServer;
}
@azenla
azenla / clanks.log
Created July 27, 2013 03:29
Log for Clank
18<samrg472> my ip is probably in your history
18<samrg472> from being on it before
18<TheMike> samrg472 Username and password?
20<kaendfinger>30 Probably
18<samrg472> one sec
18<samrg472> I'm going to put that in topic
18<samrg472> soon
18<samrg472> :P
20<kaendfinger>30 IC2 has boats O.o
20<kaendfinger>30 xD
@azenla
azenla / minetweak.cfg
Created July 27, 2013 17:02
Example Minetweak Config
### This is the Minetweak main configuration file ###
# Allows for Whitelisted players to be oped on join
player.autoOp:
# Sets the disconnect message to be displayed to users when the server is stopping
server.stop.message:
# Log Level for Minetweak: Values: INFO/DEBUG/FINE/SEVERE/WARNING
minetweak.log.level: INFO
@azenla
azenla / build.gradle
Created July 27, 2013 18:42
Gradle JCenter Example
apply plugin: 'java'
repositories {
jcenter()
}
dependencies {
compile 'org.minetweak:Minetweak:0.6.5'
}
@azenla
azenla / plugin.json
Created July 27, 2013 19:24
Example Advanced plugin config
{
"name": "TestPlugin",
"main": "org.minetweak.test.TestPlugin",
"description": "A Minetweak Plugin to test loading and other MT functions.",
"subPlugins": [
{
"name": "NoCreeping",
"main": "org.minetweak.plugins.creeping.NoCreeping"
}
],
@azenla
azenla / MultiWorldManager.java
Created July 28, 2013 22:33
MultiWorldManager
package org.minetweak.world;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.*;
import net.minecraft.world.storage.ISaveHandler;
import org.minetweak.Minetweak;
import java.util.ArrayList;
public class MultiWorldManager {
def mainDirectory = new File(getClass().protectionDomain.codeSource.location.path).getParentFile().getParentFile()
def sourceDirectory = new File(mainDirectory, 'src/main/java/org/minetweak')
println('Found Source Directory: ' + sourceDirectory.toString())
int classCount = 0
sourceDirectory.eachFileRecurse {
if (it.getName().endsWith(".java")) {
classCount++
}
}
@azenla
azenla / updateVersion.groovy
Created July 30, 2013 22:50
Minetweak Update Version Script
if (!args.size()==1) {println('Usage: updateVersion.groovy New.Version') ; return}
def mainDir = new File(getClass().protectionDomain.codeSource.location.path).getParentFile().getParentFile()
def newVersion = args[0]
def gradleScript = new File(mainDir, 'build.gradle')
def input = gradleScript.newReader()
def tmpFile = new File('build.gradle.tmp')
def output = new FileWriter(tmpFile)
input.eachLine {
if (it.startsWith('def version')) {
@azenla
azenla / updateVersion.groovy
Last active December 20, 2015 10:39
Minetweak Update Version Script
if (!args.size()==1) {println('Usage: updateVersion.groovy New.Version') ; return}
def mainDir = new File(getClass().protectionDomain.codeSource.location.path).parentFile.parentFile
def gradleScript = new File(mainDir, 'build.gradle')
def tmpFile = new File('build.gradle.tmp')
gradleScript.each {
if (it.startsWith('def version')) {
println 'Found Version: ' + evaluate(it)
it = 'def version = \'' + args[0] + '\''
}