Skip to content

Instantly share code, notes, and snippets.

View Alemiz112's full-sized avatar

Alemiz Alemiz112

View GitHub Profile
@Alemiz112
Alemiz112 / gdb_tools.py
Created March 13, 2024 11:51
GDB Tools
import gdb
def print_enum(argstr, mapper):
typename = argstr
if not typename or typename.isspace():
raise gdb.GdbError("Usage: print-enum type")
try:
t = gdb.lookup_type(typename)
except gdb.error:
@Alemiz112
Alemiz112 / bedrock_items.json
Created September 6, 2023 12:42
Minecraft Bedrock 1.20 Item Components json
items=[ComponentItemData(name=minecraft:kelp, data={
"components": {
"item_properties": {
"allow_off_hand": 0b,
"animates_in_toolbar": 0b,
"can_destroy_in_creative": 1b,
"creative_category": 4i,
"creative_group": "",
"damage": 0i,
"enchantable_slot": "none",
@Alemiz112
Alemiz112 / PaletteHashTest.java
Last active June 28, 2024 07:45
Example implementation of Minecraft: Bedrock block state network hash computation
public class PaletteHashTest {
private static final int FNV1_32_INIT = 0x811c9dc5;
private static final int FNV1_PRIME_32 = 0x01000193;
public static void main(String[] args) throws Exception {
NbtMap blockState = NbtMap.builder()
.putString("name", "minecraft:bamboo_hanging_sign")
.putCompound("states", NbtMap.builder()
.putInt("facing_direction", 3)
@Alemiz112
Alemiz112 / install.sh
Created September 28, 2022 21:03
FlowAssets dependency setup script for server
#!/usr/bin/env bash
FLOW_ASSETS_SERVER="server_address"
FLOW_ASSETS_TOKEN="your_token"
# Assets downloaded from server
REQUIRED_ASSETS="assets.txt"
# External assets which are not from FA server,
# but rather do use unauthenticated URL
EXTERNAL_DEPENDENCIES="dependencies.txt"
@Alemiz112
Alemiz112 / blocks.txt
Created June 12, 2022 18:57
Cube internal ids
Air 0
Stone 1
Grass Block 2
Dirt 3
Cobblestone 4
Oak Wood Planks 5
Oak Sapling 6
Bedrock 7
Water 8
Still Water 9
@Alemiz112
Alemiz112 / pascal-syntax.md
Last active June 2, 2021 19:13
Pascal Syntax

Logical operators

  • smaller: <
  • greater: >
  • equal: =
  • not equal: <>

Variables

var
 index : Integer;
<?php
function virion_infect(Phar $virus, Phar $host, string $virusName): void{
$host->startBuffering();
/* Check to make sure virion.yml exists in the virion */
if(!isset($virus["virion.yml"])){
echo "virion.yml not found";
return;
@Alemiz112
Alemiz112 / waterdog-address.php
Last active May 6, 2020 11:39
Simple way to check if player is using Waterdog proxy to connect to PMMP server
<?php
use pocketmine\event\Listener;
use pocketmine\event\server\DataPacketReceiveEvent;
use pocketmine\network\mcpe\protocol\LoginPacket;
class ProxyCheck implements Listener {
/**
* List of addresses that may bypass this restriction
<?php
declare(strict_types=1);
/*
* DevTools plugin for PocketMine-MP
* Copyright (C) 2014 PocketMine Team <https://github.com/PocketMine/DevTools>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by