Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Players should now be able to sit on even more blocks without 'jumping up' first. - Moved time-keeping scores to C.O.R.E tick registers. Should improve performance slightly. - Fixed a bug where all players get unseated if any one player glitched - Fixed a bug where players fail to sit sometimes when 'Only-If-Sneaking' is enabled
- Loading branch information
Showing
50 changed files
with
596 additions
and
197 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
Xmas Labs - C.O.R.E/data/x_core/functions/__random_number.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,36 @@ | ||
####### | ||
# Compiled from data/x_core/functions/__random_number.mcscript | ||
# to .//Xmas Labs - C.O.R.E/data/x_core/functions/__random_number.mcfunction | ||
# | ||
# Generated by Minecraft Script for 1.16 | ||
###### | ||
|
||
|
||
# C.O.R.E | __random_number | ||
# Recursing part of random number function | ||
|
||
|
||
scoreboard players operation x_RNG x_R0 = x_RNG x_R2 | ||
scoreboard players operation x_RNG x_R0 -= x_RNG x_R1 | ||
execute if score x_RNG x_R0 matches ..0 run scoreboard players set x_CPU x_R3 -1 | ||
execute if score x_RNG x_R0 matches ..0 run scoreboard players operation x_RNG x_R0 = x_RNG x_R1 | ||
|
||
execute unless score x_CPU x_R3 matches ..-1 run scoreboard players set x_CPU x_R0 2 | ||
execute unless score x_CPU x_R3 matches ..-1 run scoreboard players operation x_RNG x_R0 /= x_CPU x_R0 | ||
execute unless score x_CPU x_R3 matches ..-1 run scoreboard players operation x_RNG x_R0 += x_RNG x_R1 | ||
execute unless score x_CPU x_R3 matches ..-1 run scoreboard players set x_CPU x_R3 1 | ||
execute unless score x_CPU x_R3 matches ..-1 unless score x_RNG x_R3 matches 0.. run scoreboard players set x_RNG x_R3 50 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 10 if predicate x_core:random_10 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 20 if predicate x_core:random_20 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 30 if predicate x_core:random_30 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 40 if predicate x_core:random_40 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 50 if predicate x_core:random_50 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 60 if predicate x_core:random_60 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 70 if predicate x_core:random_70 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 80 if predicate x_core:random_80 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_RNG x_R3 matches 90 if predicate x_core:random_90 run scoreboard players set x_CPU x_R3 2 | ||
execute unless score x_CPU x_R3 matches ..-1 if score x_CPU x_R3 matches 1 run scoreboard players operation x_RNG x_R2 = x_RNG x_R0 | ||
execute unless score x_CPU x_R3 matches ..-1 unless score x_CPU x_R3 matches 1 run scoreboard players operation x_RNG x_R1 = x_RNG x_R0 | ||
execute unless score x_CPU x_R3 matches ..-1 run function x_core:__random_number | ||
|
||
scoreboard players reset x_CPU x_R3 |
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
82 changes: 38 additions & 44 deletions
82
Xmas Labs - C.O.R.E/data/x_core/functions/load.mcfunction
Large diffs are not rendered by default.
Oops, something went wrong.
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
18 changes: 18 additions & 0 deletions
18
Xmas Labs - C.O.R.E/data/x_core/functions/random_number.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 @@ | ||
####### | ||
# Compiled from data/x_core/functions/random_number.mcscript | ||
# to .//Xmas Labs - C.O.R.E/data/x_core/functions/random_number.mcfunction | ||
# | ||
# Generated by Minecraft Script for 1.16 | ||
###### | ||
|
||
|
||
# C.O.R.E | random_number | ||
# Generates a random number and stores it in the x_RNG player unit | ||
|
||
|
||
execute if score x_RNG x_R1 > x_RNG x_R2 run scoreboard players operation x_CPU x_R0 = x_RNG x_R1 | ||
execute if score x_RNG x_R1 > x_RNG x_R2 run scoreboard players operation x_RNG x_R1 = x_RNG x_R2 | ||
execute if score x_RNG x_R1 > x_RNG x_R2 run scoreboard players operation x_RNG x_R2 = x_CPU x_R0 | ||
|
||
scoreboard players reset x_CPU x_R3 | ||
function x_core:__random_number |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
####### | ||
# Compiled from data/x_core/functions/test.mcscript | ||
# to .//Xmas Labs - C.O.R.E/data/x_core/functions/test.mcfunction | ||
# | ||
# Generated by Minecraft Script for 1.16 | ||
###### | ||
scoreboard players set x_RNG x_R1 1 | ||
scoreboard players set x_RNG x_R2 100 | ||
function x_core:random_number |
18 changes: 18 additions & 0 deletions
18
Xmas Labs - C.O.R.E/data/x_core/functions/ticker.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 @@ | ||
####### | ||
# Compiled from data/x_core/functions/ticker.mcscript | ||
# to .//Xmas Labs - C.O.R.E/data/x_core/functions/ticker.mcfunction | ||
# | ||
# Generated by Minecraft Script for 1.16 | ||
###### | ||
|
||
|
||
# C.O.R.E | ticker | ||
# Manage tickers. | ||
|
||
|
||
execute if score x_CPU x_TICK matches 2147483647.. run scoreboard players set x_CPU x_TICK 0 | ||
|
||
execute if score x_CPU x_TICK matches ..2147483647 run scoreboard players add x_CPU x_TICK 1 | ||
|
||
execute as @e[scores={x_TICK=2147483647..}] at @s run scoreboard players set @s x_TICK 0 | ||
execute as @e[scores={x_TICK=..2147483647}] at @s run scoreboard players add @s x_TICK 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.2 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.3 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.4 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.5 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.6 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.7 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.8 | ||
} |
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,4 @@ | ||
{ | ||
"condition":"random_chance", | ||
"chance": 0.9 | ||
} |
129 changes: 129 additions & 0 deletions
129
Xmas Labs - C.O.R.E/data/x_core/scripts/__random_number.mcscript
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,129 @@ | ||
|
||
# | ||
# | ||
# C.O.R.E | __random_number | ||
# Recursing part of random number function | ||
# | ||
# | ||
|
||
|
||
|
||
/// Get the difference between upper and lower limits | ||
/scoreboard players operation x_RNG x_R0 = x_RNG x_R2 | ||
/scoreboard players operation x_RNG x_R0 -= x_RNG x_R1 | ||
|
||
|
||
/// If upper and lower limits are equal, | ||
if('score x_RNG x_R0 matches ..0'){ | ||
|
||
/// Set control variable to break recursion | ||
/scoreboard players set x_CPU x_R3 -1 | ||
|
||
/// Set lower limit as selected number | ||
/scoreboard players operation x_RNG x_R0 = x_RNG x_R1 | ||
} | ||
|
||
|
||
/// If control variable not set to break recursion, | ||
if(!'score x_CPU x_R3 matches ..-1') { | ||
|
||
/// Get mid-value from difference in upper and lower limits | ||
/scoreboard players set x_CPU x_R0 2 | ||
/scoreboard players operation x_RNG x_R0 /= x_CPU x_R0 | ||
/scoreboard players operation x_RNG x_R0 += x_RNG x_R1 | ||
|
||
/// Set control variable to pick lower half | ||
/scoreboard players set x_CPU x_R3 1 | ||
|
||
|
||
/// If weight is unset, | ||
if(!'score x_RNG x_R3 matches 0..') { | ||
|
||
/// Use 50% | ||
/scoreboard players set x_RNG x_R3 50 | ||
} | ||
|
||
/// If weight is 10% and 10% random check is true | ||
if('score x_RNG x_R3 matches 10' && 'predicate x_core:random_10') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 20% and 20% random check is true | ||
if('score x_RNG x_R3 matches 20' && 'predicate x_core:random_20') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 30% and 30% random check is true | ||
if('score x_RNG x_R3 matches 30' && 'predicate x_core:random_30') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 40% and 40% random check is true | ||
if('score x_RNG x_R3 matches 40' && 'predicate x_core:random_40') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 50% and 50% random check is true | ||
if('score x_RNG x_R3 matches 50' && 'predicate x_core:random_50') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 60% and 60% random check is true | ||
if('score x_RNG x_R3 matches 60' && 'predicate x_core:random_60') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 70% and 70% random check is true | ||
if('score x_RNG x_R3 matches 70' && 'predicate x_core:random_70') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 80% and 80% random check is true | ||
if('score x_RNG x_R3 matches 80' && 'predicate x_core:random_80') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
/// If weight is 90% and 90% random check is true | ||
if('score x_RNG x_R3 matches 90' && 'predicate x_core:random_90') { | ||
|
||
/// Set control variable to pick upper half | ||
/scoreboard players set x_CPU x_R3 2 | ||
} | ||
|
||
|
||
/// If control variable set to lower half, | ||
if('score x_CPU x_R3 matches 1') { | ||
|
||
/// Set upper limit to mid-value | ||
/scoreboard players operation x_RNG x_R2 = x_RNG x_R0 | ||
|
||
/// If control variable set to upper half, | ||
} else { | ||
|
||
/// Set lower limit to mid-value | ||
/scoreboard players operation x_RNG x_R1 = x_RNG x_R0 | ||
} | ||
|
||
|
||
/// Recurse | ||
/function x_core:__random_number | ||
} | ||
|
||
/// Reset control variable | ||
/scoreboard players reset x_CPU x_R3 |
Oops, something went wrong.