docs on reset_chunks
This commit is contained in:
1 parent
a7a37a3975
commit
926375700a
5 files changed
+45
-7
No files matched your search
+15
-3
@@ -2362,6 +2362,8 @@ It returns a `map` with a report indicating how many chunks were affected, and h
|
||||
* `requested_chunks`: total number of chunks in the requested area or list
|
||||
* `affected_chunks`: number of chunks that will be removed / regenerated
|
||||
* `loaded_chunks`: number of currently loaded chunks in the requested area / list
|
||||
* `relight_count`: number of relit chunks
|
||||
* `relight_time`: time took to relit chunks
|
||||
* `layer_count_<status>`: number of chunks for which a `<status>` generation step has been performed
|
||||
* `layer_time_<status>`: cumulative time for all chunks spent on generating `<status>` step
|
||||
|
||||
@@ -2553,6 +2555,10 @@ query(e,'type') => villager
|
||||
Returns a valid string to be used in commands to address an entity. Its UUID for all entities except
|
||||
player, where its their name.
|
||||
|
||||
## `query(e, 'persistence')`
|
||||
|
||||
Returns if a mob has a persistence tag or not. Returns `null` for non-mob entities.
|
||||
|
||||
<pre>
|
||||
run('/kill ' + e~'command_name');
|
||||
</pre>
|
||||
@@ -2836,9 +2842,15 @@ Sets the corresponding component of the motion vector.
|
||||
|
||||
Adds a vector to the motion vector. Most realistic way to apply a force to an entity.
|
||||
|
||||
### `modify(e, 'custom_name'), modify(e, 'custom_name', name)`
|
||||
### `modify(e, 'custom_name')`, `modify(e, 'custom_name', name)`, `modify(e, 'custom_name', name, visible)`
|
||||
|
||||
Sets the custom name of the entity.
|
||||
Sets the custom name of the entity. Without arguments - clears current custom name. Optional visible affects
|
||||
if the custom name is always visible, even through blocks.
|
||||
|
||||
### `modify(e, 'persistence', bool?)`
|
||||
|
||||
Sets the entity persistence tag to `true` (default) or `false`. Only affects mobs. Persistent mobs
|
||||
don't despawn and don't count towards the mobcap.
|
||||
|
||||
### `modify(e, 'age', number)`
|
||||
|
||||
@@ -3666,7 +3678,7 @@ Queries in-game statistics for certain values. Categories include:
|
||||
* `picked_up`: items picked up
|
||||
* `dropped`: items dropped
|
||||
* `killed`: mobs killed
|
||||
* `killed_by`: blocks mined
|
||||
* `killed_by`: mobs killed by
|
||||
* `custom`: various random stats
|
||||
|
||||
For the options of `entry`, consult your statistics page, or give it a guess.
|
||||
|
||||
@@ -716,6 +716,8 @@ It returns a `map` with a report indicating how many chunks were affected, and h
|
||||
* `requested_chunks`: total number of chunks in the requested area or list
|
||||
* `affected_chunks`: number of chunks that will be removed / regenerated
|
||||
* `loaded_chunks`: number of currently loaded chunks in the requested area / list
|
||||
* `relight_count`: number of relit chunks
|
||||
* `relight_time`: time took to relit chunks
|
||||
* `layer_count_<status>`: number of chunks for which a `<status>` generation step has been performed
|
||||
* `layer_time_<status>`: cumulative time for all chunks spent on generating `<status>` step
|
||||
|
||||
|
||||
@@ -9,5 +9,7 @@ public interface ThreadedAnvilChunkStorageInterface
|
||||
{
|
||||
Map<String, Integer> regenerateChunkRegion(List<ChunkPos> requestedChunks);
|
||||
|
||||
void relightChunk(ChunkPos pos);
|
||||
|
||||
void releaseRelightTicket(ChunkPos pos);
|
||||
}
|
||||
@@ -227,6 +227,31 @@ public abstract class ThreadedAnvilChunkStorage_scarpetChunkCreationMixin implem
|
||||
return future.join();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void relightChunk(ChunkPos pos)
|
||||
{
|
||||
this.addTicket(pos);
|
||||
this.tickTicketManager();
|
||||
if (this.currentChunkHolders.get(pos.toLong()).getCompletedChunk() == null) // chunk unloaded
|
||||
if (WorldTools.canHasChunk(this.world, pos, null, true))
|
||||
this.currentChunkHolders.get(pos.toLong()).createFuture(ChunkStatus.EMPTY, (ThreadedAnvilChunkStorage) (Object) this);
|
||||
final Chunk chunk = this.getCurrentChunk(pos);
|
||||
if (!(chunk.getStatus().isAtLeast(ChunkStatus.LIGHT.getPrevious()))) return;
|
||||
((ServerLightingProviderInterface) this.serverLightingProvider).removeLightData(chunk);
|
||||
this.addRelightTicket(pos);
|
||||
final CompletableFuture<?> lightFuture = this.createChunkRegionFuture(pos, 1, (pos_) -> ChunkStatus.LIGHT)
|
||||
.thenCompose(
|
||||
either -> either.map(
|
||||
list -> ((ServerLightingProviderInterface) this.serverLightingProvider).relight(chunk),
|
||||
unloaded -> {
|
||||
this.releaseRelightTicket(pos);
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
)
|
||||
);
|
||||
this.waitFor(lightFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Integer> regenerateChunkRegion(final List<ChunkPos> requestedChunksList)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@ import carpet.fakes.MinecraftServerInterface;
|
||||
import carpet.fakes.BiomeArrayInterface;
|
||||
import carpet.fakes.RecipeManagerInterface;
|
||||
import carpet.fakes.ServerChunkManagerInterface;
|
||||
import carpet.fakes.ServerLightingProviderInterface;
|
||||
import carpet.fakes.StatTypeInterface;
|
||||
import carpet.fakes.ThreadedAnvilChunkStorageInterface;
|
||||
import carpet.helpers.FeatureGenerator;
|
||||
@@ -142,7 +141,6 @@ import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.ChunkRandom;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -3186,9 +3184,8 @@ public class CarpetExpression
|
||||
BlockArgument locator = BlockArgument.findIn(cc, lv, 0);
|
||||
BlockPos pos = locator.block.getPos();
|
||||
ServerWorld world = cc.s.getWorld();
|
||||
((ServerLightingProviderInterface)world.getChunkManager().getLightingProvider()).resetLight(world.getChunk(pos), new ChunkPos(pos)); //light(world.getChunk(pos), false);
|
||||
((ThreadedAnvilChunkStorageInterface) world.getChunkManager().threadedAnvilChunkStorage).relightChunk(new ChunkPos(pos));
|
||||
forceChunkUpdate(pos, world);
|
||||
world.getChunkManager().getLightingProvider().light(world.getChunk(pos), false);
|
||||
return LazyValue.TRUE;
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user