This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build --java_language_version=20 | |
build --tool_java_runtime_version=20 | |
build --java_runtime_version=zulu_20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} |