Merge branch 'master' into 1.16
# Conflicts: # src/main/java/carpet/script/CarpetExpression.java
This commit is contained in:
commit
f50fa8cde2
3 files changed
+35
-10
No files matched your search
@@ -17,9 +17,9 @@ block positions. All variables starting with `_` are read-only, and cannot be de
|
||||
|
||||
`scarpet` accepts numeric and string liters constants. Numbers look like `1, 2.5, -3e-7, 0xff,` and are internally
|
||||
represented as Java's `double` but `scarpet` will try to trim trailing zeros as much as possible so if you need to
|
||||
use them as intergers, you can. Strings using single quoting, for multiple reasons, but primarily to allow for
|
||||
use them as intergers, you can. Strings use single quoting, for multiple reasons, but primarily to allow for
|
||||
easier use of strings inside doubly quoted command arguments (when passing a script as a parameter of `/script fill`
|
||||
for example, or when typing in jsons inside scarpet to feed back into a `/data merge` command for example.
|
||||
for example), or when typing in jsons inside scarpet (to feed back into a `/data merge` command for example).
|
||||
Strings also use backslashes `\` for quoting special characters, in both plain strings and regular expressions
|
||||
|
||||
<pre>
|
||||
|
||||
@@ -109,6 +109,7 @@ import net.minecraft.stat.Stat;
|
||||
import net.minecraft.stat.StatType;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.structure.StructureFeatures;
|
||||
import net.minecraft.structure.StructurePiece;
|
||||
import net.minecraft.structure.StructureStart;
|
||||
import net.minecraft.text.LiteralText;
|
||||
@@ -128,6 +129,7 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.feature.StructureFeature;
|
||||
import net.minecraft.world.SpawnHelper;
|
||||
@@ -359,6 +361,18 @@ public class CarpetExpression
|
||||
return MapValue.wrap(ret);
|
||||
}
|
||||
|
||||
private static long lastSeed = -1;
|
||||
private void BooYah(ChunkGenerator generator)
|
||||
{
|
||||
synchronized (generator)
|
||||
{
|
||||
if (generator.getSeed() != lastSeed)
|
||||
{
|
||||
StructureFeatures.STRONGHOLD.shouldStartAt(null, generator, null, 0, 0, null);
|
||||
lastSeed = generator.getSeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void API_BlockManipulation()
|
||||
{
|
||||
this.expr.addLazyFunction("block", -1, (c, t, lv) ->
|
||||
@@ -1144,6 +1158,9 @@ public class CarpetExpression
|
||||
BlockArgument locator = BlockArgument.findIn(cc, lv, 0);
|
||||
|
||||
ServerWorld world = cc.s.getWorld();
|
||||
|
||||
BooYah(world.getChunkManager().getChunkGenerator());
|
||||
|
||||
BlockPos pos = locator.block.getPos();
|
||||
StructureFeature<?> structure = null;
|
||||
boolean needSize = false;
|
||||
@@ -3236,10 +3253,17 @@ public class CarpetExpression
|
||||
innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(dim));
|
||||
}
|
||||
}
|
||||
((CarpetContext) c).s = innerSource;
|
||||
Value retval = lv.get(1).evalValue(c);
|
||||
((CarpetContext) c).s = outerSource;
|
||||
return (cc, tt) -> retval;
|
||||
try
|
||||
{
|
||||
((CarpetContext) c).s = innerSource;
|
||||
Value retval = lv.get(1).evalValue(c);
|
||||
return (cc, tt) -> retval;
|
||||
}
|
||||
finally
|
||||
{
|
||||
((CarpetContext) c).s = outerSource;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.expr.addLazyFunction("plop", 4, (c, t, lv) ->{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"rule.antiCheatDisabled.name": "移动检测通杀",
|
||||
"rule.antiCheatDisabled.name": "禁用反作弊移动监测",
|
||||
"rule.antiCheatDisabled.desc": "防止玩家因为“本服务器未启用飞行”,“移动过快”等原因被踢出",
|
||||
|
||||
"rule.carpets.name": "放置地毯执行功能",
|
||||
"rule.carpets.name": "多功能地毯",
|
||||
"rule.carpets.desc": "通过放置地毯方块快捷执行部分功能",
|
||||
|
||||
"rule.combineXPOrbs.name": "经验球合并",
|
||||
@@ -135,7 +135,7 @@
|
||||
"rule.pushLimit.desc": "自定义活塞推动上限",
|
||||
"rule.pushLimit.extra.0": "你必须在1-1024中选取一个值",
|
||||
|
||||
"rule.quasiConnectivity.name": "qC激活开关",
|
||||
"rule.quasiConnectivity.name": "半连接激活开关",
|
||||
"rule.quasiConnectivity.desc": "活塞,发射器和投掷器在他们上方方块激活时是否响应",
|
||||
"rule.quasiConnectivity.extra.0": "设置为true为开启 设置为false为禁用",
|
||||
|
||||
@@ -228,7 +228,8 @@
|
||||
"ui.tags": "分类",
|
||||
"ui.change_permanently": "永久更改",
|
||||
"ui.click_to_keep_the_settings_in_%(conf)s_to_save_across_restarts": "点击此按钮以使此选项保存于%s,重启后依旧生效",
|
||||
"ui.rule_%(rule)s_will_now_default_to_%(value)s": "规则%s将会被默认设置为%s",
|
||||
"ui.rule_%(rule)s_will_now_default_to_%(value)s": "规则“%s”将会被默认设置为%s",
|
||||
"ui.rule_%(rule)s_not_set_restart": "规则“%s”将在重启后恢复默认值",
|
||||
"ui.current_value": "当前的值"
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user