Fix breaking storage drawers with axe. No update required, at least I think.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Steve McMaster 2024-08-06 05:58:44 +00:00
parent f1a3872550
commit 86a1c29baf
7 changed files with 60 additions and 35 deletions

View File

@ -5,5 +5,7 @@ BlockEvents.rightClicked('ags_day_counter:calendar', event => {
let serverDays = parseInt(event.level.dayTime() / 24000.0);
event.player.tell(Component.of('Today is day ').append(Component.green(serverDays)).append('.'))
event.player.tell(Component.of('You have played ').append(Component.green(playTime)).append(' in-game days.'))
event.cancel()
return
});

View File

@ -1,29 +1,29 @@
if (Platform.isLoaded("chipped")) {
ServerEvents.recipes(event => {
event.forEachRecipe({ "mod": "chipped" }, (recipe) => {
if (recipe.getType().getNamespace() == 'chipped') {
let tags = recipe.get('tags')
tags.forEach((tag) => {
let tag_name = tag.split(':')[1]
// if (Platform.isLoaded("chipped")) {
// ServerEvents.recipes(event => {
// event.forEachRecipe({ "mod": "chipped" }, (recipe) => {
// if (recipe.getType().getNamespace() == 'chipped') {
// let tags = recipe.get('tags')
// tags.forEach((tag) => {
// let tag_name = tag.split(':')[1]
Ingredient.of('#' + tag).itemIds.forEach((item) => {
let item_name = item.split(':')[1]
event.custom({
"type": "create:cutting",
"ingredients": [
{ "tag": tag }
],
"results": [
{
"item": item,
"count": 1
}
],
"processingTime": 50
}).id('create:compat/cutting/chipped/' + item_name + '_from_' + tag_name)
})
})
}
})
})
}
// Ingredient.of('#' + tag).itemIds.forEach((item) => {
// let item_name = item.split(':')[1]
// event.custom({
// "type": "create:cutting",
// "ingredients": [
// { "tag": tag }
// ],
// "results": [
// {
// "item": item,
// "count": 1
// }
// ],
// "processingTime": 50
// }).id('create:compat/cutting/chipped/' + item_name + '_from_' + tag_name)
// })
// })
// }
// })
// })
// }

View File

@ -62,4 +62,16 @@ if (Platform.isLoaded('storagedrawers')) {
.id(trim_id)
})
})
}
}
LootJS.modifiers((event) => {
event.enableLogging()
global.storageDrawers.drawerTypes.forEach((drawerType) => {
let trim_id = 'storagedrawers:' + drawerType['name'] + '_trim'
event
.addBlockLootModifier(trim_id)
.survivesExplosion()
.addLoot(trim_id)
})
})

View File

@ -4,6 +4,7 @@ function DirtPathBlock(e, id) {
.mapColor('dirt')
.hardness(0.65)
.soundType('grass')
.tagBlock('minecraft:mineable/shovel')
}
function NetherrackPathBlock(e, id) {

View File

@ -15,11 +15,11 @@ StartupEvents.registry('sound_event', e => {
StartupEvents.registry('item', e => {
Object.keys(music_list).forEach((key) => {
let value = music_list[key]
e.create(`skapa:music_disc_${key}`, "music_disc")
e.create(`skapa:music_disc_${key}`, 'music_disc')
.song(`skapa:music.${key}`, value)
.displayName("Music Disc")
.displayName('Music Disc')
.texture(`skapa:item/music_disc_${key}`)
.tag("creeper_drop_music_discs")
.tag('minecraft:creeper_drop_music_discs')
.translationKey(`skapa:item.skapa.music_disc_${key}`)
})
})

View File

@ -4,6 +4,7 @@ StartupEvents.registry('block', event => {
.fluidTag('minecraft:lava')
.mapColor('color_brown')
.tagBlock('minecraft:soul_speed_blocks')
.tagBlock('minecraft:mineable/shovel')
.hardness(0.5)
.soundType('soul_soil')
})

View File

@ -87,6 +87,8 @@ if (Platform.isLoaded('storagedrawers')) {
'block': event
.createCustom('storagedrawers:' + id, () => new $BlockStandardDrawers(drawerCount, halfDepth, props))
.tag('storagedrawers:drawers')
.tag('minecraft:mineable/axe'),
'trim': false
})
})
})
@ -96,17 +98,24 @@ if (Platform.isLoaded('storagedrawers')) {
'id': id,
'block': event
.createCustom('storagedrawers:' + id, () => new $BlockTrim(props))
.tag('minecraft:mineable/axe'),
'trim': true
})
})
})
StartupEvents.registry('item', event => {
global.storageDrawers.blocks.forEach((block) => {
let item = event
.createCustom('storagedrawers:' + block['id'], () => new $ItemDrawers(block['block'].get(), new $IProperties()))
if (!(block['trim'])) {
item = item.tag('storagedrawers:drawers')
}
global.storageDrawers.items.push({
'id': block['id'],
'item': event
.createCustom('storagedrawers:' + block['id'], () => new $ItemDrawers(block['block'].get(), new $IProperties()))
.tag('storagedrawers:drawers')
'item': item
})
})
})