Skip to content

Commit 1a86618

Browse files
idk
1 parent fa2408f commit 1a86618

17 files changed

Lines changed: 1007 additions & 1037 deletions

CLAUDE.md

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
1-
# CLAUDE.md
2-
3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4-
5-
## Build Commands
6-
7-
```bash
8-
# Build the mod (creates JAR in build/libs/)
9-
./gradlew build
10-
11-
# Clean build artifacts
12-
./gradlew clean
13-
14-
# Run Minecraft client with the mod loaded (for testing)
15-
./gradlew runClient
16-
17-
# Run Minecraft server with the mod loaded
18-
./gradlew runServer
19-
20-
# Generate data (datagen)
21-
./gradlew runDatagen
22-
```
23-
24-
## Project Overview
25-
26-
WesterosCraftEssentials is a Fabric mod for Minecraft 1.21.1 that provides server-side gameplay modifications for the WesterosCraft server. It uses mixins to modify vanilla Minecraft behavior.
27-
28-
## Architecture
29-
30-
**Entry Point**: `WesterosCraftEssentials.java` - Implements `ModInitializer`, loads config on initialization.
31-
32-
**Configuration System**: `config/WesterosCraftConfig.java` - JSON-based config stored at `config/westeroscraft-essentials.json`. Static fields are loaded from JSON at startup. To add a new config option:
33-
1. Add static field to `WesterosCraftConfig`
34-
2. Add corresponding field to inner `ConfigData` class
35-
3. Add assignment in `load()` method
36-
37-
**Mixin System**: All mixins are in `westeroscraft.mixin` package and registered in `westeroscraft-essentials.mixins.json`. Mixins inject into vanilla Minecraft classes to:
38-
- Cancel behaviors (e.g., ice melting, snow melting)
39-
- Override survival checks (e.g., allow snow on any surface)
40-
41-
Pattern for adding new block behavior modifications:
42-
1. Create mixin class in `src/main/java/westeroscraft/mixin/`
43-
2. Register mixin in `src/main/resources/westeroscraft-essentials.mixins.json`
44-
3. Add config option to control the behavior
45-
46-
## LuckPerms Integration
47-
48-
Optional permission system integration via `LuckPermsIntegration.java`. LuckPerms must be installed separately on the server.
49-
50-
```java
51-
// Check permission (returns true if LuckPerms not installed - fail-open)
52-
LuckPermsIntegration.hasPermission(serverPlayer, "westeroscraft.somepermission");
53-
54-
// Check permission (returns false if LuckPerms not installed - fail-closed)
55-
LuckPermsIntegration.hasPermissionStrict(serverPlayer, "westeroscraft.somepermission");
56-
```
57-
58-
## Auto-Restore System
59-
60-
The `restore/AutoRestoreManager.java` handles automatic restoration of doors, trapdoors, and fence gates for players with a specific permission. Used for creative servers where guests can interact with doors but changes should revert.
61-
62-
**How it works:**
63-
1. Mixins (`DoorBlockMixin`, `TrapDoorBlockMixin`, `FenceGateBlockMixin`) intercept player interactions
64-
2. If player has the configured permission (default: `westeroscraft.autorestore`), the original state is recorded
65-
3. After a configurable delay, the block reverts to its original state
66-
4. Creative mode players are exempt - their changes are permanent and cancel pending restores
67-
68-
**Config structure** (in `config/westeroscraft-essentials.json`):
69-
```json
70-
{
71-
"autoRestore": {
72-
"enabled": true,
73-
"delaySeconds": 30,
74-
"permission": "westeroscraft.autorestore",
75-
"allDoors": false,
76-
"allGates": false,
77-
"allTrapDoors": false,
78-
"doors": ["minecraft:oak_door"],
79-
"gates": ["minecraft:oak_fence_gate"],
80-
"trapDoors": ["minecraft:oak_trapdoor"]
81-
}
82-
}
83-
```
84-
85-
Use `allDoors`/`allGates`/`allTrapDoors` to apply to all blocks of that type, or specify individual block IDs in the lists.
86-
87-
## Key Dependencies
88-
89-
- Fabric Loader 0.18.4+
90-
- Fabric API
91-
- Minecraft 1.21.1
92-
- Java 21
93-
- LuckPerms API 5.4 (compileOnly - optional runtime dependency)
94-
- Uses official Mojang mappings (not Yarn)
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Build Commands
6+
7+
```bash
8+
# Build the mod (creates JAR in build/libs/)
9+
./gradlew build
10+
11+
# Clean build artifacts
12+
./gradlew clean
13+
14+
# Run Minecraft client with the mod loaded (for testing)
15+
./gradlew runClient
16+
17+
# Run Minecraft server with the mod loaded
18+
./gradlew runServer
19+
20+
# Generate data (datagen)
21+
./gradlew runDatagen
22+
```
23+
24+
## Project Overview
25+
26+
WesterosCraftEssentials is a Fabric mod for Minecraft 1.21.1 that provides server-side gameplay modifications for the WesterosCraft server. It uses mixins to modify vanilla Minecraft behavior.
27+
28+
## Architecture
29+
30+
**Entry Point**: `WesterosCraftEssentials.java` - Implements `ModInitializer`, loads config on initialization.
31+
32+
**Configuration System**: `config/WesterosCraftConfig.java` - JSON-based config stored at `config/westeroscraft-essentials.json`. Static fields are loaded from JSON at startup. To add a new config option:
33+
1. Add static field to `WesterosCraftConfig`
34+
2. Add corresponding field to inner `ConfigData` class
35+
3. Add assignment in `load()` method
36+
37+
**Mixin System**: All mixins are in `westeroscraft.mixin` package and registered in `westeroscraft-essentials.mixins.json`. Mixins inject into vanilla Minecraft classes to:
38+
- Cancel behaviors (e.g., ice melting, snow melting)
39+
- Override survival checks (e.g., allow snow on any surface)
40+
41+
Pattern for adding new block behavior modifications:
42+
1. Create mixin class in `src/main/java/westeroscraft/mixin/`
43+
2. Register mixin in `src/main/resources/westeroscraft-essentials.mixins.json`
44+
3. Add config option to control the behavior
45+
46+
## LuckPerms Integration
47+
48+
Optional permission system integration via `LuckPermsIntegration.java`. LuckPerms must be installed separately on the server.
49+
50+
```java
51+
// Check permission (returns true if LuckPerms not installed - fail-open)
52+
LuckPermsIntegration.hasPermission(serverPlayer, "westeroscraft.somepermission");
53+
54+
// Check permission (returns false if LuckPerms not installed - fail-closed)
55+
LuckPermsIntegration.hasPermissionStrict(serverPlayer, "westeroscraft.somepermission");
56+
```
57+
58+
## Auto-Restore System
59+
60+
The `restore/AutoRestoreManager.java` handles automatic restoration of doors, trapdoors, and fence gates for players with a specific permission. Used for creative servers where guests can interact with doors but changes should revert.
61+
62+
**How it works:**
63+
1. Mixins (`DoorBlockMixin`, `TrapDoorBlockMixin`, `FenceGateBlockMixin`) intercept player interactions
64+
2. If player has the configured permission (default: `westeroscraft.autorestore`), the original state is recorded
65+
3. After a configurable delay, the block reverts to its original state
66+
4. Creative mode players are exempt - their changes are permanent and cancel pending restores
67+
68+
**Config structure** (in `config/westeroscraft-essentials.json`):
69+
```json
70+
{
71+
"autoRestore": {
72+
"enabled": true,
73+
"delaySeconds": 30,
74+
"permission": "westeroscraft.autorestore",
75+
"allDoors": false,
76+
"allGates": false,
77+
"allTrapDoors": false,
78+
"doors": ["minecraft:oak_door"],
79+
"gates": ["minecraft:oak_fence_gate"],
80+
"trapDoors": ["minecraft:oak_trapdoor"]
81+
}
82+
}
83+
```
84+
85+
Use `allDoors`/`allGates`/`allTrapDoors` to apply to all blocks of that type, or specify individual block IDs in the lists.
86+
87+
## Key Dependencies
88+
89+
- Fabric Loader 0.18.4+
90+
- Fabric API
91+
- Minecraft 1.21.1
92+
- Java 21
93+
- LuckPerms API 5.4 (compileOnly - optional runtime dependency)
94+
- Uses official Mojang mappings (not Yarn)

README.md

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,7 @@
1-
# WesterosCraftEssentials
2-
3-
WesterosCraftCore is a custom Fabric mod that handles various requirements for the [WesterosCraft](https://westeroscraft.com) server
4-
5-
6-
## Features
7-
8-
- debugLog = "Debug logging"
9-
- disableIceMelt = "Disable ice melting"
10-
- disableSnowMelt = "Disable snow melting"
11-
- disableLeafFade = "Disable leaf fading"
12-
- disableGrassFadeSpread = "Disable grass fade/spread"
13-
- disableBambooFadeSpread = "Disable bamboo fade/spread"
14-
- bambooSurviveAny = "Allow bamboo survive on any surface"
15-
- disableCropGrowFade = "Disable crop grow/fade"
16-
- cropSurviveAny = "Allow crop survive on any surface"
17-
- disableCactusGrowFade = "Disable cactus grow/fade"
18-
- cactusSurviveAny = "Allow cactus survive on any surface"
19-
- disablePlantGrowFade = "Disable plant grow/fade"
20-
- plantSurviveAny = "Allow plant survive on any surface"
21-
- disableMushroomGrowFade = "Disable mushroom grow/fade"
22-
- mushroomSurviveAny = "Allow mushroom survive on any surface"
23-
- disableNetherWartGrowFade = "Disable netherwart grow/fade"
24-
- disableStemGrowFade = "Disable stem grow/fade"
25-
- disableSugarCaneGrowFade = "Disable sugar cane grow/fade"
26-
- sugarCaneSurviveAny = "Allow sugar cane survive on any surface"
27-
- disableTNTExplode = "Disable TNT explode"
28-
- disableVineGrowFade = "Disable vine grow/fade"
29-
- vineSurviveAny = "Allow vine survive on any surface"
30-
- snowLayerSurviveAny = "Allow snow layer survive on any surface"
31-
- disableFarmStomping = "Disable farmland stomping"
32-
- blockHangingItemChanges = "Prevent item frame, picture interaction outside of creative mode"
33-
- disableFluidTicking = "Disable fluid ticking"
34-
- autoRestore = "Automatically restore door, gate, and trapdoor blocks to auto-restore open state (when changed by non-creative mode players)"
35-
- disableHunger = BUILDER.comment("Disable hunger on players").define("disableHunger", true);
36-
- blockWitherSpawn = "Disable hunger on players"
37-
- patchouliBooks = "What books should be in player inventory (non-creative mode)"
1+
# WesterosCraftEssentials
2+
3+
WesterosCraftEssentials is a custom Fabric mod that handles various requirements for the [WesterosCraft](https://westeroscraft.com) server
4+
5+
6+
## Features
7+

0 commit comments

Comments
 (0)