Skip to content

Instantly share code, notes, and snippets.

View byteandahalf's full-sized avatar

Byteandahalf byteandahalf

View GitHub Profile
#pragma once
class Item;
class CompoundTag;
class Tile;
class ItemInstance {
public:
short count;
short data;
CompoundTag* userData;
#pragma once
#include <string>
#include <map>
#include "../../TilePos.h"
#include "../../../phys/AABB.h"
#include "../../../phys/Vec3.h"
#include "TileEntityType.h"
class TileSource;
@byteandahalf
byteandahalf / yay.cpp
Last active September 23, 2015 00:25
#include <iostream>
#include <windows.h>
using namespace std;
bool hook() {
return false;
}
int main() {
#include <idc.idc>
static symbol(addr, sym) {
MakeFunction(addr, BADADDR);
if(MakeNameEx(addr, sym, SN_NOWARN)) return;
auto i;
for(i = 0; i < 999; i++) if(MakeNameEx(addr, form("%s_%d", sym, i), SN_NOWARN)) return;
}
static main() {
#pragma once
#include <string>
#include <memory>
#include <vector>
class TileSource;
class Level;
class Entity;
class Material;
@byteandahalf
byteandahalf / TileTessellator.h
Last active August 29, 2015 14:27
Updated TileTessellator header for MCPE 0.12.1
#pragma once
#include <string>
#include <functional>
class Tessellator;
class TilePos;
class Tile;
class TileSource;
class Vec3;
#include "../texture/TextureUVCoordinateSet.h"
@byteandahalf
byteandahalf / Item.h
Last active August 29, 2015 14:27
Item header updated for MCPE 0.12.1
#pragma once
#include <string>
class Tile;
class ItemInstance;
#include "../../client/renderer/texture/TextureUVCoordinateSet.h"
class Entity;
class Player;
class Mob;
@byteandahalf
byteandahalf / Tile.h
Last active September 1, 2015 14:48
Updated Tile header for 0.12.1; Not yet tested.
#pragma once
#include <string>
#include <vector>
class Material;
class TileEntity;
class TilePos;
class TileSource;
#include "../../../client/renderer/texture/TextureUVCoordinateSet.h"
@byteandahalf
byteandahalf / PortalTexture.cpp
Last active August 29, 2015 14:26
PortalTexture::tick
virtual void PortalTexture::tick() {
// copy the next frame of the image into the current frame buffer
// Left shift by 10 is the same as * 1024
// 0x400 = 1024, which is the number of uchars in one frame
// (16*16 pixels, with an RGBA for each pixel)
memcpy(currentFramePixels, pixels[currentFrame << 10], 0x400);
currentFrame++;
if(currentFrame >= frameCount) {
currentFrame = 0;
#pragma once
#include "TextureUVCoordinateSet.h"
class TickingTexture {
public:
// this is the complete struct
// void** vtable;
// this seems like it determines the area of the atlas to be animated