Skip to content

Instantly share code, notes, and snippets.

View mworzala's full-sized avatar
👾

Matt Worzala mworzala

👾
View GitHub Profile
package net.hollowcube.terraform.util;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.network.NetworkBuffer;
import net.minestom.server.utils.validate.Check;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
package net.minestom.demo.commands;
import net.minestom.server.command.builder.Command;
import net.minestom.server.command.builder.arguments.ArgumentType;
import net.minestom.server.entity.Player;
import net.minestom.server.item.ItemStack;
import org.jglrxavpok.hephaistos.nbt.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class BedPlacementRule extends BaseBlockPlacementRule {
private static final String PROP_PART = "part";
private static final String PROP_FACING = "facing";
public BedPlacementRule(@NotNull Block block) {
super(block);
}
@Override
public @Nullable Block blockPlace(@NotNull PlacementState placementState) {
public class BlockStackingPlacementRule extends BaseBlockPlacementRule {
private static final int MAX_AMOUNT = 4;
//todo sea pickles should be waterlogged by default if placed in water, otherwise not. I think this is the case for all waterlogg-able blocks.
public static final String CANDLE_PROPERTY = "candles";
public static final String SEA_PICKLE_PROPERTY = "pickles";
public static final String TURTLE_EGGS_PROPERTY = "eggs";
private final String property;
package dev.hollowcube.replay.playback;
import net.minestom.server.entity.*;
import net.minestom.server.network.packet.server.play.EntityMetaDataPacket;
import net.minestom.server.network.packet.server.play.PlayerInfoRemovePacket;
import net.minestom.server.network.packet.server.play.PlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
private void handleConfigPhase(@NotNull AsyncPlayerConfigurationEvent event) {
var player = event.getPlayer();
// Apply the resource pack, making sure not to continue if apply fails.
ResourcePackManager.sendResourcePack(player).join();
if (!player.isOnline()) return;
// Send the registry for the map.
var registry = new HashMap<String, NBT>();
registry.put("minecraft:chat_type", Messenger.chatRegistry());
build --java_language_version=20
build --tool_java_runtime_version=20
build --java_runtime_version=zulu_20
package net.hollowcube.map.item;
import net.minestom.server.entity.PlayerSkin;
import net.minestom.server.tag.Tag;
import net.minestom.server.tag.TagReadable;
import net.minestom.server.tag.TagSerializer;
import net.minestom.server.tag.TagWritable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jglrxavpok.hephaistos.nbt.*;
@mworzala
mworzala / AxiomTerraform.java
Last active April 14, 2025 23:23
Partial Axiom minestom implementation
package net.hollowcube.terraform.compat.axiom;
import it.unimi.dsi.fastutil.longs.LongArrayList;
import net.hollowcube.terraform.util.PaletteUtil;
import net.minestom.server.MinecraftServer;
import net.minestom.server.command.builder.condition.CommandCondition;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.GameMode;
import net.minestom.server.entity.Player;
import net.minestom.server.event.EventNode;
// Credit to https://socket.dev/npm/package/react-native-squircle-skia/files/0.3.2/src/components/Squircle.tsx
public class Squircle implements AutoCloseable {
private final float width, height, smoothing;
private final float tr, br, bl, tl;
private final Path path = new Path();
public Squircle(float width, float height, float smoothing, float borderRadius) {
this(width, height, smoothing, borderRadius, borderRadius, borderRadius, borderRadius);
}