-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v1.1-mc18w08b'
- Loading branch information
Showing
20 changed files
with
168 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
data/b7s/functions/config/multiplayer_bed/get_enabled.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Checks whether to enable multiplayer bed functionality. | ||
# | ||
# Scores set: | ||
# b7s.val - to 1 if multiplayer bed functionality is enabled, 0 otherwise | ||
# | ||
# Usage: | ||
# /function b7s:config/multiplayer_bed/get_enabled | ||
|
||
scoreboard players set @s b7s.val 0 | ||
execute unless score #b7s.multiplayer_bed b7s.val matches 0 run scoreboard players set @s b7s.val 1 |
18 changes: 18 additions & 0 deletions
18
data/b7s/functions/config/multiplayer_bed/set_enabled.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Enables or disables multiplayer bed functionality. If this functionality is | ||
# enabled, only one player is required to sleep to make the night pass. | ||
# By default, this behaviour is disabled. | ||
# | ||
# Scores set: | ||
# b7s.val - to 1 if multiplayer bed functionality is enabled, 0 otherwise | ||
# | ||
# Usage: | ||
# /function b7s:config/multiplayer_bed/set_enabled | ||
|
||
scoreboard players set #b7s.multiplayer_bed b7s.val 0 | ||
|
||
execute if score @s b7s.val matches -2147483648.. if score @s b7s.val matches 0 run scoreboard players set #b7s.multiplayer_bed b7s.val 0 | ||
execute if score @s b7s.val matches -2147483648.. unless score @s b7s.val matches 0 run scoreboard players set #b7s.multiplayer_bed b7s.val 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
data/b7s/functions/tick/_as_player_if_sleeping_if_multiplayer_bed_enabled.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
execute store result score @s b7s._tmp_1 run gamerule doDaylightCycle | ||
execute unless score @s b7s._tmp_1 matches 0 run scoreboard players set @s b7s.val 0 | ||
execute unless score @s b7s._tmp_1 matches 0 run function b7s:world/set_daytime | ||
|
||
execute store result score @s b7s._tmp_1 run gamerule doWeatherCycle | ||
execute unless score @s b7s._tmp_1 matches 0 run weather clear 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
data/b7s/functions/tick/_unless_v10100_installed.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
execute unless score #b7s._version b7s.val matches 10000.. run function b7s:tick/_unless_v10000_installed | ||
|
||
scoreboard objectives add b7s._sleep_time dummy | ||
|
||
scoreboard players set #b7s.multiplayer_bed b7s.val 1 | ||
|
||
scoreboard players set #b7s._version b7s.val 10100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Sets the daytime of the world. Using this function is completely different | ||
# from using "/time set <time>", as the latter will reset Minecraft's day | ||
# count to time % 24000, which is not always desirable. | ||
# | ||
# Scores required: | ||
# b7s.val - to the new desired daytime | ||
# | ||
# Usage: | ||
# /scoreboard players set @s b7s.val <time> | ||
# /function b7s:world/set_daytime | ||
|
||
scoreboard players operation @s b7s._tmp_1 = @s b7s.val | ||
execute store result score @s b7s._tmp_2 run time query daytime | ||
scoreboard players operation @s b7s._tmp_1 -= @s b7s._tmp_2 | ||
scoreboard players set @s b7s._tmp_2 24000 | ||
scoreboard players operation @s b7s._tmp_1 %= b7s._tmp_2 | ||
execute if score @s b7s._tmp_1 matches ..-1 run scoreboard players add @s b7s._tmp_1 24000 | ||
|
||
execute if score @s b7s._tmp_1 matches 16384.. run time add 16384 | ||
execute if score @s b7s._tmp_1 matches 16384.. run scoreboard players remove @s b7s._tmp_1 16384 | ||
execute if score @s b7s._tmp_1 matches 8192.. run time add 8192 | ||
execute if score @s b7s._tmp_1 matches 8192.. run scoreboard players remove @s b7s._tmp_1 8192 | ||
execute if score @s b7s._tmp_1 matches 4096.. run time add 4096 | ||
execute if score @s b7s._tmp_1 matches 4096.. run scoreboard players remove @s b7s._tmp_1 4096 | ||
execute if score @s b7s._tmp_1 matches 2048.. run time add 2048 | ||
execute if score @s b7s._tmp_1 matches 2048.. run scoreboard players remove @s b7s._tmp_1 2048 | ||
execute if score @s b7s._tmp_1 matches 1024.. run time add 1024 | ||
execute if score @s b7s._tmp_1 matches 1024.. run scoreboard players remove @s b7s._tmp_1 1024 | ||
execute if score @s b7s._tmp_1 matches 512.. run time add 512 | ||
execute if score @s b7s._tmp_1 matches 512.. run scoreboard players remove @s b7s._tmp_1 512 | ||
execute if score @s b7s._tmp_1 matches 256.. run time add 256 | ||
execute if score @s b7s._tmp_1 matches 256.. run scoreboard players remove @s b7s._tmp_1 256 | ||
execute if score @s b7s._tmp_1 matches 128.. run time add 128 | ||
execute if score @s b7s._tmp_1 matches 128.. run scoreboard players remove @s b7s._tmp_1 128 | ||
execute if score @s b7s._tmp_1 matches 64.. run time add 64 | ||
execute if score @s b7s._tmp_1 matches 64.. run scoreboard players remove @s b7s._tmp_1 64 | ||
execute if score @s b7s._tmp_1 matches 32.. run time add 32 | ||
execute if score @s b7s._tmp_1 matches 32.. run scoreboard players remove @s b7s._tmp_1 32 | ||
execute if score @s b7s._tmp_1 matches 16.. run time add 16 | ||
execute if score @s b7s._tmp_1 matches 16.. run scoreboard players remove @s b7s._tmp_1 16 | ||
execute if score @s b7s._tmp_1 matches 8.. run time add 8 | ||
execute if score @s b7s._tmp_1 matches 8.. run scoreboard players remove @s b7s._tmp_1 8 | ||
execute if score @s b7s._tmp_1 matches 4.. run time add 4 | ||
execute if score @s b7s._tmp_1 matches 4.. run scoreboard players remove @s b7s._tmp_1 4 | ||
execute if score @s b7s._tmp_1 matches 2.. run time add 2 | ||
execute if score @s b7s._tmp_1 matches 2.. run scoreboard players remove @s b7s._tmp_1 2 | ||
execute if score @s b7s._tmp_1 matches 1.. run time add 1 | ||
execute if score @s b7s._tmp_1 matches 1.. run scoreboard players remove @s b7s._tmp_1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
print('# This Source Code Form is subject to the terms of the Mozilla Public') | ||
print('# License, v. 2.0. If a copy of the MPL was not distributed with this') | ||
print('# file, You can obtain one at http://mozilla.org/MPL/2.0/.') | ||
print() | ||
print('# Sets the daytime of the world. Using this function is completely different') | ||
print('# from using "/time set <time>", as the latter will reset Minecraft\'s day') | ||
print('# count to time % 24000, which is not always desirable.') | ||
print('#') | ||
print('# Scores required:') | ||
print('# b7s.val - to the new desired daytime') | ||
print('#') | ||
print('# Usage:') | ||
print('# /scoreboard players set @s b7s.val <time>') | ||
print('# /function b7s:world/set_daytime') | ||
print() | ||
|
||
print('scoreboard players operation @s b7s._tmp_1 = @s b7s.val') | ||
print('execute store result score @s b7s._tmp_2 run time query daytime') | ||
print('scoreboard players operation @s b7s._tmp_1 -= @s b7s._tmp_2') | ||
print('scoreboard players set @s b7s._tmp_2 24000') | ||
print('scoreboard players operation @s b7s._tmp_1 %= b7s._tmp_2') | ||
print('execute if score @s b7s._tmp_1 matches ..-1 run scoreboard players add @s b7s._tmp_1 24000') | ||
print() | ||
|
||
for i in range(14, -1, -1): | ||
print('execute if score @s b7s._tmp_1 matches {}.. run time add {}'.format(2 ** i, 2** i)) | ||
print('execute if score @s b7s._tmp_1 matches {}.. run scoreboard players remove @s b7s._tmp_1 {}'.format(2 ** i, 2** i)) |