Skip to content

Instantly share code, notes, and snippets.

@echo off
Set /P ver="Choose a version for buildtools: "
java -jar BuildTools.jar --rev %ver%
pause
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class Soup implements Listener{
/**
* By https://github.com/noksblue
public static void main(String[] args) {
String pass = "YourPassword";
if(equalsHashWeb(generateHash(pass), "url")){
//start your application
}
}
public static String generateHash(String password){
StringBuilder builder = new StringBuilder();
@sathonay
sathonay / EntityEnderPearl.java
Last active October 9, 2020 17:42 — forked from iamnoksio/EntityEnderPearl.java
Antipearl glitch in spigot
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.entity.CraftEnderPearl;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EnderpearlLandEvent;
@sathonay
sathonay / PlayerConnection.java
Created June 16, 2019 13:23 — forked from iamnoksio/PlayerMoveEvent.patch
PlayerMoveEvent Optimization
if (this.checkMovement && !this.player.dead) {
// Prevent 40 event-calls for less than a single pixel of movement >.>
double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
// Dont execute move event on head rotation
if (deltaAngle > 10f) {
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
// TODO: PlayerHeadRotationEvent
@sathonay
sathonay / .java
Created June 16, 2019 13:23 — forked from iamnoksio/.java
Here's the god damn "magic" kohi knockback, maybe people can stop believing in magic some day and just play the fucking game. Credit to OCN's SportBukkit for the relog fix (Better fix by Noksio)
knockbackSprintForce = 0.435D;
knockbackSprintHeight = 0.077D;
knockbackFriction = 2.0D;
knockbackForceHeight = 0.38D;
knockbackHeightLimit = 0.4D;
@sathonay
sathonay / Implement 1.7 Hit & Block in 1.8.java
Last active July 18, 2022 02:02
How to implement Hit & Block in 1.8 (like Old Animations)
//Go to net.minecraft.client.renderer.ItemRenderer
//find a code looks like that (for the blockhit animations) :
public void renderItemInFirstPerson(float p_78440_1_)
{
float var2 = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * p_78440_1_);
EntityPlayerSP var3 = this.mc.thePlayer;
float var4 = var3.getSwingProgress(p_78440_1_);
float var5 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * p_78440_1_;
float var6 = var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * p_78440_1_;
//(tested in mcp 910-pre1)
//To have the red armor when a player is hit:
//Go to net.minecraft.client.renderer.entity.layers.LayerArmorBase
public boolean shouldCombineTextures()
{
return false; // replace false -> true
}
@sathonay
sathonay / ResourcePackImageScaler.java
Last active May 8, 2024 10:48
Implement ResourcePackImageScaler (a class by @prplz) in mcp
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class ResourcePackImageScaler {
public static final int SIZE = 64;
public static BufferedImage scalePackImage(BufferedImage image) {
if (image == null) {
return null;
package net.minecraft.client.gui.GuiIngame
private void renderPlayerStats(ScaledResolution p_180477_1_)
{
if (this.mc.getRenderViewEntity() instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)this.mc.getRenderViewEntity();
int i = MathHelper.ceiling_float_int(entityplayer.getHealth());
boolean flag = this.healthUpdateCounter > (long)this.updateCounter && (this.healthUpdateCounter - (long)this.updateCounter) / 3L % 2L == 1L;