Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2d7ea78
BogoCondition
ZZZank Oct 26, 2024
ff1fd6f
data parser and handlers
ZZZank Oct 26, 2024
bd3e75c
file scanner, let's give it a try
ZZZank Oct 26, 2024
5cc0989
more debug message
ZZZank Oct 26, 2024
8f98c4b
remove ConditionalCompatHandler
ZZZank Oct 26, 2024
fafa633
make `and` and `or` accepts list of conditions
ZZZank Oct 26, 2024
dfb9904
Iron Backpacks support, and make some simple compat data-driven
ZZZank Oct 26, 2024
c738235
correct mod scanning
ZZZank Oct 26, 2024
352327f
allow adding version requirement for mod condition
ZZZank Oct 29, 2024
6e3a5fa
condition presets++
ZZZank Oct 31, 2024
3c26549
additional slot group action prepared for ButtonPos settings
ZZZank Oct 31, 2024
13badb5
utils for data-driven ternary expression and reflection
ZZZank Oct 31, 2024
724e05b
Merge remote-tracking branch 'refs/remotes/upstream/master' into data…
ZZZank Apr 25, 2025
4db9c66
enable FixedLimitSlot
ZZZank Apr 26, 2025
959443d
split condition parsing method to another class
ZZZank Apr 26, 2025
7548bbb
more doc
ZZZank Apr 26, 2025
391f85b
better code structure for BogoCondition
ZZZank Apr 29, 2025
884f7e2
cleanup
ZZZank Apr 29, 2025
18a8efb
more data-driven compat
ZZZank Apr 29, 2025
82fa743
add support for setting button position, rename some classes
ZZZank Apr 29, 2025
a5a46f5
example for `set_button_pos`
ZZZank Apr 29, 2025
fe78a16
load target class earlier
ZZZank May 20, 2025
7fca491
optimize MappedSlotHandler
ZZZank May 20, 2025
ec2841a
better IO error log
ZZZank Jul 1, 2025
af5b5b4
prefer version_range over version_pattern in ModCond
ZZZank Jul 1, 2025
d3852ea
JsonSchema
ZZZank Aug 30, 2025
a8d0ece
complex schema: object, array
ZZZank Aug 30, 2025
d69bd6d
type-dispatch schema
ZZZank Aug 30, 2025
eabc1c7
lazy schema & schema component
ZZZank Aug 30, 2025
d6ad4bd
schema based BogoCondition
ZZZank Aug 30, 2025
cadac7e
schema based BogoCompatHandler
ZZZank Aug 31, 2025
7bf7a8e
implement extracting schema to definitions
ZZZank Aug 31, 2025
1d6a5b1
fix compiling
ZZZank Aug 31, 2025
2d02a69
fix schema definition logic
ZZZank Aug 31, 2025
19478cf
fix schema for DispatchJsonSchema
ZZZank Aug 31, 2025
27a5e68
extract condition schema to `definitions` to handle recursive reference
ZZZank Aug 31, 2025
0e982ff
fix DescribingJsonSchema
ZZZank Aug 31, 2025
ab95a41
generate schema, cleanup unused classes, seal most impl
ZZZank Aug 31, 2025
3925d78
migrate `filter` and `reducer` in MappedSlotHandler to json schema
ZZZank Sep 1, 2025
5603864
move filter compress method to util class, cleanup
ZZZank Sep 1, 2025
6e847fa
more precise json schema for integer
ZZZank Sep 1, 2025
54b097f
fix schema merging for DispatchJsonSchema
ZZZank Sep 1, 2025
f4003ad
generate json schema again
ZZZank Sep 1, 2025
2f6e434
the `required` field in generated sub-schema in DispatchJsonSchema is…
ZZZank Sep 1, 2025
3f93d7f
seal `ObjectJsonSchema`
ZZZank Sep 4, 2025
447ab95
ensure initialization only happens once for LazyJsonSchema
ZZZank Sep 4, 2025
6ba3b2b
more null check
ZZZank Sep 4, 2025
2155bc8
add doc
ZZZank Sep 4, 2025
45409a3
custom button pos setter
ZZZank Sep 5, 2025
fcb7209
fix missing definitions when there's definition references in definition
ZZZank Sep 5, 2025
4d8a831
require `dispatchKey` explicitly in DispatchJsonSchema
ZZZank Sep 5, 2025
e5e9592
misc
ZZZank Sep 5, 2025
5831c85
use `allOf`+`if` instead of `oneOf` for DispatchJsonSchema
ZZZank Sep 5, 2025
d251344
update schema and builtin compat json
ZZZank Sep 5, 2025
3d3d1e8
fix json reading
ZZZank Sep 5, 2025
bdc36e5
add builtin schema for RegEx
ZZZank Sep 7, 2025
81ea728
handle mod with no actual file properly
ZZZank Sep 7, 2025
2f43596
skip action parsing completely when condition not met
ZZZank Sep 11, 2025
f76386e
update schema json
ZZZank Sep 11, 2025
8af0faa
handle definition referenced by definition in a less hacky way
ZZZank Sep 11, 2025
d6ba612
doc
ZZZank Sep 11, 2025
4723960
clarify what the `main(...)` in DataDrivenBogoCompat does
ZZZank Oct 14, 2025
f7282b1
merge parsing and schema gen for a single BogoCompatHandler json into…
ZZZank Oct 14, 2025
d200fbb
remove `mark_only` action
ZZZank Oct 14, 2025
6ab058a
better error message when there's no schema found for certain dispatc…
ZZZank Oct 14, 2025
e69b5ef
Merge remote-tracking branch 'refs/remotes/upstream/master' into data…
ZZZank Oct 14, 2025
db4b9e4
we don't need `BogoCompatHandler.REGISTRY` to be concurrent
ZZZank Oct 15, 2025
71fe714
allow `version_pattern` and `version_range` to work together
ZZZank Oct 15, 2025
c86621a
add in-game command for setting up template file and doing syntax check
ZZZank Oct 15, 2025
1a3a7c9
why's `@Desugar` on non-record classes not throwing error
ZZZank Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 271 additions & 0 deletions dev/actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
# BogoSorter JSON Configuration Wiki

## Action Types

### 1. set_button_pos
Sets the position of the sorting button for a container.

**Properties:**
- `type`: "set_button_pos" (required)
- `condition`: Condition object (optional), see [Condition System](condition.md) for documentation
- `target`: Container class name (required, e.g., "net.minecraft.inventory.Container")
- `pos_setter`: Button position configuration (required), see [Button Position Setters](#button-position-setters) for documentation.

**Example:**
```json
{
"type": "set_button_pos",
"target": "net.minecraft.inventory.Container",
"pos_setter": {
"type": "top_right_horizontal"
}
}
```

### 2. generic
The most basic support for normal containers.

**Properties:**
- `type`: "generic" (required)
- `condition`: Condition object (optional), see [Condition System](condition.md) for documentation
- `target`: Container class name (required)

**Example:**
```json
{
"type": "generic",
"target": "net.minecraft.inventory.Container"
}
```

### 3. slot_mapped
Registers a slot group with custom filtering and conversion rules.

**Properties:**
- `type`: "slot_mapped" (required)
- `condition`: Condition object (optional), see [Condition System](condition.md) for documentation
- `target`: Container class name (required)
- `row_size`: Number of slots per row (required)
- `slot_filter`: Slot filter configuration (optional), see [Slot Filters](#slot-filters)
- `slot_reducer`: Slot converter configuration (optional), see [Slot Reducers](#slot-reducers)

**Example:**
```json
{
"type": "slot_mapped",
"target": "com.example.CustomContainer",
"row_size": 9,
"slot_filter": {
"type": "instanceof",
"class": "com.example.CustomSlot"
}
}
```

### 4. remove
Removes sorting compatibility for a container.

**Properties:**
- `type`: "remove" (required)
- `condition`: Condition object (optional), see [Condition System](condition.md) for documentation
- `target`: Container class name (required)

**Example:**
```json
{
"type": "remove",
"target": "net.minecraft.inventory.Container"
}
```

### 5. slot_range
Registers a slot group for slots within a specific index range.

**Properties:**
- `type`: "slot_range" (required)
- `condition`: Condition object (optional), see [Condition System](condition.md) for documentation
- `target`: Container class name (required)
- `start`: First slot index (inclusive, required)
- `end`: End slot index (exclusive, required)
- `row_size`: Number of slots per row (required)

**Example:**
```json
{
"type": "slot_range",
"target": "net.minecraft.inventory.Container",
"start": 0,
"end": 27,
"row_size": 9
}
```

## Button Position Setters

### 1. top_right_horizontal
Places buttons horizontally at the top-right of the container.

**Properties:**
- `type`: "top_right_horizontal" (required)

**Example:**
```json
{
"type": "top_right_horizontal"
}
```

### 2. top_right_vertical
Places buttons vertically at the top-right of the container.

**Properties:**
- `type`: "top_right_vertical" (required)

**Example:**
```json
{
"type": "top_right_vertical"
}
```

### 3. custom
Custom button positioning.

**Properties:**
- `type`: "custom" (required)
- `at_container_left`: Boolean (required). If `true`, buttons will be placed next to the first slot. If `false`, buttons will be placed next to the last slot in the first row.
- `x_offset`: Integer (required)
- `y_offset`: Integer (required)
- `alignment`: Enum (optional, values: "TOP_LEFT", "BOTTOM_RIGHT", "TOP_RIGHT", "BOTTOM_LEFT")
- `layout`: Enum (optional, values: "VERTICAL", "HORIZONTAL")

**Example:**
```json
{
"type": "custom",
"at_container_left": true,
"x_offset": 5,
"y_offset": 5,
"alignment": "TOP_RIGHT",
"layout": "HORIZONTAL"
}
```

## Slot Filters

### 1. instanceof
Filters slots by class. Will only accept slots that are instance of the specified class.

**Properties:**
- `type`: "instanceof" (required)
- `class`: Class name (required)

**Example:**
```json
{
"type": "instanceof",
"class": "net.minecraft.inventory.Slot"
}
```

### 2. index_in_range
Filters slots by index range.

**Properties:**
- `type`: "index_in_range" (required)
- `start`: Start index (inclusive, required)
- `end`: End index (exclusive, required)

**Example:**
```json
{
"type": "index_in_range",
"start": 0,
"end": 27
}
```

### 3. and
Combines multiple filters with AND logic.

**Properties:**
- `type`: "and" (required)
- `filters`: Array of filter objects (required)

**Example:**
```json
{
"type": "and",
"filters": [
{ "type": "instanceof", "class": "net.minecraft.inventory.Slot" },
{ "type": "index_in_range", "start": 0, "end": 27 }
]
}
```

### 4. or
Combines multiple filters with OR logic.

**Properties:**
- `type`: "or" (required)
- `filters`: Array of filter objects (required)

**Example:**
```json
{
"type": "or",
"filters": [
{ "type": "index_in_range", "start": 0, "end": 9 },
{ "type": "index_in_range", "start": 27, "end": 36 }
]
}
```

### 5. not
Inverts a filter.

**Properties:**
- `type`: "not" (required)
- `filter`: Filter object (required)

**Example:**
```json
{
"type": "not",
"filter": {
"type": "index_in_range",
"start": 0,
"end": 9
}
}
```

## Slot Reducers

### 1. general
Uses default BogoSorter slot representation.

**Properties:**
- `type`: "general" (required)

**Example:**
```json
{
"type": "general"
}
```

### 2. custom_stack_limit
Slot with custom stack size limit.

**Properties:**
- `type`: "custom_stack_limit" (required)
- `limit`: Maximum stack size (required)

**Example:**
```json
{
"type": "custom_stack_limit",
"limit": 16
}
```
Loading