Fix #718 incomplete table_bonus condition

This commit is contained in:
Misode
2025-04-12 16:52:52 +02:00
parent 844cc44ac7
commit 474b2dfe52
4 changed files with 8 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ export function FancyMenu({ placeholder, relative, class: clazz, getResults, chi
}
}, [setActive, inputRef])
return <div class={`px-1 ${relative ? 'relative' : ''}`}>
return <div class={`${relative ? 'relative' : ''}`}>
<div onClick={open}>
{children}
</div>

View File

@@ -591,6 +591,9 @@ const LootConditions: Record<string, (params: any) => LootCondition> = {
},
survives_explosion: () => () => true,
table_bonus: ({ chances }) => (ctx) => {
if (!chances) {
return false
}
const level = 0 // TODO: get enchantment level from tool
const chance = chances[clamp(level, 0, chances.length - 1)]
return ctx.random.nextFloat() < chance

View File

@@ -476,6 +476,9 @@ const LootConditions: Record<string, (params: any) => LootCondition> = {
},
survives_explosion: () => () => true,
table_bonus: ({ chances }) => (ctx) => {
if (!chances) {
return false
}
const level = 0 // TODO: get enchantment level from tool
const chance = chances[clamp(level, 0, chances.length - 1)]
return ctx.random.nextFloat() < chance

View File

@@ -184,7 +184,7 @@ nav li {
display: flex;
align-items: center;
cursor: pointer;
margin: 0 16px;
margin: 0 12px;
fill: var(--nav);
user-select: none;
-webkit-user-select: none;