Skip to content

Commit

Permalink
increase width of page container
Browse files Browse the repository at this point in the history
  • Loading branch information
LLytho committed Jul 23, 2024
1 parent fdc60a7 commit 4bd52ea
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
max_line_length = 80
max_line_length = 103

[*.{json,yml,yaml,prettierrc}]
indent_size = 2
8 changes: 6 additions & 2 deletions main/theme/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.VPDoc.has-aside .content-container {
max-width: 800px !important;
:root {
--vp-layout-max-width: 1500px;
}

.content-container {
max-width: 850px !important;
}
5 changes: 1 addition & 4 deletions wikis/lootjs/docs/api/item-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ Combines multiple item filters into one. Matches if all filters match.
- `ItemFilter.allOf(...filters: ItemFilter[])`

```js
ItemFilter.allOf(
ItemFilter.hasEnchantment("minecraft:fortune"),
ItemFilter.equipmentSlotGroup("hand")
)
ItemFilter.allOf(ItemFilter.hasEnchantment("minecraft:fortune"), ItemFilter.equipmentSlotGroup("hand"))
```

### `anyOf`
Expand Down
30 changes: 7 additions & 23 deletions wikis/lootjs/docs/api/loot-condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ LootEntry.of("minecraft:diamond").matchTool("#c:tools")

```js
LootEntry.of("minecraft:diamond").matchTool(
ItemFilter.tag("c:tools").and(
ItemFilter.hasEnchantment("minecraft:fortune", 3)
)
ItemFilter.tag("c:tools").and(ItemFilter.hasEnchantment("minecraft:fortune", 3))
)
```

Expand Down Expand Up @@ -149,10 +147,7 @@ Passes with probability picked from a list of probabilities, indexed by enchantm
- `LootCondition.randomTableBonus(enchantment: Enchantment, probabilities: number[])`

```js
LootEntry.of("minecraft:diamond").randomTableBonus(
"minecraft:fortune",
[0, 0.33, 0.66, 1.0]
)
LootEntry.of("minecraft:diamond").randomTableBonus("minecraft:fortune", [0, 0.33, 0.66, 1.0])
```

## `randomChanceWithEnchantment`
Expand Down Expand Up @@ -206,10 +201,7 @@ If `exact` is set to `true`, it will check if the player is inside the structure
- `LootCondition.matchStructure(structure: string | string[] | tag, exact: boolean)`

```js
LootEntry.of("minecraft:diamond").matchStructure(
["minecraft:stronghold", "minecraft:village"],
false
)
LootEntry.of("minecraft:diamond").matchStructure(["minecraft:stronghold", "minecraft:village"], false)
```

## `isLightLevel`
Expand Down Expand Up @@ -253,9 +245,7 @@ Matches against the entity that died, opened the chest or destroyed the block.
- `LootCondition.matchEntity(predicate: EntityPredicate)`

```js
LootEntry.of("minecraft:diamond").matchEntity(
Predicates.entity().isCrouching(true)
)
LootEntry.of("minecraft:diamond").matchEntity(Predicates.entity().isCrouching(true))
```

## `matchDirectAttacker`
Expand All @@ -267,9 +257,7 @@ Matches against the direct entity which caused the death, e.g. the arrow entity,
- `LootCondition.matchDirectAttacker(predicate: EntityPredicate)`

```js
LootEntry.of("minecraft:diamond").matchDirectAttacker(
Predicates.entity().isCrouching(true)
)
LootEntry.of("minecraft:diamond").matchDirectAttacker(Predicates.entity().isCrouching(true))
```

## `matchAttacker`
Expand All @@ -281,9 +269,7 @@ Matches against the entity which caused the death.
- `LootCondition.matchAttacker(predicate: EntityPredicate)`

```js
LootEntry.of("minecraft:diamond").matchAttacker(
Predicates.entity().isCrouching(true)
)
LootEntry.of("minecraft:diamond").matchAttacker(Predicates.entity().isCrouching(true))
```

## `matchPlayer`
Expand All @@ -295,9 +281,7 @@ Matches against the player. If a player kills another player, it will check agai
- `LootCondition.matchPlayer(predicate: EntityPredicate)`

```js
LootEntry.of("minecraft:diamond").matchPlayer(
Predicates.entity().isCrouching(true)
)
LootEntry.of("minecraft:diamond").matchPlayer(Predicates.entity().isCrouching(true))
```

## `matchPlayerCustom`
Expand Down
44 changes: 18 additions & 26 deletions wikis/lootjs/docs/api/loot-entries-transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ We also can just use a simple item id. LootJS will automatically convert it into

```js
LootJS.lootTables((event) => {
event
.getLootTable("minecraft:chests/simple_dungeon")
.removeItem("minecraft:diamond")
event.getLootTable("minecraft:chests/simple_dungeon").removeItem("minecraft:diamond")
})
```

Expand Down Expand Up @@ -66,9 +64,7 @@ We remove junk from the fishing loot table, no one needs junk.

```js
LootJS.lootTables((event) => {
event
.getLootTable("minecraft:gameplay/fishing")
.removeReference("minecraft:gameplay/fishing/junk")
event.getLootTable("minecraft:gameplay/fishing").removeReference("minecraft:gameplay/fishing/junk")
})
```

Expand Down Expand Up @@ -111,16 +107,14 @@ Modifies all loot entries. Requires to always **return** a loot entry again. You

```js
LootJS.lootTables((event) => {
event
.getLootTable("minecraft:chests/simple_dungeon")
.modifyEntry((entry) => {
if (entry.isItem() && entry.item.id === "minecraft:string") {
entry.setCount([5, 12])
}

// Remember to always return an entry!
return entry
})
event.getLootTable("minecraft:chests/simple_dungeon").modifyEntry((entry) => {
if (entry.isItem() && entry.item.id === "minecraft:string") {
entry.setCount([5, 12])
}

// Remember to always return an entry!
return entry
})
})
```

Expand All @@ -133,16 +127,14 @@ Same as `modifyEntry` but will only iterates through `LootItemEntry`s.

```js
LootJS.lootTables((event) => {
event
.getLootTable("minecraft:chests/simple_dungeon")
.modifyItem((itemEntry) => {
if (itemEntry.item.id === "minecraft:string") {
itemEntry.setCount([5, 12])
}

// Remember to always return an entry!
return itemEntry
})
event.getLootTable("minecraft:chests/simple_dungeon").modifyItem((itemEntry) => {
if (itemEntry.item.id === "minecraft:string") {
itemEntry.setCount([5, 12])
}

// Remember to always return an entry!
return itemEntry
})
})
```

Expand Down
20 changes: 4 additions & 16 deletions wikis/lootjs/docs/api/loot-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ Applies a bonus based on the binomial distribution, where `n = enchantmentLevel
- `LootFunction.applyBinomialDistributionBonus(enchantment, p: number, extra: number)`

```js
LootEntry.of("minecraft:emerald_ore").applyBinomialDistributionBonus(
"minecraft:fortune",
0.2,
3
)
LootEntry.of("minecraft:emerald_ore").applyBinomialDistributionBonus("minecraft:fortune", 0.2, 3)
```

## `applyEnchantmentBonus`
Expand All @@ -94,10 +90,7 @@ LootEntry.of("minecraft:emerald_ore").applyEnchantmentBonus([2, 5])
```

```js
LootEntry.of("minecraft:emerald_ore").applyEnchantmentBonus(
"minecraft:fortune",
[2, 5]
)
LootEntry.of("minecraft:emerald_ore").applyEnchantmentBonus("minecraft:fortune", [2, 5])
```

## `setCount`
Expand Down Expand Up @@ -155,9 +148,7 @@ LootEntry.of("minecraft:emerald_ore").setCustomData({ someCustomStuff: true })
- `LootFunction.setName(name: Component)`

```js
LootEntry.of("minecraft:emerald_ore").setName(
Component.translatable("item.minecraft.emerald_ore")
)
LootEntry.of("minecraft:emerald_ore").setName(Component.translatable("item.minecraft.emerald_ore"))
```

```js
Expand All @@ -177,10 +168,7 @@ LootEntry.of("minecraft:emerald_ore").enchantRandomly()
```

```js
LootEntry.of("minecraft:emerald_ore").enchantRandomly([
"minecraft:fortune",
"minecraft:unbreaking",
])
LootEntry.of("minecraft:emerald_ore").enchantRandomly(["minecraft:fortune", "minecraft:unbreaking"])
```

## `enchantWithLevels`
Expand Down
32 changes: 8 additions & 24 deletions wikis/lootjs/docs/api/loot-modifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Besides actions you can also apply any [loot condition](/api/loot-condition) and

```js
LootJS.modifiers((event) => {
event
.addTableModifier("minecraft:chests/simple_dungeon")
.addLoot("minecraft:gunpowder")
event.addTableModifier("minecraft:chests/simple_dungeon").addLoot("minecraft:gunpowder")
})
```

Expand Down Expand Up @@ -50,9 +48,7 @@ LootJS.modifiers((event) => {
*/
const stickWhenFortune = LootEntry.of("minecraft:stick")
.applyOreBonus("minecraft:fortune")
.when((c) =>
c.matchMainHand(ItemFilter.hasEnchantment("minecraft:fortune"))
)
.when((c) => c.matchMainHand(ItemFilter.hasEnchantment("minecraft:fortune")))

/**
* Second loot entry with a condition. Will drop if the player has silk touch and the first entry doesn't match.
Expand Down Expand Up @@ -104,9 +100,7 @@ LootJS.modifiers((event) => {
/**
* Random chance is 0 so no diamond will ever drop. Just to show, that it will skip all other entries.
*/
const diamondNoDrop = LootEntry.of("minecraft:diamond").when((c) =>
c.randomChance(0.0)
)
const diamondNoDrop = LootEntry.of("minecraft:diamond").when((c) => c.randomChance(0.0))

/**
* No conditions just an item, but this will not drop, because the previous entry failed.
Expand All @@ -116,13 +110,7 @@ LootJS.modifiers((event) => {
event
.addBlockLootModifier("minecraft:coal_ore")
.removeLoot(Ingredient.all)
.addSequenceLoot(
stickWhenFortune,
appleWhenEfficiency,
flint,
diamondNoDrop,
ironIngot
)
.addSequenceLoot(stickWhenFortune, appleWhenEfficiency, flint, diamondNoDrop, ironIngot)
})
```

Expand All @@ -135,9 +123,7 @@ Remove all `items` which matches the given [ItemFilter].

```js
LootJS.modifiers((event) => {
event
.addTableModifier("minecraft:chests/simple_dungeon")
.removeLoot("minecraft:string")
event.addTableModifier("minecraft:chests/simple_dungeon").removeLoot("minecraft:string")
})
```

Expand Down Expand Up @@ -242,11 +228,9 @@ Creates a new nested loot modifier. You can also pre-filter it, so you can only

```js
LootJS.modifiers((event) => {
event
.addTableModifier("minecraft:chests/simple_dungeon")
.group((modifier) => {
// Work with the modifier
})
event.addTableModifier("minecraft:chests/simple_dungeon").group((modifier) => {
// Work with the modifier
})
})
```

Expand Down
Loading

0 comments on commit 4bd52ea

Please sign in to comment.