Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New mountaineering module #789

Merged
merged 94 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
f19bf28
Added skis and some test functionality
AdequateUsername Aug 8, 2022
421078a
Fixed a typo in _pack.mcmeta
AdequateUsername Aug 8, 2022
48bd046
Fixed a few typos and renamed _pack.mcmeta
AdequateUsername Aug 9, 2022
764abea
Crafting now works
AdequateUsername Aug 9, 2022
ae8e893
Speed boost now (blindly) applied
AdequateUsername Aug 9, 2022
c107fcf
Added (possibly) functionality to give speed
AdequateUsername Aug 9, 2022
4933a31
Gives speed when wearing skis and on snowy block,
AdequateUsername Aug 9, 2022
7062170
Added poles
AdequateUsername Sep 2, 2022
3e45f75
Renamed "Item" (to store NBT) to ski_item and
AdequateUsername Sep 2, 2022
e9a81f1
Added jump boost effects for poles, and removed
AdequateUsername Sep 2, 2022
0e04ff8
Added crampons
AdequateUsername Sep 2, 2022
73c30b1
Given jump boost functionality to crampons
AdequateUsername Sep 2, 2022
b584f79
Response to initial feedback
AdequateUsername Sep 3, 2022
542e7ca
Fixed formatting, attempted adding 'snow detection
AdequateUsername Sep 21, 2022
380a2ef
Working snow detection system (now includes
AdequateUsername Sep 21, 2022
e8ce191
Smarter fall detection system implemented
AdequateUsername Sep 25, 2022
6c6907b
Speed boost applied for travelling downhill using
AdequateUsername Oct 1, 2022
53ffbda
Further speed added for faster descent
AdequateUsername Oct 4, 2022
40b870c
Adjusted recipes and changed poles to be a stick
AdequateUsername Oct 4, 2022
6ef71df
When holding poles, a lower v_y is needed to
AdequateUsername Oct 7, 2022
b40a750
Crampons add slowness, and give a tag when facing
AdequateUsername Oct 23, 2022
00ebfae
Crampons now allow for vertical scaling of walls
AdequateUsername Oct 30, 2022
b611bb5
Shulkers now killed without particles
AdequateUsername Nov 1, 2022
36563a3
General clean-up, and need empty hands to climb
AdequateUsername Nov 1, 2022
002b5b9
Changed advancement name to 'craft skis'
AdequateUsername Nov 5, 2022
309f1bb
Particles added when skiing
AdequateUsername Nov 12, 2022
1be1e09
Player can now look around when climbing, and
AdequateUsername Nov 12, 2022
03a5800
Using poles reduces fall damage
AdequateUsername Nov 12, 2022
f04f70e
Added advancement for reaching maximum speed boost
AdequateUsername Nov 12, 2022
8507683
Some recipe tweaks (but I don't think this is
AdequateUsername Nov 12, 2022
49e2e1b
Shulkers now summoned in a more precise way
AdequateUsername Nov 12, 2022
2019c4a
Simplified shulker killing mechanism
AdequateUsername Nov 12, 2022
50a5699
Changed context for kill_shulkers
AdequateUsername Nov 12, 2022
a7b015a
Removed all "execute run" before function calls
AdequateUsername Nov 12, 2022
59d7497
Crampon removal commands only called once when
AdequateUsername Nov 12, 2022
595d47b
New function to initiate crampon effects
AdequateUsername Nov 12, 2022
e3ef0c4
Check for whether a player stands in front of a
AdequateUsername Nov 12, 2022
15e322d
Further implementation of block tag for check of
AdequateUsername Nov 12, 2022
6a4193b
Moved function calls in main to a new player_main
AdequateUsername Nov 12, 2022
2b42c54
Removed some unnecessary predicate calls
AdequateUsername Nov 12, 2022
e8cdd88
General cleanup
AdequateUsername Nov 12, 2022
1c8a009
Fixed some incorrect headers
AdequateUsername Nov 12, 2022
1c7bd36
Should now use latest custom crafting system
AdequateUsername Nov 19, 2022
a1f8389
Changed poles recipe and advancement names
AdequateUsername Nov 27, 2022
0be60f4
Simplified climbing mechanism
AdequateUsername Nov 27, 2022
0f4bffc
Simplified poles system
AdequateUsername Nov 27, 2022
f820af1
Moved poles to fast_main (renamed from
AdequateUsername Nov 27, 2022
f494fd6
Climbing shulker damage system moved to slow clock
AdequateUsername Nov 27, 2022
c65dbbe
Slowness is now an attribute of crampons
AdequateUsername Nov 27, 2022
5c07787
Changed jump boost conditions with poles:
AdequateUsername Nov 27, 2022
494fd44
Slowness effects called directly from
AdequateUsername Nov 27, 2022
4b64ffb
Expanded range of climbable blocks, and general
AdequateUsername Nov 27, 2022
bf16f80
Ordered climbable_blocks and removed settings.json
AdequateUsername Nov 28, 2022
8851947
Simplified player_main, updated custom crafting loading to
AdequateUsername Nov 28, 2022
931bb34
Moved crampon tag-adding and -removing to main
AdequateUsername Nov 28, 2022
f1379dd
Added a submain function for the fast clock
AdequateUsername Nov 28, 2022
93689db
Moved kill_shulkers into damage_shulkers
AdequateUsername Nov 28, 2022
6733105
Reduced if score subcommands in
AdequateUsername Nov 28, 2022
157a5e6
Reduced score-checking subcommands in
AdequateUsername Nov 28, 2022
fbc035f
Updated contributors.json with my own name
AdequateUsername Nov 28, 2022
7f2a3f7
Updated pack.png, removed pack.svg
AdequateUsername Nov 28, 2022
ada0eb1
Added snowy_blocks block tag and
AdequateUsername Nov 28, 2022
8a92d4c
Removed HideFlags:64 from items
AdequateUsername Nov 28, 2022
5e249de
Summon shulkers high up, then tp down to
AdequateUsername Nov 28, 2022
a68c091
Moved damage_shulkers call to main from
AdequateUsername Nov 30, 2022
53b12c5
Another attempt at teleporting shulkers down
AdequateUsername Nov 30, 2022
e1ea32f
Moved at @s to fast_main from player_fast_main
AdequateUsername Nov 30, 2022
54c1840
Added blank links field to contributors and put
AdequateUsername Nov 30, 2022
6277867
Renamed poles to ski poles
AdequateUsername Nov 30, 2022
9dfd170
Set shulker peek 1t after teleporting to avoid
AdequateUsername Nov 30, 2022
1e2d4d1
minor optimisation to reset_shulker_peek
AdequateUsername Nov 30, 2022
9dd8e59
Empty commit to run workflow
misode Jan 2, 2023
27f1731
Shulkers will no longer spawn in air, and
AdequateUsername Jan 12, 2023
c1f4af2
Merge branch 'master' of https://github.com/AdequateUsername/GM4_Data…
AdequateUsername Jan 12, 2023
aea413c
Crampons provide correct armour
AdequateUsername Jan 12, 2023
6f2b6bc
Easier to maintain speed on flat, but
AdequateUsername Jan 12, 2023
c37aa04
Downhill ski speed effects removed if the player
AdequateUsername Jan 21, 2023
572dd79
Replacing pack.mcmeta with beet.yaml
AdequateUsername May 13, 2023
37ca418
Merge branch 'Gamemode4Dev:master' into master
AdequateUsername May 13, 2023
7dfd450
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapacks
AdequateUsername Aug 13, 2023
6bc48de
Updated beet.yaml to 1.4.0 standard
AdequateUsername Aug 13, 2023
c63c6d2
Revert .vscode/settings.json to how it was
AdequateUsername Aug 14, 2023
0f30b64
Update translations, remove particles
AdequateUsername Aug 14, 2023
8e99c32
A few more formatting tweaks
AdequateUsername Aug 14, 2023
454a803
Made it easier to climb walls of odd-valued height
AdequateUsername Aug 14, 2023
1ec8fc4
Stop add_climbing_effects from running twice when
AdequateUsername Aug 16, 2023
2596765
Velocity updated whenever poles or skis equipped
AdequateUsername Aug 16, 2023
c41a6f1
Add a new tag to track the shulker peek setting
AdequateUsername Aug 16, 2023
c39f915
Rename 'Ski Poles' to 'Ski Pole'. Note the item is
AdequateUsername Aug 16, 2023
11a4001
Ski pole unstackable, and a scoreboard-based way
AdequateUsername Aug 17, 2023
ecdbf1c
Can only craft one ski pole at a time
AdequateUsername Aug 17, 2023
6003eb0
Add Experimental Module Note
Bloo-dev Aug 21, 2023
32955ff
Add a README
AdequateUsername Aug 22, 2023
f7ab140
Merge branch 'Gamemode4Dev:master' into master
AdequateUsername Sep 3, 2023
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
43 changes: 43 additions & 0 deletions gm4_mountaineering/data/gm4/advancements/mountaineering.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"display": {
"icon": {
"item": "iron_boots",
"nbt": "{CustomModelData:3420001}"
},
"title": {
"translate": "%1$s%3427655$s",
"with": [
"Ski",
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
{
"translate": "advancement.gm4.mountaineering.title"
}
]
},
"description": {
"translate": "%1$s%3427655$s",
"with": [
"Wear Skis",
{
"translate": "advancement.gm4.mountaineering.description"
}
],
"color": "gray"
}
},
"parent": "gm4:custom_crafters",
"criteria": {
"mountaineering": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"minecraft:iron_boots"
],
"nbt": "{gm4_mountaineering:{item:\"skis\"}}"
}
]
}
}
}
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
30 changes: 30 additions & 0 deletions gm4_mountaineering/data/gm4/advancements/root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"display": {
"icon": {
"item": "command_block",
"nbt": "{CustomModelData:3420001}"
},
"title": {
"translate": "%1$s%3427655$s",
"with": [
"Gamemode 4",
{"translate": "advancement.gm4.root.title"}
]
},
"description": {
"translate": "%1$s%3427655$s",
"with": [
"Semi-funny blurb about GM4",
{"translate": "advancement.gm4.root.description"}
],
"color": "gray"
},
"background": "textures/block/light_blue_concrete_powder.png",
"announce_to_chat": false
},
"criteria": {
"automatic": {
"trigger": "minecraft:tick"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gm4_mountaineering:check_recipes"
]
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Checks for recipes then runs the relevant function to create mountaineering gear

execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 4 if score $stack_size gm4_crafting matches ..1 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:1b,id:"minecraft:iron_boots",Count:1b},{Slot:3b,id:"minecraft:heavy_weighted_pressure_plate",Count:1b},{Slot:4b,id:"minecraft:heavy_weighted_pressure_plate",Count:1b},{Slot:5b,id:"minecraft:heavy_weighted_pressure_plate",Count:1b}]} unless data storage gm4_custom_crafters:temp/crafter Items[0].tag.gm4_mountaineering run function gm4_mountaineering:new_skis
execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 3 if score $stack_size gm4_crafting matches ..1 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:1b,id:"minecraft:tripwire_hook",Count:1b},{Slot:4b,id:"minecraft:iron_bars",Count:1b},{Slot:7b,id:"minecraft:pointed_dripstone",Count:1b}]} unless data storage gm4_custom_crafters:temp/crafter Items[0].tag.gm4_mountaineering run loot replace block ~ ~ ~ container.0 loot gm4_mountaineering:crafting/poles
execute if score $crafted gm4_crafting matches 0 store success score $crafted gm4_crafting if score $slot_count gm4_crafting matches 4 if score $stack_size gm4_crafting matches ..1 if data storage gm4_custom_crafters:temp/crafter {Items:[{Slot:1b,id:"minecraft:chainmail_boots",Count:1b},{Slot:3b,id:"minecraft:pointed_dripstone",Count:1b},{Slot:4b,id:"minecraft:pointed_dripstone",Count:1b},{Slot:5b,id:"minecraft:pointed_dripstone",Count:1b}]} unless data storage gm4_custom_crafters:temp/crafter Items[0].tag.gm4_mountaineering run function gm4_mountaineering:new_crampons
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
execute unless score mountaineering gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Mountaineering"}
scoreboard players set mountaineering gm4_modules 1

schedule function gm4_mountaineering:main 10t

AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
#$moduleUpdateList
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
execute if score gm4 load.status matches 1 if score gm4_custom_crafters load.status matches 2 run scoreboard players set gm4_mountaineering load.status 1
execute unless score gm4 load.status matches 1 run data modify storage gm4:log queue append value {type:"missing",module:"Mountaineering",require:"Gamemode 4"}
execute unless score gm4_custom_crafters load.status matches 2 run data modify storage gm4:log queue append value {type:"missing",module:"Mountaineering",require:"Custom Crafters"}

execute if score gm4_mountaineering load.status matches 1 run function gm4_mountaineering:init
execute unless score gm4_mountaineering load.status matches 1 run schedule clear gm4_mountaineering:main
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Run functions to provide relevant effects when a piece of mountaineering gear is worn

execute as @a[gamemode=!spectator,gamemode=!adventure,predicate=gm4_mountaineering:wearing_skis] run function gm4_mountaineering:ski_effects/skis_equipped
execute as @a[gamemode=!spectator,gamemode=!adventure,predicate=gm4_mountaineering:holding_poles] run function gm4_mountaineering:ski_effects/poles_equipped
execute as @a[gamemode=!spectator,gamemode=!adventure,predicate=gm4_mountaineering:wearing_crampons] run function gm4_mountaineering:ski_effects/crampons_equipped
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved


schedule function gm4_mountaineering:main 16t
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Creates new crampons upon correct recipe detection
# @s = custom crafter with correct recipe
# run from check_recipes

# Preserve existing item data for provided leather boots
data modify storage gm4_mountaineering:temp crampons_item set from storage gm4_custom_crafters:temp/crafter Items[0]

# Create crampons in custom crafter
loot replace block ~ ~ ~ container.0 loot gm4_mountaineering:crafting/crampons

# Remove temp-stored leather boots from stored data
data remove storage gm4_mountaineering:temp crampons_item
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Creates new skis upon correct recipe detection
# @s = custom crafter with correct recipe
# run from check_recipes

# Preserve existing item data for provided iron boots
data modify storage gm4_mountaineering:temp ski_item set from storage gm4_custom_crafters:temp/crafter Items[0]

# Create skis in custom crafter
loot replace block ~ ~ ~ container.0 loot gm4_mountaineering:crafting/skis

# Remove temp-stored iron boots from stored data
data remove storage gm4_mountaineering:temp ski_item
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Give jump boost effects when wearing crampons
# @s = player wearing crampons
# at @s
# run from main

# Always provide jump boost 1
effect give @s jump_boost 2 0 true

# Provide jump boost 2 when also holding poles
effect give @s[predicate=gm4_mountaineering:holding_poles] jump_boost 2 1 true
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Give jump boost effects when holding poles, as long as the player is on a block (to simulate a cooldown)
# @s = player holding poles
# at @s
# run from main

execute at @a unless block ~ ~-0.2 ~ minecraft:air run effect give @s jump_boost 1 0 true
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Give skiing effects when ski requirements are met
# @s = player meeting ski requirements
# at @s
# run from main

# Give speed when wearing skis and on a snowy block
effect give @s[predicate=gm4_mountaineering:on_snowy_block] speed 2 0 true

# Give extra speed if descending
execute at @a if block ~ ~-1.3 ~ minecraft:air run effect give @s speed 2 1 true
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved

# Clear speed effects and apply slowness if standing on a non-snowy block
execute at @a unless predicate gm4_mountaineering:on_snowy_block_or_air run effect clear @s minecraft:speed
execute at @a unless predicate gm4_mountaineering:on_snowy_block_or_air run effect give @s slowness 3 0 true
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"type": "minecraft:generic",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:loot_table",
"name": "gm4_mountaineering:items/crampons",
"functions": [
{
"function": "minecraft:set_count",
"count": 1
}
]
}
]
},
{
"rolls": 7,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
]
}
]
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"type": "minecraft:generic",
"pools": [
{
"rolls": 8,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:loot_table",
"name": "gm4_mountaineering:items/poles",
"functions": [
{
"function": "minecraft:set_count",
"count": 1
}
]
}
]
}
]
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"type": "minecraft:generic",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:loot_table",
"name": "gm4_mountaineering:items/skis",
"functions": [
{
"function": "minecraft:set_count",
"count": 1
}
]
}
]
},
{
"rolls": 7,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:air"
}
]
}
]
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"type": "minecraft:generic",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:chainmail_boots",
"functions": [
{
"function": "minecraft:set_nbt",
"tag": "{CustomModelData:3420001,gm4_mountaineering:{item:\"crampons\"},HideFlags:64}"
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
},
{
"function": "minecraft:set_name",
"name": {
"translate": "%1$s%3427655$s",
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
"with": [
"Crampons",
{
"translate": "item.gm4.crampons"
}
],
"italic": false
}
},
{
"function": "minecraft:copy_nbt",
"source": {
"type": "minecraft:storage",
"source": "gm4_mountaineering:temp"
},
"ops": [
{
"source": "crampons_item.tag",
"target": "{}",
"op": "merge"
}
]
}
]
}
]
}
]
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "minecraft:generic",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:tripwire_hook",
"functions": [
{
"function": "minecraft:set_nbt",
"tag": "{CustomModelData:3420001,gm4_mountaineering:{item:\"poles\"},HideFlags:64}"
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
},
{
"function": "minecraft:set_name",
"name": {
"translate": "%1$s%3427655$s",
"with": [
"Poles",
{
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
"translate": "item.gm4.poles"
}
],
"italic": false
}
}
]
}
]
}
]
}
AdequateUsername marked this conversation as resolved.
Show resolved Hide resolved
Loading