Skip to content

Instantly share code, notes, and snippets.

View TigerHix's full-sized avatar
🎯
Warudo

Tiger Tang TigerHix

🎯
Warudo
View GitHub Profile
@stephan-gh
stephan-gh / [Bukkit] EntityKiller.java
Last active December 19, 2015 17:49
Get the last entity damaged another entity.
public static Entity getLastEntityDamager(Entity entity) {
EntityDamageEvent event = entity.getLastDamageCause();
if (event != null && !event.isCancelled() && (event instanceof EntityDamageByEntityEvent)) {
Entity damager = ((EntityDamageByEntityEvent) event).getDamager();
if (damager instanceof Projectile) {
Object shooter = ((Projectile) damager).getShooter();
if (shooter != null && (shooter instanceof Entity)) return (Entity) shooter;
}
// Add other special cases if necessary
@aadnk
aadnk / LookupExample.java
Last active December 4, 2018 17:03
An alternative to TagAPI.
package com.comphenix.example;
import java.util.Arrays;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@r2d2rigo
r2d2rigo / ExtractZipFile.cs
Last active August 18, 2021 10:05
Using SharpZipLib to extract zip files from Unity in a coroutine-friendly way
// This sample function uses SharpZipLib (http://icsharpcode.github.io/SharpZipLib/) to extract
// a zip file without blocking Unity's main thread. Remember to call it with StartCoroutine().
// Byte data is passed so a MemoryStream object is created inside the function to prevent it
// from being reclaimed by the garbage collector.
public IEnumerator ExtractZipFile(byte[] zipFileData, string targetDirectory, int bufferSize = 256 * 1024)
{
Directory.CreateDirectory(targetDirectory);
using (MemoryStream fileStream = new MemoryStream())
@DarkSeraphim
DarkSeraphim / ActionBarExample.java
Last active November 5, 2015 16:07
Using the ActionBar in 1.8 MC clients (currently written for the Spigot protocol hack). Explanation here: http://www.spigotmc.org/threads/news-bar-over-the-hotbar.30394/#post-345167
package net.darkseraphim.actionbar;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import net.minecraft.server.v1_7_R4.EnumProtocol;
import net.minecraft.server.v1_7_R4.NetworkManager;
import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketPlayOutChat;
import net.minecraft.util.com.google.common.collect.BiMap;
import net.minecraft.util.io.netty.channel.Channel;
@toxicFork
toxicFork / TextureAtlasSlicer.cs
Last active November 24, 2019 08:28
TextureAtlasSlicer.cs
using System;
using System.Collections.Generic;
using System.Xml;
using UnityEditor;
using UnityEngine;
public class TextureAtlasSlicer : EditorWindow {
[MenuItem("CONTEXT/TextureImporter/Slice Sprite Using XML")]
public static void SliceUsingXML(MenuCommand command)
{
@mkotb
mkotb / SimpleScoreboard.java
Last active December 24, 2022 02:29
Non-flickering scoreboard implementation; create scoreboards with ease.
import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.*;
import java.lang.reflect.Constructor;
<?php
namespace shoghicp\MinecraftSimulator\task;
use pocketmine\Player;
use pocketmine\scheduler\PluginTask;
use shoghicp\MinecraftSimulator\Loader;
class MarqueeTask extends PluginTask{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
/// <summary>
/// A simple free camera to be added to a Unity game object.
///
/// Keys:

OldRoot

Chapter 1: Seeding

It all started on July 11th, 2014. User /u/LewisGreen submitted this post to /r/Minecraft. LewisGreen got a private message from /u/OldRoot, containing an image link and the text "This is the beginning. Those who are pure will see what hides in the darkness". The image was a very dark screenshot of Minecraft in the forest, with a silhouette of a character in the background. /u/-Neroren- started the hunt. He brightened the image, revealing a transparent link to a SoundCloud track called "it has begun". It was a .wav sound file, which when run through spectrogram software revealed a message. "silentraven"

@cjddmut
cjddmut / EasingFunctions.cs
Last active July 25, 2024 08:33
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* 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