diff --git a/src/main/java/carpet/mixins/WorldChunk_fillUpdatesMixin.java b/src/main/java/carpet/mixins/WorldChunk_fillUpdatesMixin.java index b780dd36..10eb373e 100644 --- a/src/main/java/carpet/mixins/WorldChunk_fillUpdatesMixin.java +++ b/src/main/java/carpet/mixins/WorldChunk_fillUpdatesMixin.java @@ -21,14 +21,4 @@ public class WorldChunk_fillUpdatesMixin if (!CarpetSettings.impendingFillSkipUpdates) blockState.onBlockAdded(world_1, blockPos_1, blockState_1, boolean_1); } - - @Redirect(method = "setBlockState", at = @At( - value = "INVOKE", - target = "Lnet/minecraft/block/BlockState;onBlockRemoved(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)V" - )) - private void onRemoved(BlockState blockState, World world_1, BlockPos blockPos_1, BlockState blockState_1, boolean boolean_1) - { - if (!CarpetSettings.impendingFillSkipUpdates) - blockState.onBlockRemoved(world_1, blockPos_1, blockState_1, boolean_1); - } } diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index 9c29cb09..e1aacde9 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -223,7 +223,7 @@ public class EntityValue extends Value put("dimension", (e, a) -> new StringValue(nameFromRegistryId(Registry.DIMENSION.getId(e.dimension)))); put("height", (e, a) -> new NumericValue(e.getDimensions(EntityPose.STANDING).height)); put("width", (e, a) -> new NumericValue(e.getDimensions(EntityPose.STANDING).width)); - put("eye_height", (e, a) -> new NumericValue(e.getEyeHeight(EntityPose.STANDING))); + put("eye_height", (e, a) -> new NumericValue(e.getStandingEyeHeight())); put("age", (e, a) -> new NumericValue(e.age)); put("despawn_timer", (e, a) -> e instanceof LivingEntity?new NumericValue(((LivingEntity) e).getDespawnCounter()):Value.NULL); put("item", (e, a) -> (e instanceof ItemEntity)?ListValue.fromItemStack(((ItemEntity) e).getStack()):Value.NULL); diff --git a/src/main/resources/assets/carpet/scripts/camera.sc b/src/main/resources/assets/carpet/scripts/camera.sc index 960ac306..f06c4948 100644 --- a/src/main/resources/assets/carpet/scripts/camera.sc +++ b/src/main/resources/assets/carpet/scripts/camera.sc @@ -153,28 +153,29 @@ play(fps) -> p = player(); __assert_valid_for_motion(); __prepare_path_if_needed(); - if ((fps % 20 != 0) || fps < 20, exit('FPS needs to be multiples of 20') ); - tpt = round(fps / 20); - mspt = 50 / tpt; - start_time = time(); - point = 0; - loop( length(global_points)-1, - segment = _; - start = global_points:segment:1; - end = global_points:(segment+1):1; - loop(end-start, - v = __get_path_at(segment, start, _); - modify(p, 'location', v); - point += 1; - if ((point % tpt == 0), game_tick()); - end_time = time(); - took = end_time - start_time; - if (took < mspt, sleep(mspt-took)); - start_time = time() - ) - ); - game_tick(1000); - 'Done!' + task( _(outer(fps), outer(p)) -> ( + //if ((fps % 20 != 0) || fps < 20, exit('FPS needs to be multiples of 20') ); + tpt = fps / 20; + mspt = 50 / tpt; + start_time = time(); + point = 0; + loop( length(global_points)-1, + segment = _; + start = global_points:segment:1; + end = global_points:(segment+1):1; + loop(end-start, + v = __get_path_at(segment, start, _); + modify(p, 'location', v); + point += 1; + end_time = time(); + took = end_time - start_time; + if (took < mspt, sleep(mspt-took)); + start_time = time() + ) + ); + 'Done!' + )); + ); _show_path_tick(particle_type, total) -> (