Skip to content

Instantly share code, notes, and snippets.

View Jo0001's full-sized avatar

Jo0001

  • Germany
  • 05:29 (UTC +02:00)
View GitHub Profile
@Jo0001
Jo0001 / find-packetevents.ps1
Created April 29, 2024 16:35
Fix Unable to grab ViaVersion client version for player!
Add-Type -AssemblyName System.IO.Compression.FileSystem
Write-Host "Checking for plugins using packetevents"
foreach($sourceFile in (Get-ChildItem -filter '*.jar')){
foreach($plContent in [IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries.FullName){
if(($plContent.toString()) -match "packetevents" ){
Write-Host -ForegroundColor Red "Found $($sourceFile)"
break;
}
}

Solve Missing profile public key

You get "Chat disabled due to missing profile public key..." when you try to chat?

Paper/Spigot

Set enforce-secure-profile to false in the server.properties file on 1.19+ servers

Velocity

Set force-key-authentication to false in the velocity.toml file (+ try Legacy Forwarding if it fails with modern)

@Jo0001
Jo0001 / 1.16 & older on 1.18+ servers.md
Last active May 24, 2024 01:52
1.16 & older on 1.18+ servers

1.16 & older on 1.18+ servers

[00:00:00 WARN]: [ViaBackwards] Custom worlds heights are NOT SUPPORTED for 1.16 players and older and may lead to errors! [00:00:00 WARN]: [ViaBackwards] You have min/max set to -64/384

Those messages sound familar to you?

Then you have 3 options:

  1. Only allow 1.17.x players
  2. Use 1.17 as server version (instead of 1.18)
  3. Use a datapack (thats why you're probably here)
package aufgabe;
import java.util.Scanner;
public class Aufgabe {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Scanner scannerInt = new Scanner(System.in);
System.out.println("Wie viele Noten sollen eingeben werden?");
@Jo0001
Jo0001 / idToVersion.java
Last active August 17, 2020 16:28
Method to convert the minecraft protocol id to to the corresponding minecraft versio
/**
* Converts the minecraft protocol id to to the corresponding minecraft version
* @param id minecraft protocol id
* @return minecraft version
*/
public static String idToVersion(final int id){
switch (id) {
case 4:
return "1.7.2-1.7.5";
case 5:
@Jo0001
Jo0001 / example.html
Created March 3, 2020 18:16
Show a nice alertbox
<script src="message.js">
<link rel="stylesheet" type="text/css" href="message.css">
<button onclick="shomess("info","your message")">info</button>
<button onclick="shomess("warn","your message")">warn</button>
<button onclick="shomess("error","your message")">error</button>
<style>
#loader {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
margin: -75px 0 0 -75px;
border: 16px solid rgba(209, 246, 254, 0.63);
border-radius: 50%;
border-top: 16px solid #3498db;
@Jo0001
Jo0001 / data-value.html
Created January 3, 2020 12:18
Get the value of a data- attribute
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<button onclick="showValue()">showValues in console</button>
<p data-test="Max Mustermann">Test1</p>
<p data-test="Paul Mustermann">Test2</p>
@Jo0001
Jo0001 / anzeige.a51
Created November 27, 2019 14:46
Anzeige von 2-stelligen Zahlen mit einer 7-Segmente-Anzeige
;27.11.2019
;Anzeige von 2-stelligen Zahlen mit einer 7-Segmente-Anzeige
einer equ 30h
zehner equ 31h
zahl equ 32h
anz_e equ P1
anz_z equ P0
init:
mov zahl,#0
@Jo0001
Jo0001 / image.php
Created November 7, 2019 15:00
Generate alphabetic character image with PHP
<?php
header("Content-Type: image/png");
$im = @imagecreate(16, 16)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 100);
$text_color = imagecolorallocate($im, 0, 195, 10);
imagestring($im, 5, 4, 0, "A", $text_color);
imagepng($im);