Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-05-15 01:43:35 -03:00
commit ec43fd2f24
5 files changed
+29 -7

No files matched your search

+7 -2
View File
@@ -1690,9 +1690,10 @@ If type is `null`, POI at position is removed. In any case, previous POI is also
Interestingly, `unemployed`, and `nitwit` are not used in the game, meaning, they could be used as permanent spatial
markers for scarpet apps. `meeting` is the only one with increased max occupancy of 32.
### `set_biome(pos, biome_name)`
### `set_biome(pos, biome_name, update=true)`
Changes the biome at that block position.
Changes the biome at that block position. if update is specified and false, then chunk will not be refreshed
on the clients. Biome changes can only be send to clients with the entire data from the chunk.
### `update(pos)`
@@ -2249,6 +2250,10 @@ Feature list:
* `twisting_vines` (1.16)
* `basalt_pillar` (1.16)
### `reload_chunk(pos)`
Sends full chunk data to clients. Useful when lots stuff happened and you want to refresh it on the clients.
### `reset_chunk(pos)`, `reset_chunk(from_pos, to_pos)`, `reset_chunk(l(pos, ...))`
Removes and resets the chunk, all chunks in the specified area or all chunks in a list at once, removing all previous
blocks and entities, and replacing it with a new generation. For all currently loaded chunks, they will be brought
+7 -2
View File
@@ -134,9 +134,10 @@ If type is `null`, POI at position is removed. In any case, previous POI is also
Interestingly, `unemployed`, and `nitwit` are not used in the game, meaning, they could be used as permanent spatial
markers for scarpet apps. `meeting` is the only one with increased max occupancy of 32.
### `set_biome(pos, biome_name)`
### `set_biome(pos, biome_name, update=true)`
Changes the biome at that block position.
Changes the biome at that block position. if update is specified and false, then chunk will not be refreshed
on the clients. Biome changes can only be send to clients with the entire data from the chunk.
### `update(pos)`
@@ -693,6 +694,10 @@ Feature list:
* `twisting_vines` (1.16)
* `basalt_pillar` (1.16)
### `reload_chunk(pos)`
Sends full chunk data to clients. Useful when lots stuff happened and you want to refresh it on the clients.
### `reset_chunk(pos)`, `reset_chunk(from_pos, to_pos)`, `reset_chunk(l(pos, ...))`
Removes and resets the chunk, all chunks in the specified area or all chunks in a list at once, removing all previous
blocks and entities, and replacing it with a new generation. For all currently loaded chunks, they will be brought
@@ -66,6 +66,7 @@ property
query
random_tick
rect
reload_chunk
remove_all_markers
reset_chunk
run
@@ -55,7 +55,7 @@
set without_updates
blocks_movement block_sound material map_colour property block_properties block_data poi set_poi
place_item set_biome biome loaded_status generation_status inhabited_time spawn_potential chunk_tickets
structure_eligibility structures structure_references set_structure reset_chunk
structure_eligibility structures structure_references set_structure reset_chunk reload_chunk
scoreboard scoreboard_add scoreboard_remove scoreboard_display
@@ -1127,12 +1127,23 @@ public class CarpetExpression
Biome biome = Registry.BIOME.get(new Identifier(biomeName));
if (biome == null)
throw new InternalExpressionException("Unknown biome: "+biomeName);
boolean doImmediateUpdate = true;
if (lv.size() > locator.offset+1)
{
doImmediateUpdate = lv.get(locator.offset+1).evalValue(c).getBoolean();
}
ServerWorld world = cc.s.getWorld();
BlockPos pos = locator.block.getPos();
Chunk chunk = world.getChunk(pos.getX() >> 4, pos.getZ() >> 4, ChunkStatus.BIOMES);
((BiomeArrayInterface)chunk.getBiomeArray()).setBiomeAtIndex(pos, world, biome);
this.forceChunkUpdate(pos, world);
return LazyValue.NULL;
if (doImmediateUpdate) this.forceChunkUpdate(pos, world);
return LazyValue.TRUE;
});
this.expr.addLazyFunction("reload_chunk", -1, (c, t, lv) -> {
CarpetContext cc = (CarpetContext)c;
this.forceChunkUpdate(BlockArgument.findIn(cc, lv, 0).block.getPos(), cc.s.getWorld());
return LazyValue.TRUE;
});
this.expr.addLazyFunction("structure_references", -1, (c, t, lv) -> {