Compare commits

..

No commits in common. "629ab9fba383dd40859967275362f5397155da87" and "6b7dd9f96a615d0755f6b16660bdc00c837767ef" have entirely different histories.

24 changed files with 102 additions and 356 deletions

4
.gitignore vendored
View File

@ -35,6 +35,4 @@ loom-cache/
*.bak
__pycache__/
*.pyc
run-*/
*.pyc

View File

@ -25,21 +25,3 @@ java {
languageVersion = JavaLanguageVersion.of(17)
}
}
loom {
runs {
server {
server()
runDir "run-server"
}
client1 {
client()
runDir "run-1"
}
client2 {
client()
runDir "run-2"
}
}
}

261
chipper
View File

@ -1,226 +1,119 @@
#!/usr/bin/env bash
# Do NOT use `set -e` with Gradle
set -u
RUN_DIR="run"
OPTIONS_SRC="./config/options.txt"
OPTIONS_DST="$RUN_DIR/options.txt"
GRADLE="./gradlew"
GRADLE_BASE_FLAGS=(
GRADLE_FLAGS=(
"--console=plain"
"--no-daemon"
"-Dfabric.development=true"
"-Dminecraft.api.env=dev"
"-Dminecraft.session.disable=true"
"--configuration-cache"
)
OPTIONS_SRC="./config/options.txt"
ROLE=""
ROLE_INDEX=""
PASSTHROUGH=()
# ---------- utils ----------
rand() { shuf -i 0-$(($1 - 1)) -n 1; }
parse_args() {
local cleaned=()
for ((i=0; i<${#ARGS[@]}; i++)); do
case "${ARGS[$i]}" in
-s|--server)
ROLE="server"
;;
-p1|--player1)
ROLE="client"
ROLE_INDEX=1
;;
-p2|--player2)
ROLE="client"
ROLE_INDEX=2
;;
--)
PASSTHROUGH=( "${ARGS[@]:$((i+1))}" )
break
;;
*)
cleaned+=( "${ARGS[$i]}" )
;;
esac
done
ARGS=( "${cleaned[@]}" )
}
# ---------- run-dir helpers ----------
prepare_run_dir() {
local dir="$1"
rm -rf "$dir"
mkdir -p "$dir"
}
# ---------- helpers ----------
inject_options() {
local dir="$1"
# options.txt
if [[ -f "$OPTIONS_SRC" ]]; then
cp "$OPTIONS_SRC" "$dir/options.txt"
fi
# servers.dat (client server list)
if [[ -f "./config/servers.dat" ]]; then
cp "./config/servers.dat" "$dir/servers.dat"
echo "[*] Injecting options.txt..."
cp "$OPTIONS_SRC" "$OPTIONS_DST"
else
echo "[!] Warning: $OPTIONS_SRC not found, skipping injection"
fi
}
ensure_server_files() {
local dir="$1"
[[ -f "$dir/eula.txt" ]] || echo "eula=true" > "$dir/eula.txt"
if [[ ! -f "$dir/server.properties" ]]; then
cat > "$dir/server.properties" <<EOF
online-mode=false
server-port=25565
level-name=world
enable-command-block=true
EOF
ensure_run_dir() {
if [[ ! -d "$RUN_DIR" ]]; then
echo "[*] Creating run directory..."
mkdir -p "$RUN_DIR"
fi
}
# ---------- squirrel ----------
header() {
local action="$1"
local squirrels=(
' /\_/\
( o.o )
> ^ <'
' /\_/\
( -.- )
o_(")(")'
' /\_/\
( @.@ )
> ~ <'
)
# ---------- actions ----------
clean() {
clear
echo "${squirrels[$(rand ${#squirrels[@]})]}"
echo
case "$action" in
run) echo "🐿️ running chipper" ;;
clean) echo "🐿️ cleaning workspace" ;;
build) echo "🐿️ building project" ;;
tree) echo "🐿️ observing project tree" ;;
*) echo "🐿️ thinking..." ;;
esac
echo
echo "[*] Running gradle clean..."
$GRADLE clean "${GRADLE_FLAGS[@]}"
}
# ---------- commands ----------
build() {
clear
cmd_run() {
header run
ensure_run_dir
inject_options
case "$ROLE" in
server)
run_dir="run-server"
prepare_run_dir "$run_dir"
inject_options "$run_dir"
ensure_server_files "$run_dir"
echo "🖥️🐿️ starting dedicated server"
exec "$GRADLE" runServer "${GRADLE_BASE_FLAGS[@]}" "${PASSTHROUGH[@]}"
;;
client)
run_dir="run-$ROLE_INDEX"
task="runClient$ROLE_INDEX"
prepare_run_dir "$run_dir"
inject_options "$run_dir"
echo "🎮🐿️ starting client $ROLE_INDEX"
exec "$GRADLE" "$task" "${GRADLE_BASE_FLAGS[@]}" "${PASSTHROUGH[@]}"
;;
*)
echo "❌🐿️ no role selected"
echo "👉🐿️ use one of:"
echo " --server"
echo " --player1"
echo " --player2"
exit 1
;;
esac
echo "[*] Running client..."
$GRADLE runClient "${GRADLE_FLAGS[@]}"
}
cmd_clean() {
header clean
"$GRADLE" clean "${GRADLE_BASE_FLAGS[@]}" "${PASSTHROUGH[@]}"
}
cmd_build() {
header build
"$GRADLE" build "${GRADLE_BASE_FLAGS[@]}" "${PASSTHROUGH[@]}"
}
cmd_tree() {
header tree
show_tree() {
clear
echo "[*] Project tree (respecting .gitignore):"
tree --gitignore
}
cmd_help() {
cat <<'EOF'
/\_/\
( o.o )
> ^ <
ship() {
clear
echo "[*] Building project..."
$GRADLE build "${GRADLE_FLAGS[@]}"
echo "[+] Build ready to ship."
}
🐿️ C H I P P E R
# ---------- help ----------
help_menu() {
cat <<'EOF'
🐿️ S Q U I R R E L B U I L D T O O L 🐿️
Usage:
./chipper run [role] [-- passthrough]
./chipper [option]
Roles:
-s, --server Start ONLY server
-p1, --player1 Start ONLY client 1
-p2, --player2 Start ONLY client 2
Other commands:
clean Gradle clean
build Gradle build
tree Show project tree
help Show this menu
Examples:
./chipper run --server
./chipper run --player1
./chipper run --player2
./chipper run --player1 -- --debug
./chipper build
./chipper tree
Options:
--clean Run gradle clean
--build Run client (fast path)
--tree Show project tree only
--ship Build project
--help Show this help menu
Notes:
- No legacy player spawning
- Each role has its own run directory
- options.txt injected per run dir
- Everything after `--` is forwarded
- The squirrel is mandatory
- Uses Gradle configuration cache
- Plain console output (no fake progress)
- Safe to Ctrl+C after EXECUTION starts
The squirrel believes in you.
EOF
}
# ---------- entry ----------
# ---------- argument parsing ----------
ARGS=( "$@" )
parse_args
if [[ $# -eq 0 ]]; then
help_menu
exit 0
fi
case "${ARGS[0]:-help}" in
run) cmd_run ;;
clean) cmd_clean ;;
build) cmd_build ;;
tree) cmd_tree ;;
help|-h) cmd_help ;;
case "$1" in
--clean)
clean
;;
--build)
build
;;
--tree)
show_tree
;;
--ship)
ship
;;
--help|-h)
help_menu
;;
*)
echo "[!] Unknown command: ${ARGS[0]}"
cmd_help
echo "[!] Unknown option: $1"
echo ""
help_menu
exit 1
;;
esac

View File

@ -72,8 +72,8 @@ tutorialStep:movement
mouseWheelSensitivity:1.0
rawMouseInput:true
glDebugVerbosity:1
skipMultiplayerWarning:true
skipRealms32bitWarning:true
skipMultiplayerWarning:false
skipRealms32bitWarning:false
hideMatchedNames:true
joinedFirstServer:false
hideBundleTutorial:false

Binary file not shown.

View File

@ -50,9 +50,6 @@ public final class ModTooltips {
if (stack.isOf(ModItems.MEP_MILK))
lines.add(Text.translatable("tooltip.chipi.mep_milk"));
if (stack.isOf(ModItems.PLAYER_MILK))
lines.add(Text.translatable("tooltip.chipi.player_milk"));
// ===== ARMOR =====
if (stack.isOf(ModItems.CHIPPER_HELMET))
lines.add(Text.translatable("tooltip.chipi.chipper_helmet"));

View File

@ -15,10 +15,4 @@ public class ModFoodComponents {
new FoodComponent.Builder()
.alwaysEdible()
.build();
public static final FoodComponent PLAYER_MILK =
new FoodComponent.Builder()
.alwaysEdible()
.build();
}

View File

@ -35,7 +35,6 @@ public class ModItemGroups {
// Food
entries.add(ModItems.MEP_MILK);
entries.add(ModItems.NUT);
entries.add(ModItems.PLAYER_MILK);
// Armor
entries.add(ModItems.CHIPPER_HELMET);

View File

@ -89,17 +89,6 @@ public class ModItems {
new MepMilkItem(new Item.Settings().maxCount(1).recipeRemainder(Items.BUCKET).food(ModFoodComponents.MEP_MILK))
);
public static final Item PLAYER_MILK = Registry.register(
Registries.ITEM,
new Identifier(ChipiMod.MOD_ID, "player_milk"),
new PlayerMilkItem(
new Item.Settings()
.maxCount(1)
.recipeRemainder(Items.BUCKET)
.food(ModFoodComponents.PLAYER_MILK)
)
);
// ===== ARMOR =====
public static final Item CHIPPER_HELMET = Registry.register(

View File

@ -1,51 +0,0 @@
package net.Chipperfluff.chipi.item;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.UseAction;
import net.minecraft.world.World;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.Chipperfluff.chipi.effect.ModEffects;
import net.Chipperfluff.chipi.sound.ModSounds;
import net.minecraft.sound.SoundCategory;
public class PlayerMilkItem extends Item {
public PlayerMilkItem(Settings settings) {
super(settings);
}
@Override
public UseAction getUseAction(ItemStack stack) {
return UseAction.DRINK;
}
@Override
public int getMaxUseTime(ItemStack stack) {
return 32;
}
@Override
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) {
if (!world.isClient && user instanceof PlayerEntity player) {
world.playSound(
null,
player.getBlockPos(),
ModSounds.PLAYER_MILK_SONG,
SoundCategory.PLAYERS,
1.0f,
1.0f
);
}
if (user instanceof PlayerEntity player && !player.getAbilities().creativeMode) {
return new ItemStack(Items.BUCKET);
}
return stack;
}
}

View File

@ -19,17 +19,6 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.minecraft.world.gen.GenerationStep;
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
import net.minecraft.util.ActionResult;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.Chipperfluff.chipi.item.ModItems;
public final class ChipiServerEvents {
@ -44,44 +33,6 @@ public final class ChipiServerEvents {
private ChipiServerEvents() {}
public static void register() {
BiomeModifications.addFeature(
BiomeSelectors.foundInOverworld(),
GenerationStep.Feature.UNDERGROUND_ORES,
RegistryKey.of(
RegistryKeys.PLACED_FEATURE,
new Identifier("chipi", "chipper_ore")
)
);
// ===== PLAYER MILK INTERACTION =====
UseEntityCallback.EVENT.register((player, world, hand, entity, hitResult) -> {
if (world.isClient()) return ActionResult.PASS;
if (!(entity instanceof PlayerEntity target)) return ActionResult.PASS;
if (target == player) return ActionResult.FAIL;
ItemStack stack = player.getStackInHand(hand);
if (!stack.isOf(Items.BUCKET)) return ActionResult.PASS;
stack.decrement(1);
ItemStack milk = new ItemStack(ModItems.PLAYER_MILK);
if (!player.getInventory().insertStack(milk)) {
player.dropItem(milk, false);
}
world.playSound(
null,
player.getBlockPos(),
SoundEvents.ENTITY_COW_MILK,
SoundCategory.PLAYERS,
1.0f,
1.1f
);
return ActionResult.SUCCESS;
});
ServerLifecycleEvents.SERVER_STARTED.register(server -> SERVER = server);
ServerTickEvents.END_SERVER_TICK.register(ChipiServerEvents::tickPlayers);
ServerTickEvents.END_WORLD_TICK.register(ChipiServerEvents::handleVoidFailsafe);

View File

@ -9,7 +9,6 @@ import net.minecraft.util.Identifier;
public class ModSounds {
public static final SoundEvent MEP_MILK = register("entity.mep.milk");
public static final SoundEvent PLAYER_MILK_SONG = register("player_milk_song");
private static SoundEvent register(String id) {
Identifier identifier = new Identifier(ChipiMod.MOD_ID, id);

View File

@ -2,14 +2,18 @@
"death.attack.void_block": "§8%1$s stepped beyond safety — the Outside answered.",
"death.attack.chipi.void_block_fire": "§c%1$s tried to save themselves.§r §8It got worse.",
"itemGroup.chipi.chipi": "Chipi",
"effect.chipi.chipi_blessing": "Chipi's Blessing",
"entity.chipi.mep": "Merp :3",
"block.chipi.void_block": "Void Block",
"block.chipi.chipper_frame": "Chipper Frame",
"block.chipi.chipper_portal": "Chipper Portal",
"block.chipi.chipper_ore": "Chipper Ore",
"block.chipi.chipper_alloy_block": "Chipper Alloy Block",
"itemGroup.chipi.chipi": "Chipi",
"item.chipi.void_block": "Void Block",
"item.chipi.chipper_frame": "Chipper Frame",
"item.chipi.chipper_portal": "Chipper Portal",
@ -19,6 +23,9 @@
"item.chipi.chipper_ingot": "Chipper Ingot",
"item.chipi.chipper_alloy": "Chipper Alloy",
"item.chipi.mep_spawn_egg": "Mep Spawn Egg",
"item.chipi.nut": "Nut",
"item.chipi.mep_milk": "Mep Milk",
"item.chipi.chipper_helmet": "Chipper Helmet",
"item.chipi.chipper_chestplate": "Chipper Chestplate",
@ -31,20 +38,19 @@
"item.chipi.chipper_shovel": "Chipper Shovel",
"item.chipi.chipper_hoe": "Chipper Hoe",
"item.chipi.nut": "Nut",
"item.chipi.mep_milk": "Mep Milk",
"item.chipi.player_milk": "Player Milk",
"tooltip.chipi.void_block": "§8It hums quietly.§r §7You are not supposed to notice that.",
"tooltip.chipi.chipper_frame": "§7Built to hold a mistake.§r §8It is doing its best.",
"tooltip.chipi.chipper_portal": "§5Something on the other side noticed you.§r §8It did not look away.",
"tooltip.chipi.chipper_ore": "§7Common.§r §8Suspiciously so.",
"tooltip.chipi.chipper_alloy_block": "§7Pressed together until it stopped complaining.§r §8Mostly.",
"tooltip.chipi.nut": "§7Probably edible.§r §8Confidence not included.",
"tooltip.chipi.raw_chipper_ore": "§7Still warm to the touch.§r §8That seems unnecessary.",
"tooltip.chipi.chipper_ingot": "§7Dense and stubborn.§r §8Refuses to fail politely.",
"tooltip.chipi.chipper_alloy": "§7Stronger than it looks.§r §8Judges you silently.",
"tooltip.chipi.mep_spawn_egg": "§8It already knows where you are.§r §7Spawning is a courtesy.",
"tooltip.chipi.mep_milk": "§7Temporary comfort in liquid form.§r §8The bucket survives.",
"tooltip.chipi.chipper_helmet": "§7Heavy and awkward.§r §8Feels incomplete alone.",
"tooltip.chipi.chipper_chestplate": "§7Looks like armor.§r §8Does nothing by itself.",
@ -55,9 +61,5 @@
"tooltip.chipi.chipper_pickaxe": "§7Fast bite on stone.§r §8Gives up immediately after.",
"tooltip.chipi.chipper_axe": "§7Clean chop.§r §8Handle resents you.",
"tooltip.chipi.chipper_shovel": "§7Quick dig.§r §8Gravel smells weakness.",
"tooltip.chipi.chipper_hoe": "§7Turns soil fast.§r §8Blunts before the sprouts.",
"tooltip.chipi.nut": "§7Probably edible.§r §8Confidence not included.",
"tooltip.chipi.mep_milk": "§7Temporary comfort in liquid form.§r §8The bucket survives.",
"tooltip.chipi.player_milk": "what the fuck did you just just put in me"
"tooltip.chipi.chipper_hoe": "§7Turns soil fast.§r §8Blunts before the sprouts."
}

View File

@ -1,6 +0,0 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "chipi:item/player_milk"
}
}

View File

@ -3,10 +3,5 @@
"sounds": [
"chipi:mep_milk"
]
},
"player_milk_song": {
"sounds": [
"chipi:player_milk"
]
}
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

View File

@ -1,6 +1,6 @@
{
"type": "fabric:add_features",
"biomes": "#minecraft:is_overworld",
"biomes": "minecraft:overworld",
"features": [
"chipi:chipper_ore"
],

View File

@ -1,8 +1,8 @@
{
"type": "minecraft:ore",
"config": {
"size": 10,
"discard_chance_on_air_exposure": 0.4,
"size": 5,
"discard_chance_on_air_exposure": 0.0,
"targets": [
{
"target": {

View File

@ -12,8 +12,12 @@
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"min_inclusive": { "absolute": -24 },
"max_inclusive": { "absolute": 56 }
"min_inclusive": {
"absolute": 40
},
"max_inclusive": {
"absolute": 64
}
}
},
{