Skip to content

Commit

Permalink
Supported to short arise define.
Browse files Browse the repository at this point in the history
Add more samples.
  • Loading branch information
cao-awa committed Nov 14, 2024
1 parent b7d0a2a commit f00d9c3
Show file tree
Hide file tree
Showing 24 changed files with 305 additions and 21 deletions.
26 changes: 26 additions & 0 deletions sample/datapacks/tests/data/awa/block/bedrock_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"minecraft:block": {
"description": {
"identifier": "awa:bedrock_block"
},
"components": {
"minecraft:destructible_by_mining": {
"seconds_to_destroy": 3
},
"minecraft:map_color": "#ffffff",
"minecraft:light_emission": 15,
"minecraft:collision_box": {
"origin": [
-8,
0,
-8
],
"size": [
5,
5,
5
]
}
}
}
}
21 changes: 21 additions & 0 deletions sample/datapacks/tests/data/awa/block/conium_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"schema_style": "conium",
"identifier": "awa:conium_block",
"templates": {
"hardness": 10,
"map_color": "#FF0000",
"luminance": 5,
"collision": {
"origin": [
0,
0,
0
],
"size": [
5,
5,
5
]
}
}
}
31 changes: 31 additions & 0 deletions sample/datapacks/tests/data/awa/entity/bedrock_entity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"minecraft:entity" : {
"description": {
"identifier": "awa:bedrock_entity"
},
"components": {
"minecraft:collision_box": {
"height": 1,
"width": 1
},
"minecraft:pushable": {
"is_pushable": true,
"is_pushable_by_piston": true
}
},
"component_groups": {
"awa:g1": {
"minecraft:collision_box": {
"height": 2,
"width": 2
}
},
"awa:g2": {
"minecraft:collision_box": {
"height": 3,
"width": 3
}
}
}
}
}
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions sample/datapacks/tests/data/awa/item/bedrock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"minecraft:item": {
"description": {
"identifier": "awa:bedrock"
},
"components": {
"minecraft:damage": 100,
"minecraft:durability": {
"damage_chance": {
"min": 0,
"max": 100
},
"max_durability": 50
},
"minecraft:can_destroy_in_creative": {
"value": true
},
"minecraft:max_stack_size": {
"value": 64
},
"minecraft:food": {
"can_always_eat": false,
"nutrition": 10,
"saturation_modifier": 1.0,
"using_converts_to": "bowl"
},
"minecraft:rarity": "uncommon",
"minecraft:use_animation": {
"value": "eat"
},
"minecraft:fuel": {
"duration": 3.0
},
"minecraft:glint": {
"value": true
},
"minecraft:wearable": {
"protection": 10,
"slot": "slot.armor.chest"
}
}
}
}
51 changes: 51 additions & 0 deletions sample/datapacks/tests/data/awa/item/conium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"schema_style": "conium",
"identifier": "awa:conium",
"templates": {
"tool": {
"attack_damage": 100,
"attack_speed": -3.0,
"durability": 50,
"effective_blocks": "minecraft:mineable/pickaxe",
"material": "netherite",
"is_weapon": false,
"damage_chance": {
"min": 0,
"max": 0
}
},
"can_destroy_in_creative": true,
"max_count": 64,
"food": {
"can_always_eat": true,
"nutrition": 10,
"saturation": 1.0
},
"consumable": {
"convert_to": "bowl",
"apply_effects": {
"effects": [
{
"id": "minecraft:nausea",
"amplifier": 1,
"duration": 200,
"show_particles": true,
"show_icon": true,
"ambient": true
}
]
}
},
"rarity": "epic",
"use_action": "eat",
"fuel": 60,
"glint": true,
"armor": {
"slot": "chest",
"defense": 10,
"knockback_resistance": 0.1,
"toughness": 10,
"enchantable": 22
}
}
}
9 changes: 9 additions & 0 deletions sample/datapacks/tests/data/awa/property/item/flint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"target": "minecraft:flint",
"components": [
{
"type": "conium:test",
"value": 1234
}
]
}
17 changes: 17 additions & 0 deletions sample/datapacks/tests/data/awa/recipe/test_furnace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"minecraft:recipe_furnace": {
"description": {
"identifier": "awa:test_recipe2"
},
"tags": [
"furnace",
"blast_furnace"
],
"group": "wood",
"input": "minecraft:bedrock",
"output": {
"item": "minecraft:grass_block",
"count": 4
}
}
}
20 changes: 20 additions & 0 deletions sample/datapacks/tests/data/awa/recipe/test_recipe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"minecraft:recipe_shaped": {
"description": {
"identifier": "awa:test_recipe"
},
"group": "wood",
"pattern": [
"###",
" # "
],
"key": {
"#": {
"item": "minecraft:bedrock"
}
},
"result": {
"item": "minecraft:grass_block"
}
}
}
16 changes: 16 additions & 0 deletions sample/datapacks/tests/data/awa/recipe/test_recipe2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"minecraft:recipe_shapeless": {
"description": {
"identifier": "awa:test_recipe2"
},
"group": "wood",
"ingredients": [
"minecraft:grass_block",
"minecraft:grass_block",
"minecraft:grass_block"
],
"result": {
"item": "minecraft:diamond_block"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val random = Random()
request(
SERVER_TICK,
SERVER
).arise { _, server ->
) { _, server ->
server.worlds.forEach { world ->
world.iterateEntities().forEach { entity ->
if (entity != null && entity !is ServerPlayerEntity) {
Expand Down Expand Up @@ -37,7 +37,7 @@ request(
request(
PLACE_BLOCK,
SERVER_WORLD
).arise { _, world ->
) { _, world ->
println(world)

true
Expand All @@ -49,11 +49,11 @@ request(
SERVER_WORLD,
BLOCK_POS,
BLOCK_STATE
).arise { _, world, pos, state ->
) { _, world, pos, state ->
if (state.block === Blocks.BLUE_BED) {
val vec3d: Vec3d = pos.toCenterPos()
world.createExplosion(null, world.getDamageSources().badRespawnPoint(vec3d), null, vec3d, 5.0f, true, World.ExplosionSourceType.BLOCK)
world.createExplosion(null, world.getDamageSources().badRespawnPoint(vec3d), null, vec3d, 200.0f, true, World.ExplosionSourceType.BLOCK)
}

true
}
}
File renamed without changes.
6 changes: 6 additions & 0 deletions sample/datapacks/tests/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"description": "Test pack",
"pack_format": 48
}
}
4 changes: 4 additions & 0 deletions sample/resourcepacks/tests/assets/awa/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"item.awa.conium": "A conium",
"item.awa.bedrock": "A bedrock"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "awa:item/bedrock"
}
}
6 changes: 6 additions & 0 deletions sample/resourcepacks/tests/assets/awa/models/item/conium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "awa:item/conium"
}
}
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions sample/resourcepacks/tests/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"description": "Test resource pack",
"pack_format": 48
}
}
8 changes: 0 additions & 8 deletions sample/scripts/script.conium.kts

This file was deleted.

Loading

0 comments on commit f00d9c3

Please sign in to comment.