Skip to content

Instantly share code, notes, and snippets.

View BlockyTheDev's full-sized avatar

BlockyTheDev

  • Germany
  • 21:58 (UTC +02:00)
View GitHub Profile
@BlockyTheDev
BlockyTheDev / boxstarter.ps1
Created June 17, 2023 00:52 — forked from MiniDigger/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@BlockyTheDev
BlockyTheDev / license-badges.md
Created February 11, 2023 17:31 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

1. Create a dedicated project to host your Maven repository on Github

For example, you can have a mvn-repo project created.

2. Clone the remote mvn-repo into your local folder

For example, into ~/workspace/mvn-repo folder

3. Build your project and deploy it into your local folder.

In order to do this, you will need to have the following snippet in your pom.xml file

@BlockyTheDev
BlockyTheDev / Main.java
Created June 25, 2022 17:05 — forked from daviga404/Main.java
NMS Reflection: This gist is an example of using reflection to use net.minecraft.server classes to set a block, without the need to import the net.minecraft.server.X.* packages, where X is the current Bukkit version/revision (i.e. v1_6_R2). This way, there will be no need to recompile plugins every time Bukkit releases a new revision.
package com.daviga404.NMSReflection;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@BlockyTheDev
BlockyTheDev / git-maven-howto.md
Created May 18, 2022 20:30 — forked from fernandezpablo85/git-maven-howto.md
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository

Cd into it

How to use github as a maven repository

In this how-to it is being explained how to create a maven repository on github and how to use an existing one.

Creating a repository

  1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2

  2. Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2

@BlockyTheDev
BlockyTheDev / UpdateChecker.java
Created March 12, 2022 18:57 — forked from 2008Choco/UpdateChecker.java
An update checker wrapper for Spigot plugins
import com.google.common.base.Preconditions;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.concurrent.CompletableFuture;
@BlockyTheDev
BlockyTheDev / ChangingUnknownCommand.java
Created February 6, 2022 19:57 — forked from aadnk/ChangingUnknownCommand.java
Change the "unknown command message" with TinyProtocol.
package com.comphenix.example;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import org.json.simple.JSONObject;
public class ChangingUnknownCommand extends JavaPlugin implements Listener {
private MessageTransformer transformer;
@BlockyTheDev
BlockyTheDev / SimpleMinecraftClient.java
Created February 6, 2022 19:57 — forked from aadnk/SimpleMinecraftClient.java
Testing sending custom data through ping packets.
package com.comphenix.test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@BlockyTheDev
BlockyTheDev / ExampleMod.java
Created February 6, 2022 19:56 — forked from aadnk/ExampleMod.java
Intercept the TAB packet without ProtocolLib. Disallow tab completion of command names, but not parameters.
package com.comphenix.example;
import org.bukkit.plugin.java.JavaPlugin;
public class ExampleMod extends JavaPlugin {
private TabInterceptor interceptor;
@Override
public void onEnable() {
// Use ProtocolLib if its present