Merge branch 'master' into 1.16

# Conflicts:
#	src/main/java/carpet/script/CarpetExpression.java
This commit is contained in:
gnembon committed 2020-06-23 00:35:44 -03:00
commit f50fa8cde2
3 files changed
+35 -10

No files matched your search

@@ -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": "当前的值"
}