Skip to content

Instantly share code, notes, and snippets.

View TimWolla's full-sized avatar

Tim Düsterhus TimWolla

View GitHub Profile
package de.evilco.example;
import java.util.logging.*;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
public class Example extends JavaPlugin {
public void onEnable() {
PluginDescriptionFile pdfFile = this.getDescription();
* WingNut hat die Verbindung getrennt (Quit: Do YOU have Charter Internet? If so, you have my sympathy...)
* Scootz hat die Verbindung getrennt (Ping timeout)
* MatthewH12 hat die Verbindung getrennt (Killed (*.GameSurge.net (3)))
* meggiepoo_Miny hat die Verbindung getrennt (Ping timeout)
* VanpoofFluffy-kun_Ol hat die Verbindung getrennt (Ping timeout)
* Do_Da_CHEEKS hat die Verbindung getrennt (Ping timeout)
* BAYBEE_SMILE hat die Verbindung getrennt (Ping timeout)
* GK-Deacon hat die Verbindung getrennt (Ping timeout)
* Tilaron hat die Verbindung getrennt (Quit: No.)
* BlindOldMan hat die Verbindung getrennt (Quit: A parent's only as good as their dumbest kid. If one wins a Nobel Prize but the other gets robbed by a hooker, you failed.)
>php -f "CommunityWarsTest.class.php"
testProtection
Success: Street protects 0
Success: Grass protects 1
Success: Forest protects 2
Success: Mountain protects 4
Success: Cities protect 3
testProduction
if ($this->fowLayer) {
$this->result .= '</div><div class="fowLayer">';
for ($y = 0; $y < $sizeY; $y++) {
for ($x = 0; $x < $sizeX; $x++) {
$startX = $x;
do {
$isFow = isset($fow[serialize(array('x' => $x, 'y' => $y))]);
$x++;
}
while ($isFow && $x < $sizeX);
<div class="contentBox">
<h3 class="subHeadline">9.4.1. Infanterie</h3>
<div style="float: right; padding: 5px;" class="border">
<img src="../wcf/images/communitywars/units/large/red/infantry.png" alt="">
<img src="../wcf/images/communitywars/units/large/blue/infantry.png" alt="">
<img src="../wcf/images/communitywars/units/large/green/infantry.png" alt="">
<img src="../wcf/images/communitywars/units/large/yellow/infantry.png" alt="">
<img src="../wcf/images/communitywars/units/large/black/infantry.png" alt="">
</div>
<p>Infanterie sind die kostengünstigste Einheit im ganzen Spiel. Sie können, neben der <a href="index.php?page=Help&amp;item=communitywars.units.mech">Mech</a>, als einzige Einheit Gebäude erobern. Infanterie haben nur geringe Feuerkraft und Verteidigung sind aber besonders in der Anfangsphase essentiell. Weiterhin haben sie eine recht gute Sichtweite, welche sich auf Bergen sogar auf die eines <a href="index.php?page=Help&amp;item=communitywars.units.recon">Spähers</a> erhöht. Aufgru
<?php
// wcf imports
if (!defined('NO_IMPORTS')) {
require_once(WCF_DIR.'lib/system/cache/source/CacheSource.class.php');
}
/**
* DevNullCacheSource is an implementation of CacheSource that stores the cache in /dev/null.
*
* @author Johannes Donath, Tim Düsterhus
package de.evilco.regainhealthexample;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
public class ExampleEntityListener extends EntityListener {
public void onEntityRegainHealth(EntityRegainHealthEvent event) {
if (((org.bukkit.craftbukkit.entity.CraftPlayer) event.getEntity()).getHandle().ticksLived % 20 * 12 == 0)
event.setCancelled(true);
<?php
// wcf imports
require_once(WCF_DIR.'lib/system/event/EventListener.class.php');
/**
* Shows a thumbnail of a link.
*
* @author Christoph H.
* @copyright 2010 Christoph H.
* @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>
<?php
$color = isset($_GET['color']) ? $_GET['color'] : '999999';
$size = isset($_GET['size']) ? $_GET['size'] : 150;
$im = imagecreatefrompng('schaf.png');
$result = imagecreatetruecolor($size,$size);
$grey = imagecolorat($im, 65, 30);
imagecolorset($im, $grey, hexdec(substr($color, 0, 2)), hexdec(substr($color, 2, 2)), hexdec(substr($color, 4, 2)));
imagecopyresized($result, $im, 0, 0, 0 ,0, $size, $size,150,150);
imagecolortransparent($result, imagecolorallocate($result, 255, 255, 255));
header('Content-Type: image/png');
<?php
$color = isset($_GET['color']) ? $_GET['color'] : '999999';
$size = isset($_GET['size']) ? $_GET['size'] : 150;
$im = imagecreatefrompng('schaf.png');
$result = imagecreatetruecolor($size,$size);
$grey = imagecolorat($im, 65, 30);
imagecolorset($im, $grey, hexdec(substr($color, 0, 2)), hexdec(substr($color, 2, 2)), hexdec(substr($color, 4, 2)));
imagecopyresized($result, $im, 0, 0, 0 ,0, $size, $size,150,150);
imagecolortransparent($result, imagecolorallocate($result, 255, 255, 255));
header('Content-Type: image/png');